用chirp_stack swagger文档生成代码
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateAwsSnsIntegrationParams creates a new ApplicationServiceCreateAwsSnsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateAwsSnsIntegrationParams() *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAwsSnsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAwsSnsIntegrationParamsWithTimeout creates a new ApplicationServiceCreateAwsSnsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateAwsSnsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAwsSnsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAwsSnsIntegrationParamsWithContext creates a new ApplicationServiceCreateAwsSnsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateAwsSnsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAwsSnsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAwsSnsIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateAwsSnsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateAwsSnsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAwsSnsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAwsSnsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create aws sns integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateAwsSnsIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateAwsSnsIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WithDefaults() *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WithBody(body ApplicationServiceCreateAwsSnsIntegrationBody) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) SetBody(body ApplicationServiceCreateAwsSnsIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateAwsSnsIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create aws sns integration params | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,392 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateAwsSnsIntegrationReader is a Reader for the ApplicationServiceCreateAwsSnsIntegration structure. | ||||
| type ApplicationServiceCreateAwsSnsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateAwsSnsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateAwsSnsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAwsSnsIntegrationOK creates a ApplicationServiceCreateAwsSnsIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateAwsSnsIntegrationOK() *ApplicationServiceCreateAwsSnsIntegrationOK { | ||||
| 	return &ApplicationServiceCreateAwsSnsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAwsSnsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateAwsSnsIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create aws sns integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create aws sns integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create aws sns integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create aws sns integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create aws sns integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create aws sns integration o k response | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/aws-sns][%d] applicationServiceCreateAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/aws-sns][%d] applicationServiceCreateAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAwsSnsIntegrationDefault creates a ApplicationServiceCreateAwsSnsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateAwsSnsIntegrationDefault(code int) *ApplicationServiceCreateAwsSnsIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateAwsSnsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAwsSnsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateAwsSnsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create aws sns integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create aws sns integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create aws sns integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create aws sns integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create aws sns integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create aws sns integration default response | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/aws-sns][%d] ApplicationService_CreateAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/aws-sns][%d] ApplicationService_CreateAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAwsSnsIntegrationBody application service create aws sns integration body | ||||
| swagger:model ApplicationServiceCreateAwsSnsIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateAwsSnsIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create aws sns integration body | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create aws sns integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateAwsSnsIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// AWS Access Key ID. | ||||
| 	AccessKeyID string `json:"accessKeyId,omitempty"` | ||||
|  | ||||
| 	// Encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// AWS region. | ||||
| 	Region string `json:"region,omitempty"` | ||||
|  | ||||
| 	// AWS Secret Access Key. | ||||
| 	SecretAccessKey string `json:"secretAccessKey,omitempty"` | ||||
|  | ||||
| 	// Topic ARN. | ||||
| 	TopicArn string `json:"topicArn,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create aws sns integration params body integration | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create aws sns integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateAwsSnsIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateAzureServiceBusIntegrationParams creates a new ApplicationServiceCreateAzureServiceBusIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateAzureServiceBusIntegrationParams() *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAzureServiceBusIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAzureServiceBusIntegrationParamsWithTimeout creates a new ApplicationServiceCreateAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateAzureServiceBusIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAzureServiceBusIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAzureServiceBusIntegrationParamsWithContext creates a new ApplicationServiceCreateAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateAzureServiceBusIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAzureServiceBusIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAzureServiceBusIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateAzureServiceBusIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceCreateAzureServiceBusIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAzureServiceBusIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create azure service bus integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateAzureServiceBusIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateAzureServiceBusIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WithDefaults() *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WithBody(body ApplicationServiceCreateAzureServiceBusIntegrationBody) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) SetBody(body ApplicationServiceCreateAzureServiceBusIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateAzureServiceBusIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create azure service bus integration params | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,387 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateAzureServiceBusIntegrationReader is a Reader for the ApplicationServiceCreateAzureServiceBusIntegration structure. | ||||
| type ApplicationServiceCreateAzureServiceBusIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateAzureServiceBusIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateAzureServiceBusIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAzureServiceBusIntegrationOK creates a ApplicationServiceCreateAzureServiceBusIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateAzureServiceBusIntegrationOK() *ApplicationServiceCreateAzureServiceBusIntegrationOK { | ||||
| 	return &ApplicationServiceCreateAzureServiceBusIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAzureServiceBusIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateAzureServiceBusIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create azure service bus integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create azure service bus integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create azure service bus integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create azure service bus integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create azure service bus integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create azure service bus integration o k response | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] applicationServiceCreateAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] applicationServiceCreateAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateAzureServiceBusIntegrationDefault creates a ApplicationServiceCreateAzureServiceBusIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateAzureServiceBusIntegrationDefault(code int) *ApplicationServiceCreateAzureServiceBusIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateAzureServiceBusIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAzureServiceBusIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateAzureServiceBusIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create azure service bus integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create azure service bus integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create azure service bus integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create azure service bus integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create azure service bus integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create azure service bus integration default response | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] ApplicationService_CreateAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] ApplicationService_CreateAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAzureServiceBusIntegrationBody application service create azure service bus integration body | ||||
| swagger:model ApplicationServiceCreateAzureServiceBusIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateAzureServiceBusIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create azure service bus integration body | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create azure service bus integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateAzureServiceBusIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Connection string. | ||||
| 	ConnectionString string `json:"connectionString,omitempty"` | ||||
|  | ||||
| 	// Encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// Publish name. | ||||
| 	// This is the name of the topic or queue. | ||||
| 	PublishName string `json:"publishName,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create azure service bus integration params body integration | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create azure service bus integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateAzureServiceBusIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateGcpPubSubIntegrationParams creates a new ApplicationServiceCreateGcpPubSubIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateGcpPubSubIntegrationParams() *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceCreateGcpPubSubIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateGcpPubSubIntegrationParamsWithTimeout creates a new ApplicationServiceCreateGcpPubSubIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateGcpPubSubIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceCreateGcpPubSubIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateGcpPubSubIntegrationParamsWithContext creates a new ApplicationServiceCreateGcpPubSubIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateGcpPubSubIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceCreateGcpPubSubIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateGcpPubSubIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateGcpPubSubIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateGcpPubSubIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceCreateGcpPubSubIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateGcpPubSubIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create gcp pub sub integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateGcpPubSubIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateGcpPubSubIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WithDefaults() *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WithBody(body ApplicationServiceCreateGcpPubSubIntegrationBody) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) SetBody(body ApplicationServiceCreateGcpPubSubIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateGcpPubSubIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create gcp pub sub integration params | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,393 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateGcpPubSubIntegrationReader is a Reader for the ApplicationServiceCreateGcpPubSubIntegration structure. | ||||
| type ApplicationServiceCreateGcpPubSubIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateGcpPubSubIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateGcpPubSubIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateGcpPubSubIntegrationOK creates a ApplicationServiceCreateGcpPubSubIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateGcpPubSubIntegrationOK() *ApplicationServiceCreateGcpPubSubIntegrationOK { | ||||
| 	return &ApplicationServiceCreateGcpPubSubIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateGcpPubSubIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateGcpPubSubIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create gcp pub sub integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create gcp pub sub integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create gcp pub sub integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create gcp pub sub integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create gcp pub sub integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create gcp pub sub integration o k response | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] applicationServiceCreateGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] applicationServiceCreateGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateGcpPubSubIntegrationDefault creates a ApplicationServiceCreateGcpPubSubIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateGcpPubSubIntegrationDefault(code int) *ApplicationServiceCreateGcpPubSubIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateGcpPubSubIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateGcpPubSubIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateGcpPubSubIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create gcp pub sub integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create gcp pub sub integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create gcp pub sub integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create gcp pub sub integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create gcp pub sub integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create gcp pub sub integration default response | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_CreateGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_CreateGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateGcpPubSubIntegrationBody application service create gcp pub sub integration body | ||||
| swagger:model ApplicationServiceCreateGcpPubSubIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateGcpPubSubIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create gcp pub sub integration body | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create gcp pub sub integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateGcpPubSubIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Credentials file. | ||||
| 	// This IAM service-account credentials file (JSON) must have the following | ||||
| 	// Pub/Sub roles: | ||||
| 	// * Pub/Sub Publisher | ||||
| 	CredentialsFile string `json:"credentialsFile,omitempty"` | ||||
|  | ||||
| 	// Encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// Project ID. | ||||
| 	ProjectID string `json:"projectId,omitempty"` | ||||
|  | ||||
| 	// Topic name. | ||||
| 	// This is the name of the Pub/Sub topic. | ||||
| 	TopicName string `json:"topicName,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create gcp pub sub integration params body integration | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create gcp pub sub integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateGcpPubSubIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateHTTPIntegrationParams creates a new ApplicationServiceCreateHTTPIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateHTTPIntegrationParams() *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceCreateHTTPIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateHTTPIntegrationParamsWithTimeout creates a new ApplicationServiceCreateHTTPIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateHTTPIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceCreateHTTPIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateHTTPIntegrationParamsWithContext creates a new ApplicationServiceCreateHTTPIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateHTTPIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceCreateHTTPIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateHTTPIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateHTTPIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateHTTPIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceCreateHTTPIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateHTTPIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create Http integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateHTTPIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateHTTPIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WithDefaults() *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WithBody(body ApplicationServiceCreateHTTPIntegrationBody) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) SetBody(body ApplicationServiceCreateHTTPIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateHTTPIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create Http integration params | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,389 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateHTTPIntegrationReader is a Reader for the ApplicationServiceCreateHTTPIntegration structure. | ||||
| type ApplicationServiceCreateHTTPIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateHTTPIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateHTTPIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateHTTPIntegrationOK creates a ApplicationServiceCreateHTTPIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateHTTPIntegrationOK() *ApplicationServiceCreateHTTPIntegrationOK { | ||||
| 	return &ApplicationServiceCreateHTTPIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateHTTPIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateHTTPIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create Http integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create Http integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create Http integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create Http integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create Http integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create Http integration o k response | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/http][%d] applicationServiceCreateHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/http][%d] applicationServiceCreateHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateHTTPIntegrationDefault creates a ApplicationServiceCreateHTTPIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateHTTPIntegrationDefault(code int) *ApplicationServiceCreateHTTPIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateHTTPIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateHTTPIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateHTTPIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create Http integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create Http integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create Http integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create Http integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create Http integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create Http integration default response | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/http][%d] ApplicationService_CreateHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/http][%d] ApplicationService_CreateHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateHTTPIntegrationBody application service create HTTP integration body | ||||
| swagger:model ApplicationServiceCreateHTTPIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateHTTPIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create HTTP integration body | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create HTTP integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateHTTPIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Payload encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// Event endpoint URL. | ||||
| 	// The HTTP integration will POST all events to this enpoint. The request | ||||
| 	// will contain a query parameters "event" containing the type of the | ||||
| 	// event. | ||||
| 	EventEndpointURL string `json:"eventEndpointUrl,omitempty"` | ||||
|  | ||||
| 	// HTTP headers to set when making requests. | ||||
| 	Headers map[string]string `json:"headers,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create HTTP integration params body integration | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create HTTP integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateHTTPIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateIftttIntegrationParams creates a new ApplicationServiceCreateIftttIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateIftttIntegrationParams() *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceCreateIftttIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateIftttIntegrationParamsWithTimeout creates a new ApplicationServiceCreateIftttIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateIftttIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceCreateIftttIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateIftttIntegrationParamsWithContext creates a new ApplicationServiceCreateIftttIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateIftttIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceCreateIftttIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateIftttIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateIftttIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateIftttIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceCreateIftttIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateIftttIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create ifttt integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateIftttIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateIftttIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WithDefaults() *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WithBody(body ApplicationServiceCreateIftttIntegrationBody) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) SetBody(body ApplicationServiceCreateIftttIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateIftttIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create ifttt integration params | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,346 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateIftttIntegrationReader is a Reader for the ApplicationServiceCreateIftttIntegration structure. | ||||
| type ApplicationServiceCreateIftttIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateIftttIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateIftttIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateIftttIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateIftttIntegrationOK creates a ApplicationServiceCreateIftttIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateIftttIntegrationOK() *ApplicationServiceCreateIftttIntegrationOK { | ||||
| 	return &ApplicationServiceCreateIftttIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateIftttIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateIftttIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create ifttt integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create ifttt integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create ifttt integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create ifttt integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create ifttt integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create ifttt integration o k response | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/ifttt][%d] applicationServiceCreateIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/ifttt][%d] applicationServiceCreateIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateIftttIntegrationDefault creates a ApplicationServiceCreateIftttIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateIftttIntegrationDefault(code int) *ApplicationServiceCreateIftttIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateIftttIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateIftttIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateIftttIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create ifttt integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create ifttt integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create ifttt integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create ifttt integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create ifttt integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create ifttt integration default response | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/ifttt][%d] ApplicationService_CreateIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/ifttt][%d] ApplicationService_CreateIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateIftttIntegrationBody application service create ifttt integration body | ||||
| swagger:model ApplicationServiceCreateIftttIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateIftttIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateIftttIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create ifttt integration body | ||||
| func (o *ApplicationServiceCreateIftttIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create ifttt integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateIftttIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateIftttIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateIftttIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateIftttIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateIftttIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateIftttIntegrationParamsBodyIntegration Integration object. | ||||
| swagger:model ApplicationServiceCreateIftttIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateIftttIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Arbitrary JSON. | ||||
| 	// If set to true, ChirpStack events will be sent as-is as arbitrary JSON | ||||
| 	// payload. If set to false (default), the 3 JSON values format will be used. | ||||
| 	ArbitraryJSON bool `json:"arbitraryJson,omitempty"` | ||||
|  | ||||
| 	// Event prefix. | ||||
| 	// If set, the event name will be PREFIX_EVENT. For example if event_prefix | ||||
| 	// is set to weatherstation, and uplink event will be sent as | ||||
| 	// weatherstation_up to the IFTTT webhook. | ||||
| 	// Note: Only characters in the A-Z, a-z and 0-9 range are allowed. | ||||
| 	EventPrefix string `json:"eventPrefix,omitempty"` | ||||
|  | ||||
| 	// Key. | ||||
| 	// This key can be obtained from the IFTTT Webhooks documentation page. | ||||
| 	Key string `json:"key,omitempty"` | ||||
|  | ||||
| 	// Values. | ||||
| 	// Up to 2 values can be forwarded to IFTTT. These values must map to the | ||||
| 	// decoded payload keys. For example: | ||||
| 	// { | ||||
| 	//   "batteryLevel": 75.3, | ||||
| 	//   "buttons": [{"pressed": false}, {"pressed": true}] | ||||
| 	// } | ||||
| 	// You would specify the following fields: | ||||
| 	// uplink_values = ["batteryLevel", "buttons_0_pressed"] | ||||
| 	UplinkValues []string `json:"uplinkValues"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create ifttt integration params body integration | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service create ifttt integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateIftttIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateIftttIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateInfluxDbIntegrationParams creates a new ApplicationServiceCreateInfluxDbIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateInfluxDbIntegrationParams() *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceCreateInfluxDbIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateInfluxDbIntegrationParamsWithTimeout creates a new ApplicationServiceCreateInfluxDbIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateInfluxDbIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceCreateInfluxDbIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateInfluxDbIntegrationParamsWithContext creates a new ApplicationServiceCreateInfluxDbIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateInfluxDbIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceCreateInfluxDbIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateInfluxDbIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateInfluxDbIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateInfluxDbIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceCreateInfluxDbIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateInfluxDbIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create influx db integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateInfluxDbIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateInfluxDbIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WithDefaults() *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WithBody(body ApplicationServiceCreateInfluxDbIntegrationBody) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) SetBody(body ApplicationServiceCreateInfluxDbIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateInfluxDbIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create influx db integration params | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,455 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateInfluxDbIntegrationReader is a Reader for the ApplicationServiceCreateInfluxDbIntegration structure. | ||||
| type ApplicationServiceCreateInfluxDbIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateInfluxDbIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateInfluxDbIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateInfluxDbIntegrationOK creates a ApplicationServiceCreateInfluxDbIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateInfluxDbIntegrationOK() *ApplicationServiceCreateInfluxDbIntegrationOK { | ||||
| 	return &ApplicationServiceCreateInfluxDbIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateInfluxDbIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateInfluxDbIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create influx db integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create influx db integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create influx db integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create influx db integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create influx db integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create influx db integration o k response | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/influxdb][%d] applicationServiceCreateInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/influxdb][%d] applicationServiceCreateInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateInfluxDbIntegrationDefault creates a ApplicationServiceCreateInfluxDbIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateInfluxDbIntegrationDefault(code int) *ApplicationServiceCreateInfluxDbIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateInfluxDbIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateInfluxDbIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateInfluxDbIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create influx db integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create influx db integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create influx db integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create influx db integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create influx db integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create influx db integration default response | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/influxdb][%d] ApplicationService_CreateInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/influxdb][%d] ApplicationService_CreateInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateInfluxDbIntegrationBody application service create influx db integration body | ||||
| swagger:model ApplicationServiceCreateInfluxDbIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateInfluxDbIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create influx db integration body | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create influx db integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateInfluxDbIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Bucket. (InfluxDb v2) | ||||
| 	Bucket string `json:"bucket,omitempty"` | ||||
|  | ||||
| 	// InfluxDb database name. (InfluxDb v1) | ||||
| 	Db string `json:"db,omitempty"` | ||||
|  | ||||
| 	// InfluxDb API write endpoint (e.g. http://localhost:8086/write). | ||||
| 	Endpoint string `json:"endpoint,omitempty"` | ||||
|  | ||||
| 	// Organization. (InfluxDb v2) | ||||
| 	Organization string `json:"organization,omitempty"` | ||||
|  | ||||
| 	// InfluxDb password. (InfluxDb v1) | ||||
| 	Password string `json:"password,omitempty"` | ||||
|  | ||||
| 	// InfluxDb timestamp precision (InfluxDb v1). | ||||
| 	Precision *models.APIInfluxDbPrecision `json:"precision,omitempty"` | ||||
|  | ||||
| 	// InfluxDb retention policy name. (InfluxDb v1) | ||||
| 	RetentionPolicyName string `json:"retentionPolicyName,omitempty"` | ||||
|  | ||||
| 	// Token. (InfluxDb v2) | ||||
| 	Token string `json:"token,omitempty"` | ||||
|  | ||||
| 	// InfluxDb username. (InfluxDb v1) | ||||
| 	Username string `json:"username,omitempty"` | ||||
|  | ||||
| 	// InfluxDb version. | ||||
| 	Version *models.APIInfluxDbVersion `json:"version,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create influx db integration params body integration | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validatePrecision(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if err := o.validateVersion(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) validatePrecision(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Precision) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Precision != nil { | ||||
| 		if err := o.Precision.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) validateVersion(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Version) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Version != nil { | ||||
| 		if err := o.Version.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create influx db integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidatePrecision(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if err := o.contextValidateVersion(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) contextValidatePrecision(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Precision != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Precision) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Precision.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) contextValidateVersion(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Version != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Version) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Version.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateInfluxDbIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateMyDevicesIntegrationParams creates a new ApplicationServiceCreateMyDevicesIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateMyDevicesIntegrationParams() *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceCreateMyDevicesIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateMyDevicesIntegrationParamsWithTimeout creates a new ApplicationServiceCreateMyDevicesIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateMyDevicesIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceCreateMyDevicesIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateMyDevicesIntegrationParamsWithContext creates a new ApplicationServiceCreateMyDevicesIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateMyDevicesIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceCreateMyDevicesIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateMyDevicesIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateMyDevicesIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateMyDevicesIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceCreateMyDevicesIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateMyDevicesIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create my devices integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateMyDevicesIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateMyDevicesIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WithDefaults() *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WithBody(body ApplicationServiceCreateMyDevicesIntegrationBody) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) SetBody(body ApplicationServiceCreateMyDevicesIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateMyDevicesIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create my devices integration params | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,322 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateMyDevicesIntegrationReader is a Reader for the ApplicationServiceCreateMyDevicesIntegration structure. | ||||
| type ApplicationServiceCreateMyDevicesIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateMyDevicesIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateMyDevicesIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateMyDevicesIntegrationOK creates a ApplicationServiceCreateMyDevicesIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateMyDevicesIntegrationOK() *ApplicationServiceCreateMyDevicesIntegrationOK { | ||||
| 	return &ApplicationServiceCreateMyDevicesIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateMyDevicesIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateMyDevicesIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create my devices integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create my devices integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create my devices integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create my devices integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create my devices integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create my devices integration o k response | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/mydevices][%d] applicationServiceCreateMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/mydevices][%d] applicationServiceCreateMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateMyDevicesIntegrationDefault creates a ApplicationServiceCreateMyDevicesIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateMyDevicesIntegrationDefault(code int) *ApplicationServiceCreateMyDevicesIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateMyDevicesIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateMyDevicesIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateMyDevicesIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create my devices integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create my devices integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create my devices integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create my devices integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create my devices integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create my devices integration default response | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/mydevices][%d] ApplicationService_CreateMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/mydevices][%d] ApplicationService_CreateMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateMyDevicesIntegrationBody application service create my devices integration body | ||||
| swagger:model ApplicationServiceCreateMyDevicesIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateMyDevicesIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create my devices integration body | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create my devices integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateMyDevicesIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// myDevices API endpoint. | ||||
| 	Endpoint string `json:"endpoint,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create my devices integration params body integration | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service create my devices integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateMyDevicesIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,150 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateParams creates a new ApplicationServiceCreateParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateParams() *ApplicationServiceCreateParams { | ||||
| 	return &ApplicationServiceCreateParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateParamsWithTimeout creates a new ApplicationServiceCreateParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateParams { | ||||
| 	return &ApplicationServiceCreateParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateParamsWithContext creates a new ApplicationServiceCreateParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateParamsWithContext(ctx context.Context) *ApplicationServiceCreateParams { | ||||
| 	return &ApplicationServiceCreateParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateParamsWithHTTPClient creates a new ApplicationServiceCreateParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateParams { | ||||
| 	return &ApplicationServiceCreateParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body *models.APICreateApplicationRequest | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateParams) WithDefaults() *ApplicationServiceCreateParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) WithContext(ctx context.Context) *ApplicationServiceCreateParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) WithBody(body *models.APICreateApplicationRequest) *ApplicationServiceCreateParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create params | ||||
| func (o *ApplicationServiceCreateParams) SetBody(body *models.APICreateApplicationRequest) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if o.Body != nil { | ||||
| 		if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreatePilotThingsIntegrationParams creates a new ApplicationServiceCreatePilotThingsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreatePilotThingsIntegrationParams() *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceCreatePilotThingsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreatePilotThingsIntegrationParamsWithTimeout creates a new ApplicationServiceCreatePilotThingsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreatePilotThingsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceCreatePilotThingsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreatePilotThingsIntegrationParamsWithContext creates a new ApplicationServiceCreatePilotThingsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreatePilotThingsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceCreatePilotThingsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreatePilotThingsIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreatePilotThingsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreatePilotThingsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceCreatePilotThingsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreatePilotThingsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create pilot things integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreatePilotThingsIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreatePilotThingsIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WithDefaults() *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WithBody(body ApplicationServiceCreatePilotThingsIntegrationBody) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) SetBody(body ApplicationServiceCreatePilotThingsIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreatePilotThingsIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create pilot things integration params | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,325 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreatePilotThingsIntegrationReader is a Reader for the ApplicationServiceCreatePilotThingsIntegration structure. | ||||
| type ApplicationServiceCreatePilotThingsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreatePilotThingsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreatePilotThingsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreatePilotThingsIntegrationOK creates a ApplicationServiceCreatePilotThingsIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreatePilotThingsIntegrationOK() *ApplicationServiceCreatePilotThingsIntegrationOK { | ||||
| 	return &ApplicationServiceCreatePilotThingsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreatePilotThingsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreatePilotThingsIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create pilot things integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create pilot things integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create pilot things integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create pilot things integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create pilot things integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create pilot things integration o k response | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/pilot-things][%d] applicationServiceCreatePilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/pilot-things][%d] applicationServiceCreatePilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreatePilotThingsIntegrationDefault creates a ApplicationServiceCreatePilotThingsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreatePilotThingsIntegrationDefault(code int) *ApplicationServiceCreatePilotThingsIntegrationDefault { | ||||
| 	return &ApplicationServiceCreatePilotThingsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreatePilotThingsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreatePilotThingsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create pilot things integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create pilot things integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create pilot things integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create pilot things integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create pilot things integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create pilot things integration default response | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/pilot-things][%d] ApplicationService_CreatePilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/pilot-things][%d] ApplicationService_CreatePilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreatePilotThingsIntegrationBody application service create pilot things integration body | ||||
| swagger:model ApplicationServiceCreatePilotThingsIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreatePilotThingsIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create pilot things integration body | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create pilot things integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreatePilotThingsIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Server URL. | ||||
| 	Server string `json:"server,omitempty"` | ||||
|  | ||||
| 	// Authentication token. | ||||
| 	Token string `json:"token,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create pilot things integration params body integration | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service create pilot things integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreatePilotThingsIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateReader is a Reader for the ApplicationServiceCreate structure. | ||||
| type ApplicationServiceCreateReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateOK creates a ApplicationServiceCreateOK with default headers values | ||||
| func NewApplicationServiceCreateOK() *ApplicationServiceCreateOK { | ||||
| 	return &ApplicationServiceCreateOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateOK struct { | ||||
| 	Payload *models.APICreateApplicationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create o k response | ||||
| func (o *ApplicationServiceCreateOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications][%d] applicationServiceCreateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications][%d] applicationServiceCreateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateOK) GetPayload() *models.APICreateApplicationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APICreateApplicationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateDefault creates a ApplicationServiceCreateDefault with default headers values | ||||
| func NewApplicationServiceCreateDefault(code int) *ApplicationServiceCreateDefault { | ||||
| 	return &ApplicationServiceCreateDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create default response | ||||
| func (o *ApplicationServiceCreateDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications][%d] ApplicationService_Create default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications][%d] ApplicationService_Create default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceCreateThingsBoardIntegrationParams creates a new ApplicationServiceCreateThingsBoardIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceCreateThingsBoardIntegrationParams() *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceCreateThingsBoardIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateThingsBoardIntegrationParamsWithTimeout creates a new ApplicationServiceCreateThingsBoardIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceCreateThingsBoardIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceCreateThingsBoardIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateThingsBoardIntegrationParamsWithContext creates a new ApplicationServiceCreateThingsBoardIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceCreateThingsBoardIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceCreateThingsBoardIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateThingsBoardIntegrationParamsWithHTTPClient creates a new ApplicationServiceCreateThingsBoardIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceCreateThingsBoardIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceCreateThingsBoardIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateThingsBoardIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service create things board integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceCreateThingsBoardIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceCreateThingsBoardIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service create things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WithDefaults() *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service create things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WithBody(body ApplicationServiceCreateThingsBoardIntegrationBody) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) SetBody(body ApplicationServiceCreateThingsBoardIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceCreateThingsBoardIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service create things board integration params | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,322 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceCreateThingsBoardIntegrationReader is a Reader for the ApplicationServiceCreateThingsBoardIntegration structure. | ||||
| type ApplicationServiceCreateThingsBoardIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceCreateThingsBoardIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceCreateThingsBoardIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateThingsBoardIntegrationOK creates a ApplicationServiceCreateThingsBoardIntegrationOK with default headers values | ||||
| func NewApplicationServiceCreateThingsBoardIntegrationOK() *ApplicationServiceCreateThingsBoardIntegrationOK { | ||||
| 	return &ApplicationServiceCreateThingsBoardIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateThingsBoardIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceCreateThingsBoardIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create things board integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create things board integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create things board integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create things board integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create things board integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create things board integration o k response | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/thingsboard][%d] applicationServiceCreateThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/thingsboard][%d] applicationServiceCreateThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceCreateThingsBoardIntegrationDefault creates a ApplicationServiceCreateThingsBoardIntegrationDefault with default headers values | ||||
| func NewApplicationServiceCreateThingsBoardIntegrationDefault(code int) *ApplicationServiceCreateThingsBoardIntegrationDefault { | ||||
| 	return &ApplicationServiceCreateThingsBoardIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateThingsBoardIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceCreateThingsBoardIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service create things board integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service create things board integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service create things board integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service create things board integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service create things board integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service create things board integration default response | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/thingsboard][%d] ApplicationService_CreateThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{integration.applicationId}/integrations/thingsboard][%d] ApplicationService_CreateThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateThingsBoardIntegrationBody application service create things board integration body | ||||
| swagger:model ApplicationServiceCreateThingsBoardIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceCreateThingsBoardIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create things board integration body | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service create things board integration body based on the context it is used | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateThingsBoardIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// ThingsBoard server endpoint, e.g. https://example.com | ||||
| 	Server string `json:"server,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service create things board integration params body integration | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service create things board integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceCreateThingsBoardIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteAwsSnsIntegrationParams creates a new ApplicationServiceDeleteAwsSnsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteAwsSnsIntegrationParams() *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAwsSnsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAwsSnsIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteAwsSnsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteAwsSnsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAwsSnsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAwsSnsIntegrationParamsWithContext creates a new ApplicationServiceDeleteAwsSnsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteAwsSnsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAwsSnsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAwsSnsIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteAwsSnsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteAwsSnsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAwsSnsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteAwsSnsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete aws sns integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteAwsSnsIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) WithDefaults() *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteAwsSnsIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete aws sns integration params | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteAwsSnsIntegrationReader is a Reader for the ApplicationServiceDeleteAwsSnsIntegration structure. | ||||
| type ApplicationServiceDeleteAwsSnsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteAwsSnsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteAwsSnsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAwsSnsIntegrationOK creates a ApplicationServiceDeleteAwsSnsIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteAwsSnsIntegrationOK() *ApplicationServiceDeleteAwsSnsIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteAwsSnsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteAwsSnsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteAwsSnsIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete aws sns integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete aws sns integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete aws sns integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete aws sns integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete aws sns integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete aws sns integration o k response | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/aws-sns][%d] applicationServiceDeleteAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/aws-sns][%d] applicationServiceDeleteAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAwsSnsIntegrationDefault creates a ApplicationServiceDeleteAwsSnsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteAwsSnsIntegrationDefault(code int) *ApplicationServiceDeleteAwsSnsIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteAwsSnsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteAwsSnsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteAwsSnsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete aws sns integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete aws sns integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete aws sns integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete aws sns integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete aws sns integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete aws sns integration default response | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/aws-sns][%d] ApplicationService_DeleteAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/aws-sns][%d] ApplicationService_DeleteAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAwsSnsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteAzureServiceBusIntegrationParams creates a new ApplicationServiceDeleteAzureServiceBusIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteAzureServiceBusIntegrationParams() *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAzureServiceBusIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAzureServiceBusIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteAzureServiceBusIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAzureServiceBusIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAzureServiceBusIntegrationParamsWithContext creates a new ApplicationServiceDeleteAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteAzureServiceBusIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAzureServiceBusIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAzureServiceBusIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteAzureServiceBusIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteAzureServiceBusIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteAzureServiceBusIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete azure service bus integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteAzureServiceBusIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) WithDefaults() *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteAzureServiceBusIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete azure service bus integration params | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteAzureServiceBusIntegrationReader is a Reader for the ApplicationServiceDeleteAzureServiceBusIntegration structure. | ||||
| type ApplicationServiceDeleteAzureServiceBusIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteAzureServiceBusIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteAzureServiceBusIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAzureServiceBusIntegrationOK creates a ApplicationServiceDeleteAzureServiceBusIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteAzureServiceBusIntegrationOK() *ApplicationServiceDeleteAzureServiceBusIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteAzureServiceBusIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteAzureServiceBusIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteAzureServiceBusIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete azure service bus integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete azure service bus integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete azure service bus integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete azure service bus integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete azure service bus integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete azure service bus integration o k response | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/azure-service-bus][%d] applicationServiceDeleteAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/azure-service-bus][%d] applicationServiceDeleteAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteAzureServiceBusIntegrationDefault creates a ApplicationServiceDeleteAzureServiceBusIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteAzureServiceBusIntegrationDefault(code int) *ApplicationServiceDeleteAzureServiceBusIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteAzureServiceBusIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteAzureServiceBusIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteAzureServiceBusIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete azure service bus integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete azure service bus integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete azure service bus integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete azure service bus integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete azure service bus integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete azure service bus integration default response | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/azure-service-bus][%d] ApplicationService_DeleteAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/azure-service-bus][%d] ApplicationService_DeleteAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteAzureServiceBusIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteGcpPubSubIntegrationParams creates a new ApplicationServiceDeleteGcpPubSubIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteGcpPubSubIntegrationParams() *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteGcpPubSubIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteGcpPubSubIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteGcpPubSubIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteGcpPubSubIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteGcpPubSubIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteGcpPubSubIntegrationParamsWithContext creates a new ApplicationServiceDeleteGcpPubSubIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteGcpPubSubIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteGcpPubSubIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteGcpPubSubIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteGcpPubSubIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteGcpPubSubIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteGcpPubSubIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteGcpPubSubIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete gcp pub sub integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteGcpPubSubIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) WithDefaults() *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteGcpPubSubIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete gcp pub sub integration params | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteGcpPubSubIntegrationReader is a Reader for the ApplicationServiceDeleteGcpPubSubIntegration structure. | ||||
| type ApplicationServiceDeleteGcpPubSubIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteGcpPubSubIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteGcpPubSubIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteGcpPubSubIntegrationOK creates a ApplicationServiceDeleteGcpPubSubIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteGcpPubSubIntegrationOK() *ApplicationServiceDeleteGcpPubSubIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteGcpPubSubIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteGcpPubSubIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteGcpPubSubIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete gcp pub sub integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete gcp pub sub integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete gcp pub sub integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete gcp pub sub integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete gcp pub sub integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete gcp pub sub integration o k response | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] applicationServiceDeleteGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] applicationServiceDeleteGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteGcpPubSubIntegrationDefault creates a ApplicationServiceDeleteGcpPubSubIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteGcpPubSubIntegrationDefault(code int) *ApplicationServiceDeleteGcpPubSubIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteGcpPubSubIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteGcpPubSubIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteGcpPubSubIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete gcp pub sub integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete gcp pub sub integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete gcp pub sub integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete gcp pub sub integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete gcp pub sub integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete gcp pub sub integration default response | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_DeleteGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_DeleteGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteGcpPubSubIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteHTTPIntegrationParams creates a new ApplicationServiceDeleteHTTPIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteHTTPIntegrationParams() *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteHTTPIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteHTTPIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteHTTPIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteHTTPIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteHTTPIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteHTTPIntegrationParamsWithContext creates a new ApplicationServiceDeleteHTTPIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteHTTPIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteHTTPIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteHTTPIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteHTTPIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteHTTPIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteHTTPIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteHTTPIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete Http integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteHTTPIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) WithDefaults() *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteHTTPIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete Http integration params | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteHTTPIntegrationReader is a Reader for the ApplicationServiceDeleteHTTPIntegration structure. | ||||
| type ApplicationServiceDeleteHTTPIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteHTTPIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteHTTPIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteHTTPIntegrationOK creates a ApplicationServiceDeleteHTTPIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteHTTPIntegrationOK() *ApplicationServiceDeleteHTTPIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteHTTPIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteHTTPIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteHTTPIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete Http integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete Http integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete Http integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete Http integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete Http integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete Http integration o k response | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/http][%d] applicationServiceDeleteHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/http][%d] applicationServiceDeleteHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteHTTPIntegrationDefault creates a ApplicationServiceDeleteHTTPIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteHTTPIntegrationDefault(code int) *ApplicationServiceDeleteHTTPIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteHTTPIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteHTTPIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteHTTPIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete Http integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete Http integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete Http integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete Http integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete Http integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete Http integration default response | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/http][%d] ApplicationService_DeleteHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/http][%d] ApplicationService_DeleteHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteHTTPIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteIftttIntegrationParams creates a new ApplicationServiceDeleteIftttIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteIftttIntegrationParams() *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteIftttIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteIftttIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteIftttIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteIftttIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteIftttIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteIftttIntegrationParamsWithContext creates a new ApplicationServiceDeleteIftttIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteIftttIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteIftttIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteIftttIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteIftttIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteIftttIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteIftttIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteIftttIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete ifttt integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteIftttIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) WithDefaults() *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteIftttIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete ifttt integration params | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteIftttIntegrationReader is a Reader for the ApplicationServiceDeleteIftttIntegration structure. | ||||
| type ApplicationServiceDeleteIftttIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteIftttIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteIftttIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteIftttIntegrationOK creates a ApplicationServiceDeleteIftttIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteIftttIntegrationOK() *ApplicationServiceDeleteIftttIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteIftttIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteIftttIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteIftttIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete ifttt integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete ifttt integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete ifttt integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete ifttt integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete ifttt integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete ifttt integration o k response | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/ifttt][%d] applicationServiceDeleteIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/ifttt][%d] applicationServiceDeleteIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteIftttIntegrationDefault creates a ApplicationServiceDeleteIftttIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteIftttIntegrationDefault(code int) *ApplicationServiceDeleteIftttIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteIftttIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteIftttIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteIftttIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete ifttt integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete ifttt integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete ifttt integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete ifttt integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete ifttt integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete ifttt integration default response | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/ifttt][%d] ApplicationService_DeleteIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/ifttt][%d] ApplicationService_DeleteIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteIftttIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteInfluxDbIntegrationParams creates a new ApplicationServiceDeleteInfluxDbIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteInfluxDbIntegrationParams() *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteInfluxDbIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteInfluxDbIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteInfluxDbIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteInfluxDbIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteInfluxDbIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteInfluxDbIntegrationParamsWithContext creates a new ApplicationServiceDeleteInfluxDbIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteInfluxDbIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteInfluxDbIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteInfluxDbIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteInfluxDbIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteInfluxDbIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteInfluxDbIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteInfluxDbIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete influx db integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteInfluxDbIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) WithDefaults() *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteInfluxDbIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete influx db integration params | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteInfluxDbIntegrationReader is a Reader for the ApplicationServiceDeleteInfluxDbIntegration structure. | ||||
| type ApplicationServiceDeleteInfluxDbIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteInfluxDbIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteInfluxDbIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteInfluxDbIntegrationOK creates a ApplicationServiceDeleteInfluxDbIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteInfluxDbIntegrationOK() *ApplicationServiceDeleteInfluxDbIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteInfluxDbIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteInfluxDbIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteInfluxDbIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete influx db integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete influx db integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete influx db integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete influx db integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete influx db integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete influx db integration o k response | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/influxdb][%d] applicationServiceDeleteInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/influxdb][%d] applicationServiceDeleteInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteInfluxDbIntegrationDefault creates a ApplicationServiceDeleteInfluxDbIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteInfluxDbIntegrationDefault(code int) *ApplicationServiceDeleteInfluxDbIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteInfluxDbIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteInfluxDbIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteInfluxDbIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete influx db integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete influx db integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete influx db integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete influx db integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete influx db integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete influx db integration default response | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/influxdb][%d] ApplicationService_DeleteInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/influxdb][%d] ApplicationService_DeleteInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteInfluxDbIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteMyDevicesIntegrationParams creates a new ApplicationServiceDeleteMyDevicesIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteMyDevicesIntegrationParams() *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteMyDevicesIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteMyDevicesIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteMyDevicesIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteMyDevicesIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteMyDevicesIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteMyDevicesIntegrationParamsWithContext creates a new ApplicationServiceDeleteMyDevicesIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteMyDevicesIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteMyDevicesIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteMyDevicesIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteMyDevicesIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteMyDevicesIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteMyDevicesIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteMyDevicesIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete my devices integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteMyDevicesIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) WithDefaults() *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteMyDevicesIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete my devices integration params | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteMyDevicesIntegrationReader is a Reader for the ApplicationServiceDeleteMyDevicesIntegration structure. | ||||
| type ApplicationServiceDeleteMyDevicesIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteMyDevicesIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteMyDevicesIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteMyDevicesIntegrationOK creates a ApplicationServiceDeleteMyDevicesIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteMyDevicesIntegrationOK() *ApplicationServiceDeleteMyDevicesIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteMyDevicesIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteMyDevicesIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteMyDevicesIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete my devices integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete my devices integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete my devices integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete my devices integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete my devices integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete my devices integration o k response | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/mydevices][%d] applicationServiceDeleteMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/mydevices][%d] applicationServiceDeleteMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteMyDevicesIntegrationDefault creates a ApplicationServiceDeleteMyDevicesIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteMyDevicesIntegrationDefault(code int) *ApplicationServiceDeleteMyDevicesIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteMyDevicesIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteMyDevicesIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteMyDevicesIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete my devices integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete my devices integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete my devices integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete my devices integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete my devices integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete my devices integration default response | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/mydevices][%d] ApplicationService_DeleteMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/mydevices][%d] ApplicationService_DeleteMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteMyDevicesIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteParams creates a new ApplicationServiceDeleteParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteParams() *ApplicationServiceDeleteParams { | ||||
| 	return &ApplicationServiceDeleteParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteParamsWithTimeout creates a new ApplicationServiceDeleteParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteParams { | ||||
| 	return &ApplicationServiceDeleteParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteParamsWithContext creates a new ApplicationServiceDeleteParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteParamsWithContext(ctx context.Context) *ApplicationServiceDeleteParams { | ||||
| 	return &ApplicationServiceDeleteParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteParamsWithHTTPClient creates a new ApplicationServiceDeleteParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteParams { | ||||
| 	return &ApplicationServiceDeleteParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteParams struct { | ||||
|  | ||||
| 	/* ID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteParams) WithDefaults() *ApplicationServiceDeleteParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) WithContext(ctx context.Context) *ApplicationServiceDeleteParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithID adds the id to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) WithID(id string) *ApplicationServiceDeleteParams { | ||||
| 	o.SetID(id) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetID adds the id to the application service delete params | ||||
| func (o *ApplicationServiceDeleteParams) SetID(id string) { | ||||
| 	o.ID = id | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param id | ||||
| 	if err := r.SetPathParam("id", o.ID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeletePilotThingsIntegrationParams creates a new ApplicationServiceDeletePilotThingsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeletePilotThingsIntegrationParams() *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceDeletePilotThingsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeletePilotThingsIntegrationParamsWithTimeout creates a new ApplicationServiceDeletePilotThingsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeletePilotThingsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceDeletePilotThingsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeletePilotThingsIntegrationParamsWithContext creates a new ApplicationServiceDeletePilotThingsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeletePilotThingsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceDeletePilotThingsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeletePilotThingsIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeletePilotThingsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeletePilotThingsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceDeletePilotThingsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeletePilotThingsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete pilot things integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeletePilotThingsIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) WithDefaults() *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeletePilotThingsIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete pilot things integration params | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeletePilotThingsIntegrationReader is a Reader for the ApplicationServiceDeletePilotThingsIntegration structure. | ||||
| type ApplicationServiceDeletePilotThingsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeletePilotThingsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeletePilotThingsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeletePilotThingsIntegrationOK creates a ApplicationServiceDeletePilotThingsIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeletePilotThingsIntegrationOK() *ApplicationServiceDeletePilotThingsIntegrationOK { | ||||
| 	return &ApplicationServiceDeletePilotThingsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeletePilotThingsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeletePilotThingsIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete pilot things integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete pilot things integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete pilot things integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete pilot things integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete pilot things integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete pilot things integration o k response | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/pilot-things][%d] applicationServiceDeletePilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/pilot-things][%d] applicationServiceDeletePilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeletePilotThingsIntegrationDefault creates a ApplicationServiceDeletePilotThingsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeletePilotThingsIntegrationDefault(code int) *ApplicationServiceDeletePilotThingsIntegrationDefault { | ||||
| 	return &ApplicationServiceDeletePilotThingsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeletePilotThingsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeletePilotThingsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete pilot things integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete pilot things integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete pilot things integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete pilot things integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete pilot things integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete pilot things integration default response | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/pilot-things][%d] ApplicationService_DeletePilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/pilot-things][%d] ApplicationService_DeletePilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeletePilotThingsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteReader is a Reader for the ApplicationServiceDelete structure. | ||||
| type ApplicationServiceDeleteReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteOK creates a ApplicationServiceDeleteOK with default headers values | ||||
| func NewApplicationServiceDeleteOK() *ApplicationServiceDeleteOK { | ||||
| 	return &ApplicationServiceDeleteOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete o k response | ||||
| func (o *ApplicationServiceDeleteOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{id}][%d] applicationServiceDeleteOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{id}][%d] applicationServiceDeleteOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteDefault creates a ApplicationServiceDeleteDefault with default headers values | ||||
| func NewApplicationServiceDeleteDefault(code int) *ApplicationServiceDeleteDefault { | ||||
| 	return &ApplicationServiceDeleteDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete default response | ||||
| func (o *ApplicationServiceDeleteDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{id}][%d] ApplicationService_Delete default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{id}][%d] ApplicationService_Delete default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceDeleteThingsBoardIntegrationParams creates a new ApplicationServiceDeleteThingsBoardIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceDeleteThingsBoardIntegrationParams() *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteThingsBoardIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteThingsBoardIntegrationParamsWithTimeout creates a new ApplicationServiceDeleteThingsBoardIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceDeleteThingsBoardIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteThingsBoardIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteThingsBoardIntegrationParamsWithContext creates a new ApplicationServiceDeleteThingsBoardIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceDeleteThingsBoardIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteThingsBoardIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteThingsBoardIntegrationParamsWithHTTPClient creates a new ApplicationServiceDeleteThingsBoardIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceDeleteThingsBoardIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceDeleteThingsBoardIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteThingsBoardIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service delete things board integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceDeleteThingsBoardIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service delete things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) WithDefaults() *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service delete things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceDeleteThingsBoardIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service delete things board integration params | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceDeleteThingsBoardIntegrationReader is a Reader for the ApplicationServiceDeleteThingsBoardIntegration structure. | ||||
| type ApplicationServiceDeleteThingsBoardIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceDeleteThingsBoardIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceDeleteThingsBoardIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteThingsBoardIntegrationOK creates a ApplicationServiceDeleteThingsBoardIntegrationOK with default headers values | ||||
| func NewApplicationServiceDeleteThingsBoardIntegrationOK() *ApplicationServiceDeleteThingsBoardIntegrationOK { | ||||
| 	return &ApplicationServiceDeleteThingsBoardIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteThingsBoardIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceDeleteThingsBoardIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete things board integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete things board integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete things board integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete things board integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete things board integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete things board integration o k response | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/thingsboard][%d] applicationServiceDeleteThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/thingsboard][%d] applicationServiceDeleteThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceDeleteThingsBoardIntegrationDefault creates a ApplicationServiceDeleteThingsBoardIntegrationDefault with default headers values | ||||
| func NewApplicationServiceDeleteThingsBoardIntegrationDefault(code int) *ApplicationServiceDeleteThingsBoardIntegrationDefault { | ||||
| 	return &ApplicationServiceDeleteThingsBoardIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceDeleteThingsBoardIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceDeleteThingsBoardIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service delete things board integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service delete things board integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service delete things board integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service delete things board integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service delete things board integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service delete things board integration default response | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/thingsboard][%d] ApplicationService_DeleteThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/applications/{applicationId}/integrations/thingsboard][%d] ApplicationService_DeleteThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceDeleteThingsBoardIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGenerateMqttIntegrationClientCertificateParams creates a new ApplicationServiceGenerateMqttIntegrationClientCertificateParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGenerateMqttIntegrationClientCertificateParams() *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	return &ApplicationServiceGenerateMqttIntegrationClientCertificateParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGenerateMqttIntegrationClientCertificateParamsWithTimeout creates a new ApplicationServiceGenerateMqttIntegrationClientCertificateParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGenerateMqttIntegrationClientCertificateParamsWithTimeout(timeout time.Duration) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	return &ApplicationServiceGenerateMqttIntegrationClientCertificateParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGenerateMqttIntegrationClientCertificateParamsWithContext creates a new ApplicationServiceGenerateMqttIntegrationClientCertificateParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGenerateMqttIntegrationClientCertificateParamsWithContext(ctx context.Context) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	return &ApplicationServiceGenerateMqttIntegrationClientCertificateParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGenerateMqttIntegrationClientCertificateParamsWithHTTPClient creates a new ApplicationServiceGenerateMqttIntegrationClientCertificateParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGenerateMqttIntegrationClientCertificateParamsWithHTTPClient(client *http.Client) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	return &ApplicationServiceGenerateMqttIntegrationClientCertificateParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGenerateMqttIntegrationClientCertificateParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service generate mqtt integration client certificate operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGenerateMqttIntegrationClientCertificateParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service generate mqtt integration client certificate params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) WithDefaults() *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service generate mqtt integration client certificate params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) WithTimeout(timeout time.Duration) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) WithContext(ctx context.Context) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) WithHTTPClient(client *http.Client) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) WithApplicationID(applicationID string) *ApplicationServiceGenerateMqttIntegrationClientCertificateParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service generate mqtt integration client certificate params | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGenerateMqttIntegrationClientCertificateReader is a Reader for the ApplicationServiceGenerateMqttIntegrationClientCertificate structure. | ||||
| type ApplicationServiceGenerateMqttIntegrationClientCertificateReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGenerateMqttIntegrationClientCertificateOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGenerateMqttIntegrationClientCertificateDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGenerateMqttIntegrationClientCertificateOK creates a ApplicationServiceGenerateMqttIntegrationClientCertificateOK with default headers values | ||||
| func NewApplicationServiceGenerateMqttIntegrationClientCertificateOK() *ApplicationServiceGenerateMqttIntegrationClientCertificateOK { | ||||
| 	return &ApplicationServiceGenerateMqttIntegrationClientCertificateOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGenerateMqttIntegrationClientCertificateOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGenerateMqttIntegrationClientCertificateOK struct { | ||||
| 	Payload *models.APIGenerateMqttIntegrationClientCertificateResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service generate mqtt integration client certificate o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service generate mqtt integration client certificate o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service generate mqtt integration client certificate o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service generate mqtt integration client certificate o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service generate mqtt integration client certificate o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service generate mqtt integration client certificate o k response | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{applicationId}/integrations/mqtt/certificate][%d] applicationServiceGenerateMqttIntegrationClientCertificateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{applicationId}/integrations/mqtt/certificate][%d] applicationServiceGenerateMqttIntegrationClientCertificateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) GetPayload() *models.APIGenerateMqttIntegrationClientCertificateResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGenerateMqttIntegrationClientCertificateResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGenerateMqttIntegrationClientCertificateDefault creates a ApplicationServiceGenerateMqttIntegrationClientCertificateDefault with default headers values | ||||
| func NewApplicationServiceGenerateMqttIntegrationClientCertificateDefault(code int) *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault { | ||||
| 	return &ApplicationServiceGenerateMqttIntegrationClientCertificateDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGenerateMqttIntegrationClientCertificateDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGenerateMqttIntegrationClientCertificateDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service generate mqtt integration client certificate default response has a 2xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service generate mqtt integration client certificate default response has a 3xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service generate mqtt integration client certificate default response has a 4xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service generate mqtt integration client certificate default response has a 5xx status code | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service generate mqtt integration client certificate default response a status code equal to that given | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service generate mqtt integration client certificate default response | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{applicationId}/integrations/mqtt/certificate][%d] ApplicationService_GenerateMqttIntegrationClientCertificate default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/applications/{applicationId}/integrations/mqtt/certificate][%d] ApplicationService_GenerateMqttIntegrationClientCertificate default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGenerateMqttIntegrationClientCertificateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetAwsSnsIntegrationParams creates a new ApplicationServiceGetAwsSnsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetAwsSnsIntegrationParams() *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceGetAwsSnsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAwsSnsIntegrationParamsWithTimeout creates a new ApplicationServiceGetAwsSnsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetAwsSnsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceGetAwsSnsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAwsSnsIntegrationParamsWithContext creates a new ApplicationServiceGetAwsSnsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetAwsSnsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceGetAwsSnsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAwsSnsIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetAwsSnsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetAwsSnsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceGetAwsSnsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetAwsSnsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get aws sns integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetAwsSnsIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) WithDefaults() *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetAwsSnsIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get aws sns integration params | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetAwsSnsIntegrationReader is a Reader for the ApplicationServiceGetAwsSnsIntegration structure. | ||||
| type ApplicationServiceGetAwsSnsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetAwsSnsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetAwsSnsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAwsSnsIntegrationOK creates a ApplicationServiceGetAwsSnsIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetAwsSnsIntegrationOK() *ApplicationServiceGetAwsSnsIntegrationOK { | ||||
| 	return &ApplicationServiceGetAwsSnsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetAwsSnsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetAwsSnsIntegrationOK struct { | ||||
| 	Payload *models.APIGetAwsSnsIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get aws sns integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get aws sns integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get aws sns integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get aws sns integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get aws sns integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get aws sns integration o k response | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/aws-sns][%d] applicationServiceGetAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/aws-sns][%d] applicationServiceGetAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) GetPayload() *models.APIGetAwsSnsIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetAwsSnsIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAwsSnsIntegrationDefault creates a ApplicationServiceGetAwsSnsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetAwsSnsIntegrationDefault(code int) *ApplicationServiceGetAwsSnsIntegrationDefault { | ||||
| 	return &ApplicationServiceGetAwsSnsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetAwsSnsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetAwsSnsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get aws sns integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get aws sns integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get aws sns integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get aws sns integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get aws sns integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get aws sns integration default response | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/aws-sns][%d] ApplicationService_GetAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/aws-sns][%d] ApplicationService_GetAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAwsSnsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetAzureServiceBusIntegrationParams creates a new ApplicationServiceGetAzureServiceBusIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetAzureServiceBusIntegrationParams() *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceGetAzureServiceBusIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAzureServiceBusIntegrationParamsWithTimeout creates a new ApplicationServiceGetAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetAzureServiceBusIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceGetAzureServiceBusIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAzureServiceBusIntegrationParamsWithContext creates a new ApplicationServiceGetAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetAzureServiceBusIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceGetAzureServiceBusIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAzureServiceBusIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetAzureServiceBusIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceGetAzureServiceBusIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetAzureServiceBusIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get azure service bus integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetAzureServiceBusIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) WithDefaults() *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetAzureServiceBusIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get azure service bus integration params | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetAzureServiceBusIntegrationReader is a Reader for the ApplicationServiceGetAzureServiceBusIntegration structure. | ||||
| type ApplicationServiceGetAzureServiceBusIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetAzureServiceBusIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetAzureServiceBusIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAzureServiceBusIntegrationOK creates a ApplicationServiceGetAzureServiceBusIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetAzureServiceBusIntegrationOK() *ApplicationServiceGetAzureServiceBusIntegrationOK { | ||||
| 	return &ApplicationServiceGetAzureServiceBusIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetAzureServiceBusIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetAzureServiceBusIntegrationOK struct { | ||||
| 	Payload *models.APIGetAzureServiceBusIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get azure service bus integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get azure service bus integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get azure service bus integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get azure service bus integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get azure service bus integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get azure service bus integration o k response | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/azure-service-bus][%d] applicationServiceGetAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/azure-service-bus][%d] applicationServiceGetAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) GetPayload() *models.APIGetAzureServiceBusIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetAzureServiceBusIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetAzureServiceBusIntegrationDefault creates a ApplicationServiceGetAzureServiceBusIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetAzureServiceBusIntegrationDefault(code int) *ApplicationServiceGetAzureServiceBusIntegrationDefault { | ||||
| 	return &ApplicationServiceGetAzureServiceBusIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetAzureServiceBusIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetAzureServiceBusIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get azure service bus integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get azure service bus integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get azure service bus integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get azure service bus integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get azure service bus integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get azure service bus integration default response | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/azure-service-bus][%d] ApplicationService_GetAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/azure-service-bus][%d] ApplicationService_GetAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetAzureServiceBusIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetGcpPubSubIntegrationParams creates a new ApplicationServiceGetGcpPubSubIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetGcpPubSubIntegrationParams() *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceGetGcpPubSubIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetGcpPubSubIntegrationParamsWithTimeout creates a new ApplicationServiceGetGcpPubSubIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetGcpPubSubIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceGetGcpPubSubIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetGcpPubSubIntegrationParamsWithContext creates a new ApplicationServiceGetGcpPubSubIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetGcpPubSubIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceGetGcpPubSubIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetGcpPubSubIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetGcpPubSubIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetGcpPubSubIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceGetGcpPubSubIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetGcpPubSubIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get gcp pub sub integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetGcpPubSubIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) WithDefaults() *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetGcpPubSubIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get gcp pub sub integration params | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetGcpPubSubIntegrationReader is a Reader for the ApplicationServiceGetGcpPubSubIntegration structure. | ||||
| type ApplicationServiceGetGcpPubSubIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetGcpPubSubIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetGcpPubSubIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetGcpPubSubIntegrationOK creates a ApplicationServiceGetGcpPubSubIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetGcpPubSubIntegrationOK() *ApplicationServiceGetGcpPubSubIntegrationOK { | ||||
| 	return &ApplicationServiceGetGcpPubSubIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetGcpPubSubIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetGcpPubSubIntegrationOK struct { | ||||
| 	Payload *models.APIGetGcpPubSubIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get gcp pub sub integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get gcp pub sub integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get gcp pub sub integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get gcp pub sub integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get gcp pub sub integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get gcp pub sub integration o k response | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] applicationServiceGetGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] applicationServiceGetGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) GetPayload() *models.APIGetGcpPubSubIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetGcpPubSubIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetGcpPubSubIntegrationDefault creates a ApplicationServiceGetGcpPubSubIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetGcpPubSubIntegrationDefault(code int) *ApplicationServiceGetGcpPubSubIntegrationDefault { | ||||
| 	return &ApplicationServiceGetGcpPubSubIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetGcpPubSubIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetGcpPubSubIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get gcp pub sub integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get gcp pub sub integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get gcp pub sub integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get gcp pub sub integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get gcp pub sub integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get gcp pub sub integration default response | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_GetGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_GetGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetGcpPubSubIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetHTTPIntegrationParams creates a new ApplicationServiceGetHTTPIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetHTTPIntegrationParams() *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceGetHTTPIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetHTTPIntegrationParamsWithTimeout creates a new ApplicationServiceGetHTTPIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetHTTPIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceGetHTTPIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetHTTPIntegrationParamsWithContext creates a new ApplicationServiceGetHTTPIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetHTTPIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceGetHTTPIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetHTTPIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetHTTPIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetHTTPIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceGetHTTPIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetHTTPIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get Http integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetHTTPIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) WithDefaults() *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetHTTPIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get Http integration params | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetHTTPIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetHTTPIntegrationReader is a Reader for the ApplicationServiceGetHTTPIntegration structure. | ||||
| type ApplicationServiceGetHTTPIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetHTTPIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetHTTPIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetHTTPIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetHTTPIntegrationOK creates a ApplicationServiceGetHTTPIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetHTTPIntegrationOK() *ApplicationServiceGetHTTPIntegrationOK { | ||||
| 	return &ApplicationServiceGetHTTPIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetHTTPIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetHTTPIntegrationOK struct { | ||||
| 	Payload *models.APIGetHTTPIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get Http integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get Http integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get Http integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get Http integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get Http integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get Http integration o k response | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/http][%d] applicationServiceGetHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/http][%d] applicationServiceGetHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) GetPayload() *models.APIGetHTTPIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetHTTPIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetHTTPIntegrationDefault creates a ApplicationServiceGetHTTPIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetHTTPIntegrationDefault(code int) *ApplicationServiceGetHTTPIntegrationDefault { | ||||
| 	return &ApplicationServiceGetHTTPIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetHTTPIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetHTTPIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get Http integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get Http integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get Http integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get Http integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get Http integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get Http integration default response | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/http][%d] ApplicationService_GetHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/http][%d] ApplicationService_GetHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetHTTPIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetIftttIntegrationParams creates a new ApplicationServiceGetIftttIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetIftttIntegrationParams() *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	return &ApplicationServiceGetIftttIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetIftttIntegrationParamsWithTimeout creates a new ApplicationServiceGetIftttIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetIftttIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	return &ApplicationServiceGetIftttIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetIftttIntegrationParamsWithContext creates a new ApplicationServiceGetIftttIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetIftttIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	return &ApplicationServiceGetIftttIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetIftttIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetIftttIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetIftttIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	return &ApplicationServiceGetIftttIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetIftttIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get ifttt integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetIftttIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) WithDefaults() *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetIftttIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get ifttt integration params | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetIftttIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetIftttIntegrationReader is a Reader for the ApplicationServiceGetIftttIntegration structure. | ||||
| type ApplicationServiceGetIftttIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetIftttIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetIftttIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetIftttIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetIftttIntegrationOK creates a ApplicationServiceGetIftttIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetIftttIntegrationOK() *ApplicationServiceGetIftttIntegrationOK { | ||||
| 	return &ApplicationServiceGetIftttIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetIftttIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetIftttIntegrationOK struct { | ||||
| 	Payload *models.APIGetIftttIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get ifttt integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get ifttt integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get ifttt integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get ifttt integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get ifttt integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get ifttt integration o k response | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/ifttt][%d] applicationServiceGetIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/ifttt][%d] applicationServiceGetIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) GetPayload() *models.APIGetIftttIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetIftttIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetIftttIntegrationDefault creates a ApplicationServiceGetIftttIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetIftttIntegrationDefault(code int) *ApplicationServiceGetIftttIntegrationDefault { | ||||
| 	return &ApplicationServiceGetIftttIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetIftttIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetIftttIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get ifttt integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get ifttt integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get ifttt integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get ifttt integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get ifttt integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get ifttt integration default response | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/ifttt][%d] ApplicationService_GetIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/ifttt][%d] ApplicationService_GetIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetIftttIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetInfluxDbIntegrationParams creates a new ApplicationServiceGetInfluxDbIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetInfluxDbIntegrationParams() *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceGetInfluxDbIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetInfluxDbIntegrationParamsWithTimeout creates a new ApplicationServiceGetInfluxDbIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetInfluxDbIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceGetInfluxDbIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetInfluxDbIntegrationParamsWithContext creates a new ApplicationServiceGetInfluxDbIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetInfluxDbIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceGetInfluxDbIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetInfluxDbIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetInfluxDbIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetInfluxDbIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceGetInfluxDbIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetInfluxDbIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get influx db integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetInfluxDbIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) WithDefaults() *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetInfluxDbIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get influx db integration params | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetInfluxDbIntegrationReader is a Reader for the ApplicationServiceGetInfluxDbIntegration structure. | ||||
| type ApplicationServiceGetInfluxDbIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetInfluxDbIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetInfluxDbIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetInfluxDbIntegrationOK creates a ApplicationServiceGetInfluxDbIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetInfluxDbIntegrationOK() *ApplicationServiceGetInfluxDbIntegrationOK { | ||||
| 	return &ApplicationServiceGetInfluxDbIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetInfluxDbIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetInfluxDbIntegrationOK struct { | ||||
| 	Payload *models.APIGetInfluxDbIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get influx db integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get influx db integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get influx db integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get influx db integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get influx db integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get influx db integration o k response | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/influxdb][%d] applicationServiceGetInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/influxdb][%d] applicationServiceGetInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) GetPayload() *models.APIGetInfluxDbIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetInfluxDbIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetInfluxDbIntegrationDefault creates a ApplicationServiceGetInfluxDbIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetInfluxDbIntegrationDefault(code int) *ApplicationServiceGetInfluxDbIntegrationDefault { | ||||
| 	return &ApplicationServiceGetInfluxDbIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetInfluxDbIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetInfluxDbIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get influx db integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get influx db integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get influx db integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get influx db integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get influx db integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get influx db integration default response | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/influxdb][%d] ApplicationService_GetInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/influxdb][%d] ApplicationService_GetInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetInfluxDbIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetMyDevicesIntegrationParams creates a new ApplicationServiceGetMyDevicesIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetMyDevicesIntegrationParams() *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceGetMyDevicesIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetMyDevicesIntegrationParamsWithTimeout creates a new ApplicationServiceGetMyDevicesIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetMyDevicesIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceGetMyDevicesIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetMyDevicesIntegrationParamsWithContext creates a new ApplicationServiceGetMyDevicesIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetMyDevicesIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceGetMyDevicesIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetMyDevicesIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetMyDevicesIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetMyDevicesIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceGetMyDevicesIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetMyDevicesIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get my devices integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetMyDevicesIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) WithDefaults() *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetMyDevicesIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get my devices integration params | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetMyDevicesIntegrationReader is a Reader for the ApplicationServiceGetMyDevicesIntegration structure. | ||||
| type ApplicationServiceGetMyDevicesIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetMyDevicesIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetMyDevicesIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetMyDevicesIntegrationOK creates a ApplicationServiceGetMyDevicesIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetMyDevicesIntegrationOK() *ApplicationServiceGetMyDevicesIntegrationOK { | ||||
| 	return &ApplicationServiceGetMyDevicesIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetMyDevicesIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetMyDevicesIntegrationOK struct { | ||||
| 	Payload *models.APIGetMyDevicesIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get my devices integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get my devices integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get my devices integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get my devices integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get my devices integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get my devices integration o k response | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/mydevices][%d] applicationServiceGetMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/mydevices][%d] applicationServiceGetMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) GetPayload() *models.APIGetMyDevicesIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetMyDevicesIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetMyDevicesIntegrationDefault creates a ApplicationServiceGetMyDevicesIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetMyDevicesIntegrationDefault(code int) *ApplicationServiceGetMyDevicesIntegrationDefault { | ||||
| 	return &ApplicationServiceGetMyDevicesIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetMyDevicesIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetMyDevicesIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get my devices integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get my devices integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get my devices integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get my devices integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get my devices integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get my devices integration default response | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/mydevices][%d] ApplicationService_GetMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/mydevices][%d] ApplicationService_GetMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetMyDevicesIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetParams creates a new ApplicationServiceGetParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetParams() *ApplicationServiceGetParams { | ||||
| 	return &ApplicationServiceGetParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetParamsWithTimeout creates a new ApplicationServiceGetParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetParams { | ||||
| 	return &ApplicationServiceGetParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetParamsWithContext creates a new ApplicationServiceGetParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetParamsWithContext(ctx context.Context) *ApplicationServiceGetParams { | ||||
| 	return &ApplicationServiceGetParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetParamsWithHTTPClient creates a new ApplicationServiceGetParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetParams { | ||||
| 	return &ApplicationServiceGetParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetParams struct { | ||||
|  | ||||
| 	/* ID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetParams) WithDefaults() *ApplicationServiceGetParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get params | ||||
| func (o *ApplicationServiceGetParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get params | ||||
| func (o *ApplicationServiceGetParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get params | ||||
| func (o *ApplicationServiceGetParams) WithContext(ctx context.Context) *ApplicationServiceGetParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get params | ||||
| func (o *ApplicationServiceGetParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get params | ||||
| func (o *ApplicationServiceGetParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get params | ||||
| func (o *ApplicationServiceGetParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithID adds the id to the application service get params | ||||
| func (o *ApplicationServiceGetParams) WithID(id string) *ApplicationServiceGetParams { | ||||
| 	o.SetID(id) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetID adds the id to the application service get params | ||||
| func (o *ApplicationServiceGetParams) SetID(id string) { | ||||
| 	o.ID = id | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param id | ||||
| 	if err := r.SetPathParam("id", o.ID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetPilotThingsIntegrationParams creates a new ApplicationServiceGetPilotThingsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetPilotThingsIntegrationParams() *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceGetPilotThingsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetPilotThingsIntegrationParamsWithTimeout creates a new ApplicationServiceGetPilotThingsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetPilotThingsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceGetPilotThingsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetPilotThingsIntegrationParamsWithContext creates a new ApplicationServiceGetPilotThingsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetPilotThingsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceGetPilotThingsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetPilotThingsIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetPilotThingsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetPilotThingsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceGetPilotThingsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetPilotThingsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get pilot things integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetPilotThingsIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) WithDefaults() *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetPilotThingsIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get pilot things integration params | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetPilotThingsIntegrationReader is a Reader for the ApplicationServiceGetPilotThingsIntegration structure. | ||||
| type ApplicationServiceGetPilotThingsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetPilotThingsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetPilotThingsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetPilotThingsIntegrationOK creates a ApplicationServiceGetPilotThingsIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetPilotThingsIntegrationOK() *ApplicationServiceGetPilotThingsIntegrationOK { | ||||
| 	return &ApplicationServiceGetPilotThingsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetPilotThingsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetPilotThingsIntegrationOK struct { | ||||
| 	Payload *models.APIGetPilotThingsIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get pilot things integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get pilot things integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get pilot things integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get pilot things integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get pilot things integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get pilot things integration o k response | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/pilot-things][%d] applicationServiceGetPilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/pilot-things][%d] applicationServiceGetPilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) GetPayload() *models.APIGetPilotThingsIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetPilotThingsIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetPilotThingsIntegrationDefault creates a ApplicationServiceGetPilotThingsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetPilotThingsIntegrationDefault(code int) *ApplicationServiceGetPilotThingsIntegrationDefault { | ||||
| 	return &ApplicationServiceGetPilotThingsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetPilotThingsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetPilotThingsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get pilot things integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get pilot things integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get pilot things integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get pilot things integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get pilot things integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get pilot things integration default response | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/pilot-things][%d] ApplicationService_GetPilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/pilot-things][%d] ApplicationService_GetPilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetPilotThingsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetReader is a Reader for the ApplicationServiceGet structure. | ||||
| type ApplicationServiceGetReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetOK creates a ApplicationServiceGetOK with default headers values | ||||
| func NewApplicationServiceGetOK() *ApplicationServiceGetOK { | ||||
| 	return &ApplicationServiceGetOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetOK struct { | ||||
| 	Payload *models.APIGetApplicationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get o k response | ||||
| func (o *ApplicationServiceGetOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{id}][%d] applicationServiceGetOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{id}][%d] applicationServiceGetOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetOK) GetPayload() *models.APIGetApplicationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetApplicationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetDefault creates a ApplicationServiceGetDefault with default headers values | ||||
| func NewApplicationServiceGetDefault(code int) *ApplicationServiceGetDefault { | ||||
| 	return &ApplicationServiceGetDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get default response | ||||
| func (o *ApplicationServiceGetDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{id}][%d] ApplicationService_Get default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{id}][%d] ApplicationService_Get default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceGetThingsBoardIntegrationParams creates a new ApplicationServiceGetThingsBoardIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceGetThingsBoardIntegrationParams() *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceGetThingsBoardIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetThingsBoardIntegrationParamsWithTimeout creates a new ApplicationServiceGetThingsBoardIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceGetThingsBoardIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceGetThingsBoardIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetThingsBoardIntegrationParamsWithContext creates a new ApplicationServiceGetThingsBoardIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceGetThingsBoardIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceGetThingsBoardIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetThingsBoardIntegrationParamsWithHTTPClient creates a new ApplicationServiceGetThingsBoardIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceGetThingsBoardIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceGetThingsBoardIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetThingsBoardIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service get things board integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceGetThingsBoardIntegrationParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service get things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) WithDefaults() *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service get things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) WithApplicationID(applicationID string) *ApplicationServiceGetThingsBoardIntegrationParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service get things board integration params | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceGetThingsBoardIntegrationReader is a Reader for the ApplicationServiceGetThingsBoardIntegration structure. | ||||
| type ApplicationServiceGetThingsBoardIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceGetThingsBoardIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceGetThingsBoardIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetThingsBoardIntegrationOK creates a ApplicationServiceGetThingsBoardIntegrationOK with default headers values | ||||
| func NewApplicationServiceGetThingsBoardIntegrationOK() *ApplicationServiceGetThingsBoardIntegrationOK { | ||||
| 	return &ApplicationServiceGetThingsBoardIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetThingsBoardIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceGetThingsBoardIntegrationOK struct { | ||||
| 	Payload *models.APIGetThingsBoardIntegrationResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get things board integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get things board integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get things board integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get things board integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get things board integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get things board integration o k response | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] applicationServiceGetThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] applicationServiceGetThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) GetPayload() *models.APIGetThingsBoardIntegrationResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetThingsBoardIntegrationResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceGetThingsBoardIntegrationDefault creates a ApplicationServiceGetThingsBoardIntegrationDefault with default headers values | ||||
| func NewApplicationServiceGetThingsBoardIntegrationDefault(code int) *ApplicationServiceGetThingsBoardIntegrationDefault { | ||||
| 	return &ApplicationServiceGetThingsBoardIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceGetThingsBoardIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceGetThingsBoardIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service get things board integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service get things board integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service get things board integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service get things board integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service get things board integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service get things board integration default response | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] ApplicationService_GetThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations/thingsboard][%d] ApplicationService_GetThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceGetThingsBoardIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceListDeviceProfilesParams creates a new ApplicationServiceListDeviceProfilesParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceListDeviceProfilesParams() *ApplicationServiceListDeviceProfilesParams { | ||||
| 	return &ApplicationServiceListDeviceProfilesParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceProfilesParamsWithTimeout creates a new ApplicationServiceListDeviceProfilesParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceListDeviceProfilesParamsWithTimeout(timeout time.Duration) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	return &ApplicationServiceListDeviceProfilesParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceProfilesParamsWithContext creates a new ApplicationServiceListDeviceProfilesParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceListDeviceProfilesParamsWithContext(ctx context.Context) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	return &ApplicationServiceListDeviceProfilesParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceProfilesParamsWithHTTPClient creates a new ApplicationServiceListDeviceProfilesParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceListDeviceProfilesParamsWithHTTPClient(client *http.Client) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	return &ApplicationServiceListDeviceProfilesParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDeviceProfilesParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service list device profiles operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceListDeviceProfilesParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service list device profiles params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) WithDefaults() *ApplicationServiceListDeviceProfilesParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service list device profiles params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) WithTimeout(timeout time.Duration) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) WithContext(ctx context.Context) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) WithHTTPClient(client *http.Client) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) WithApplicationID(applicationID string) *ApplicationServiceListDeviceProfilesParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service list device profiles params | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceListDeviceProfilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceListDeviceProfilesReader is a Reader for the ApplicationServiceListDeviceProfiles structure. | ||||
| type ApplicationServiceListDeviceProfilesReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceListDeviceProfilesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceListDeviceProfilesOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceListDeviceProfilesDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceProfilesOK creates a ApplicationServiceListDeviceProfilesOK with default headers values | ||||
| func NewApplicationServiceListDeviceProfilesOK() *ApplicationServiceListDeviceProfilesOK { | ||||
| 	return &ApplicationServiceListDeviceProfilesOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDeviceProfilesOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceListDeviceProfilesOK struct { | ||||
| 	Payload *models.APIListApplicationDeviceProfilesResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list device profiles o k response has a 2xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list device profiles o k response has a 3xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list device profiles o k response has a 4xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list device profiles o k response has a 5xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list device profiles o k response a status code equal to that given | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list device profiles o k response | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-profiles][%d] applicationServiceListDeviceProfilesOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-profiles][%d] applicationServiceListDeviceProfilesOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) GetPayload() *models.APIListApplicationDeviceProfilesResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIListApplicationDeviceProfilesResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceProfilesDefault creates a ApplicationServiceListDeviceProfilesDefault with default headers values | ||||
| func NewApplicationServiceListDeviceProfilesDefault(code int) *ApplicationServiceListDeviceProfilesDefault { | ||||
| 	return &ApplicationServiceListDeviceProfilesDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDeviceProfilesDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceListDeviceProfilesDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list device profiles default response has a 2xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list device profiles default response has a 3xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list device profiles default response has a 4xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list device profiles default response has a 5xx status code | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list device profiles default response a status code equal to that given | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list device profiles default response | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-profiles][%d] ApplicationService_ListDeviceProfiles default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-profiles][%d] ApplicationService_ListDeviceProfiles default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceProfilesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceListDeviceTagsParams creates a new ApplicationServiceListDeviceTagsParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceListDeviceTagsParams() *ApplicationServiceListDeviceTagsParams { | ||||
| 	return &ApplicationServiceListDeviceTagsParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceTagsParamsWithTimeout creates a new ApplicationServiceListDeviceTagsParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceListDeviceTagsParamsWithTimeout(timeout time.Duration) *ApplicationServiceListDeviceTagsParams { | ||||
| 	return &ApplicationServiceListDeviceTagsParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceTagsParamsWithContext creates a new ApplicationServiceListDeviceTagsParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceListDeviceTagsParamsWithContext(ctx context.Context) *ApplicationServiceListDeviceTagsParams { | ||||
| 	return &ApplicationServiceListDeviceTagsParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceTagsParamsWithHTTPClient creates a new ApplicationServiceListDeviceTagsParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceListDeviceTagsParamsWithHTTPClient(client *http.Client) *ApplicationServiceListDeviceTagsParams { | ||||
| 	return &ApplicationServiceListDeviceTagsParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDeviceTagsParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service list device tags operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceListDeviceTagsParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service list device tags params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListDeviceTagsParams) WithDefaults() *ApplicationServiceListDeviceTagsParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service list device tags params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListDeviceTagsParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) WithTimeout(timeout time.Duration) *ApplicationServiceListDeviceTagsParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) WithContext(ctx context.Context) *ApplicationServiceListDeviceTagsParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) WithHTTPClient(client *http.Client) *ApplicationServiceListDeviceTagsParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) WithApplicationID(applicationID string) *ApplicationServiceListDeviceTagsParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service list device tags params | ||||
| func (o *ApplicationServiceListDeviceTagsParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceListDeviceTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceListDeviceTagsReader is a Reader for the ApplicationServiceListDeviceTags structure. | ||||
| type ApplicationServiceListDeviceTagsReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceListDeviceTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceListDeviceTagsOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceListDeviceTagsDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceTagsOK creates a ApplicationServiceListDeviceTagsOK with default headers values | ||||
| func NewApplicationServiceListDeviceTagsOK() *ApplicationServiceListDeviceTagsOK { | ||||
| 	return &ApplicationServiceListDeviceTagsOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDeviceTagsOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceListDeviceTagsOK struct { | ||||
| 	Payload *models.APIListApplicationDeviceTagsResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list device tags o k response has a 2xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list device tags o k response has a 3xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list device tags o k response has a 4xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list device tags o k response has a 5xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list device tags o k response a status code equal to that given | ||||
| func (o *ApplicationServiceListDeviceTagsOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list device tags o k response | ||||
| func (o *ApplicationServiceListDeviceTagsOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-tags][%d] applicationServiceListDeviceTagsOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-tags][%d] applicationServiceListDeviceTagsOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsOK) GetPayload() *models.APIListApplicationDeviceTagsResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIListApplicationDeviceTagsResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDeviceTagsDefault creates a ApplicationServiceListDeviceTagsDefault with default headers values | ||||
| func NewApplicationServiceListDeviceTagsDefault(code int) *ApplicationServiceListDeviceTagsDefault { | ||||
| 	return &ApplicationServiceListDeviceTagsDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDeviceTagsDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceListDeviceTagsDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list device tags default response has a 2xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list device tags default response has a 3xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list device tags default response has a 4xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list device tags default response has a 5xx status code | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list device tags default response a status code equal to that given | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list device tags default response | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-tags][%d] ApplicationService_ListDeviceTags default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/device-tags][%d] ApplicationService_ListDeviceTags default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDeviceTagsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceListIntegrationsParams creates a new ApplicationServiceListIntegrationsParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceListIntegrationsParams() *ApplicationServiceListIntegrationsParams { | ||||
| 	return &ApplicationServiceListIntegrationsParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListIntegrationsParamsWithTimeout creates a new ApplicationServiceListIntegrationsParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceListIntegrationsParamsWithTimeout(timeout time.Duration) *ApplicationServiceListIntegrationsParams { | ||||
| 	return &ApplicationServiceListIntegrationsParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListIntegrationsParamsWithContext creates a new ApplicationServiceListIntegrationsParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceListIntegrationsParamsWithContext(ctx context.Context) *ApplicationServiceListIntegrationsParams { | ||||
| 	return &ApplicationServiceListIntegrationsParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListIntegrationsParamsWithHTTPClient creates a new ApplicationServiceListIntegrationsParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceListIntegrationsParamsWithHTTPClient(client *http.Client) *ApplicationServiceListIntegrationsParams { | ||||
| 	return &ApplicationServiceListIntegrationsParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListIntegrationsParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service list integrations operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceListIntegrationsParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service list integrations params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListIntegrationsParams) WithDefaults() *ApplicationServiceListIntegrationsParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service list integrations params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListIntegrationsParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) WithTimeout(timeout time.Duration) *ApplicationServiceListIntegrationsParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) WithContext(ctx context.Context) *ApplicationServiceListIntegrationsParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) WithHTTPClient(client *http.Client) *ApplicationServiceListIntegrationsParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) WithApplicationID(applicationID string) *ApplicationServiceListIntegrationsParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service list integrations params | ||||
| func (o *ApplicationServiceListIntegrationsParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceListIntegrationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param applicationId | ||||
| 	if err := r.SetPathParam("applicationId", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceListIntegrationsReader is a Reader for the ApplicationServiceListIntegrations structure. | ||||
| type ApplicationServiceListIntegrationsReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceListIntegrationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceListIntegrationsOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceListIntegrationsDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListIntegrationsOK creates a ApplicationServiceListIntegrationsOK with default headers values | ||||
| func NewApplicationServiceListIntegrationsOK() *ApplicationServiceListIntegrationsOK { | ||||
| 	return &ApplicationServiceListIntegrationsOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListIntegrationsOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceListIntegrationsOK struct { | ||||
| 	Payload *models.APIListIntegrationsResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list integrations o k response has a 2xx status code | ||||
| func (o *ApplicationServiceListIntegrationsOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list integrations o k response has a 3xx status code | ||||
| func (o *ApplicationServiceListIntegrationsOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list integrations o k response has a 4xx status code | ||||
| func (o *ApplicationServiceListIntegrationsOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list integrations o k response has a 5xx status code | ||||
| func (o *ApplicationServiceListIntegrationsOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list integrations o k response a status code equal to that given | ||||
| func (o *ApplicationServiceListIntegrationsOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list integrations o k response | ||||
| func (o *ApplicationServiceListIntegrationsOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations][%d] applicationServiceListIntegrationsOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations][%d] applicationServiceListIntegrationsOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsOK) GetPayload() *models.APIListIntegrationsResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIListIntegrationsResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListIntegrationsDefault creates a ApplicationServiceListIntegrationsDefault with default headers values | ||||
| func NewApplicationServiceListIntegrationsDefault(code int) *ApplicationServiceListIntegrationsDefault { | ||||
| 	return &ApplicationServiceListIntegrationsDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListIntegrationsDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceListIntegrationsDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list integrations default response has a 2xx status code | ||||
| func (o *ApplicationServiceListIntegrationsDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list integrations default response has a 3xx status code | ||||
| func (o *ApplicationServiceListIntegrationsDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list integrations default response has a 4xx status code | ||||
| func (o *ApplicationServiceListIntegrationsDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list integrations default response has a 5xx status code | ||||
| func (o *ApplicationServiceListIntegrationsDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list integrations default response a status code equal to that given | ||||
| func (o *ApplicationServiceListIntegrationsDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list integrations default response | ||||
| func (o *ApplicationServiceListIntegrationsDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations][%d] ApplicationService_ListIntegrations default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications/{applicationId}/integrations][%d] ApplicationService_ListIntegrations default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListIntegrationsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,271 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceListParams creates a new ApplicationServiceListParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceListParams() *ApplicationServiceListParams { | ||||
| 	return &ApplicationServiceListParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListParamsWithTimeout creates a new ApplicationServiceListParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceListParamsWithTimeout(timeout time.Duration) *ApplicationServiceListParams { | ||||
| 	return &ApplicationServiceListParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListParamsWithContext creates a new ApplicationServiceListParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceListParamsWithContext(ctx context.Context) *ApplicationServiceListParams { | ||||
| 	return &ApplicationServiceListParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListParamsWithHTTPClient creates a new ApplicationServiceListParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceListParamsWithHTTPClient(client *http.Client) *ApplicationServiceListParams { | ||||
| 	return &ApplicationServiceListParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service list operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceListParams struct { | ||||
|  | ||||
| 	/* Limit. | ||||
|  | ||||
| 	     Max number of applications to return in the result-set. | ||||
| 	If not set, it will be treated as 0, and the response will only return the total_count. | ||||
|  | ||||
| 	     Format: int64 | ||||
| 	*/ | ||||
| 	Limit *int64 | ||||
|  | ||||
| 	/* Offset. | ||||
|  | ||||
| 	   Offset in the result-set (for pagination). | ||||
|  | ||||
| 	   Format: int64 | ||||
| 	*/ | ||||
| 	Offset *int64 | ||||
|  | ||||
| 	/* Search. | ||||
|  | ||||
| 	   If set, the given string will be used to search on name (optional). | ||||
| 	*/ | ||||
| 	Search *string | ||||
|  | ||||
| 	/* TenantID. | ||||
|  | ||||
| 	   Tenant ID to list the applications for. | ||||
| 	*/ | ||||
| 	TenantID *string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service list params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListParams) WithDefaults() *ApplicationServiceListParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service list params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceListParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithTimeout(timeout time.Duration) *ApplicationServiceListParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithContext(ctx context.Context) *ApplicationServiceListParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithHTTPClient(client *http.Client) *ApplicationServiceListParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithLimit adds the limit to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithLimit(limit *int64) *ApplicationServiceListParams { | ||||
| 	o.SetLimit(limit) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetLimit adds the limit to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetLimit(limit *int64) { | ||||
| 	o.Limit = limit | ||||
| } | ||||
|  | ||||
| // WithOffset adds the offset to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithOffset(offset *int64) *ApplicationServiceListParams { | ||||
| 	o.SetOffset(offset) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetOffset adds the offset to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetOffset(offset *int64) { | ||||
| 	o.Offset = offset | ||||
| } | ||||
|  | ||||
| // WithSearch adds the search to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithSearch(search *string) *ApplicationServiceListParams { | ||||
| 	o.SetSearch(search) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetSearch adds the search to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetSearch(search *string) { | ||||
| 	o.Search = search | ||||
| } | ||||
|  | ||||
| // WithTenantID adds the tenantID to the application service list params | ||||
| func (o *ApplicationServiceListParams) WithTenantID(tenantID *string) *ApplicationServiceListParams { | ||||
| 	o.SetTenantID(tenantID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTenantID adds the tenantId to the application service list params | ||||
| func (o *ApplicationServiceListParams) SetTenantID(tenantID *string) { | ||||
| 	o.TenantID = tenantID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	if o.Limit != nil { | ||||
|  | ||||
| 		// query param limit | ||||
| 		var qrLimit int64 | ||||
|  | ||||
| 		if o.Limit != nil { | ||||
| 			qrLimit = *o.Limit | ||||
| 		} | ||||
| 		qLimit := swag.FormatInt64(qrLimit) | ||||
| 		if qLimit != "" { | ||||
|  | ||||
| 			if err := r.SetQueryParam("limit", qLimit); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if o.Offset != nil { | ||||
|  | ||||
| 		// query param offset | ||||
| 		var qrOffset int64 | ||||
|  | ||||
| 		if o.Offset != nil { | ||||
| 			qrOffset = *o.Offset | ||||
| 		} | ||||
| 		qOffset := swag.FormatInt64(qrOffset) | ||||
| 		if qOffset != "" { | ||||
|  | ||||
| 			if err := r.SetQueryParam("offset", qOffset); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if o.Search != nil { | ||||
|  | ||||
| 		// query param search | ||||
| 		var qrSearch string | ||||
|  | ||||
| 		if o.Search != nil { | ||||
| 			qrSearch = *o.Search | ||||
| 		} | ||||
| 		qSearch := qrSearch | ||||
| 		if qSearch != "" { | ||||
|  | ||||
| 			if err := r.SetQueryParam("search", qSearch); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if o.TenantID != nil { | ||||
|  | ||||
| 		// query param tenantId | ||||
| 		var qrTenantID string | ||||
|  | ||||
| 		if o.TenantID != nil { | ||||
| 			qrTenantID = *o.TenantID | ||||
| 		} | ||||
| 		qTenantID := qrTenantID | ||||
| 		if qTenantID != "" { | ||||
|  | ||||
| 			if err := r.SetQueryParam("tenantId", qTenantID); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceListReader is a Reader for the ApplicationServiceList structure. | ||||
| type ApplicationServiceListReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceListOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceListDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListOK creates a ApplicationServiceListOK with default headers values | ||||
| func NewApplicationServiceListOK() *ApplicationServiceListOK { | ||||
| 	return &ApplicationServiceListOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceListOK struct { | ||||
| 	Payload *models.APIListApplicationsResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list o k response has a 2xx status code | ||||
| func (o *ApplicationServiceListOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list o k response has a 3xx status code | ||||
| func (o *ApplicationServiceListOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list o k response has a 4xx status code | ||||
| func (o *ApplicationServiceListOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list o k response has a 5xx status code | ||||
| func (o *ApplicationServiceListOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list o k response a status code equal to that given | ||||
| func (o *ApplicationServiceListOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list o k response | ||||
| func (o *ApplicationServiceListOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications][%d] applicationServiceListOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications][%d] applicationServiceListOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListOK) GetPayload() *models.APIListApplicationsResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIListApplicationsResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceListDefault creates a ApplicationServiceListDefault with default headers values | ||||
| func NewApplicationServiceListDefault(code int) *ApplicationServiceListDefault { | ||||
| 	return &ApplicationServiceListDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceListDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceListDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service list default response has a 2xx status code | ||||
| func (o *ApplicationServiceListDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service list default response has a 3xx status code | ||||
| func (o *ApplicationServiceListDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service list default response has a 4xx status code | ||||
| func (o *ApplicationServiceListDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service list default response has a 5xx status code | ||||
| func (o *ApplicationServiceListDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service list default response a status code equal to that given | ||||
| func (o *ApplicationServiceListDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service list default response | ||||
| func (o *ApplicationServiceListDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications][%d] ApplicationService_List default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/applications][%d] ApplicationService_List default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceListDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateAwsSnsIntegrationParams creates a new ApplicationServiceUpdateAwsSnsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateAwsSnsIntegrationParams() *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAwsSnsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAwsSnsIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateAwsSnsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateAwsSnsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAwsSnsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAwsSnsIntegrationParamsWithContext creates a new ApplicationServiceUpdateAwsSnsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateAwsSnsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAwsSnsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAwsSnsIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateAwsSnsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateAwsSnsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAwsSnsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAwsSnsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update aws sns integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateAwsSnsIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateAwsSnsIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WithDefaults() *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update aws sns integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WithBody(body ApplicationServiceUpdateAwsSnsIntegrationBody) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) SetBody(body ApplicationServiceUpdateAwsSnsIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateAwsSnsIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update aws sns integration params | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,392 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateAwsSnsIntegrationReader is a Reader for the ApplicationServiceUpdateAwsSnsIntegration structure. | ||||
| type ApplicationServiceUpdateAwsSnsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateAwsSnsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateAwsSnsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAwsSnsIntegrationOK creates a ApplicationServiceUpdateAwsSnsIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateAwsSnsIntegrationOK() *ApplicationServiceUpdateAwsSnsIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateAwsSnsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAwsSnsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateAwsSnsIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update aws sns integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update aws sns integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update aws sns integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update aws sns integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update aws sns integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update aws sns integration o k response | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/aws-sns][%d] applicationServiceUpdateAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/aws-sns][%d] applicationServiceUpdateAwsSnsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAwsSnsIntegrationDefault creates a ApplicationServiceUpdateAwsSnsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateAwsSnsIntegrationDefault(code int) *ApplicationServiceUpdateAwsSnsIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateAwsSnsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAwsSnsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateAwsSnsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update aws sns integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update aws sns integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update aws sns integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update aws sns integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update aws sns integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update aws sns integration default response | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/aws-sns][%d] ApplicationService_UpdateAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/aws-sns][%d] ApplicationService_UpdateAwsSnsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAwsSnsIntegrationBody application service update aws sns integration body | ||||
| swagger:model ApplicationServiceUpdateAwsSnsIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateAwsSnsIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update aws sns integration body | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update aws sns integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateAwsSnsIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// AWS Access Key ID. | ||||
| 	AccessKeyID string `json:"accessKeyId,omitempty"` | ||||
|  | ||||
| 	// Encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// AWS region. | ||||
| 	Region string `json:"region,omitempty"` | ||||
|  | ||||
| 	// AWS Secret Access Key. | ||||
| 	SecretAccessKey string `json:"secretAccessKey,omitempty"` | ||||
|  | ||||
| 	// Topic ARN. | ||||
| 	TopicArn string `json:"topicArn,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update aws sns integration params body integration | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update aws sns integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateAwsSnsIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateAzureServiceBusIntegrationParams creates a new ApplicationServiceUpdateAzureServiceBusIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateAzureServiceBusIntegrationParams() *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAzureServiceBusIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAzureServiceBusIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateAzureServiceBusIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAzureServiceBusIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAzureServiceBusIntegrationParamsWithContext creates a new ApplicationServiceUpdateAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateAzureServiceBusIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAzureServiceBusIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAzureServiceBusIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateAzureServiceBusIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateAzureServiceBusIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateAzureServiceBusIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAzureServiceBusIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update azure service bus integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateAzureServiceBusIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateAzureServiceBusIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WithDefaults() *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update azure service bus integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WithBody(body ApplicationServiceUpdateAzureServiceBusIntegrationBody) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) SetBody(body ApplicationServiceUpdateAzureServiceBusIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateAzureServiceBusIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update azure service bus integration params | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,387 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateAzureServiceBusIntegrationReader is a Reader for the ApplicationServiceUpdateAzureServiceBusIntegration structure. | ||||
| type ApplicationServiceUpdateAzureServiceBusIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateAzureServiceBusIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateAzureServiceBusIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAzureServiceBusIntegrationOK creates a ApplicationServiceUpdateAzureServiceBusIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateAzureServiceBusIntegrationOK() *ApplicationServiceUpdateAzureServiceBusIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateAzureServiceBusIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAzureServiceBusIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateAzureServiceBusIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update azure service bus integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update azure service bus integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update azure service bus integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update azure service bus integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update azure service bus integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update azure service bus integration o k response | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] applicationServiceUpdateAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] applicationServiceUpdateAzureServiceBusIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateAzureServiceBusIntegrationDefault creates a ApplicationServiceUpdateAzureServiceBusIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateAzureServiceBusIntegrationDefault(code int) *ApplicationServiceUpdateAzureServiceBusIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateAzureServiceBusIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAzureServiceBusIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateAzureServiceBusIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update azure service bus integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update azure service bus integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update azure service bus integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update azure service bus integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update azure service bus integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update azure service bus integration default response | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] ApplicationService_UpdateAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/azure-service-bus][%d] ApplicationService_UpdateAzureServiceBusIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAzureServiceBusIntegrationBody application service update azure service bus integration body | ||||
| swagger:model ApplicationServiceUpdateAzureServiceBusIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateAzureServiceBusIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update azure service bus integration body | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update azure service bus integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateAzureServiceBusIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration Integration object to create. | ||||
| swagger:model ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Connection string. | ||||
| 	ConnectionString string `json:"connectionString,omitempty"` | ||||
|  | ||||
| 	// Encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// Publish name. | ||||
| 	// This is the name of the topic or queue. | ||||
| 	PublishName string `json:"publishName,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update azure service bus integration params body integration | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update azure service bus integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateAzureServiceBusIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateGcpPubSubIntegrationParams creates a new ApplicationServiceUpdateGcpPubSubIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateGcpPubSubIntegrationParams() *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateGcpPubSubIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateGcpPubSubIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateGcpPubSubIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateGcpPubSubIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateGcpPubSubIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateGcpPubSubIntegrationParamsWithContext creates a new ApplicationServiceUpdateGcpPubSubIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateGcpPubSubIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateGcpPubSubIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateGcpPubSubIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateGcpPubSubIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateGcpPubSubIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateGcpPubSubIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateGcpPubSubIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update gcp pub sub integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateGcpPubSubIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateGcpPubSubIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WithDefaults() *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update gcp pub sub integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WithBody(body ApplicationServiceUpdateGcpPubSubIntegrationBody) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) SetBody(body ApplicationServiceUpdateGcpPubSubIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateGcpPubSubIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update gcp pub sub integration params | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,393 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateGcpPubSubIntegrationReader is a Reader for the ApplicationServiceUpdateGcpPubSubIntegration structure. | ||||
| type ApplicationServiceUpdateGcpPubSubIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateGcpPubSubIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateGcpPubSubIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateGcpPubSubIntegrationOK creates a ApplicationServiceUpdateGcpPubSubIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateGcpPubSubIntegrationOK() *ApplicationServiceUpdateGcpPubSubIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateGcpPubSubIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateGcpPubSubIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateGcpPubSubIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update gcp pub sub integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update gcp pub sub integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update gcp pub sub integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update gcp pub sub integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update gcp pub sub integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update gcp pub sub integration o k response | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] applicationServiceUpdateGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] applicationServiceUpdateGcpPubSubIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateGcpPubSubIntegrationDefault creates a ApplicationServiceUpdateGcpPubSubIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateGcpPubSubIntegrationDefault(code int) *ApplicationServiceUpdateGcpPubSubIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateGcpPubSubIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateGcpPubSubIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateGcpPubSubIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update gcp pub sub integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update gcp pub sub integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update gcp pub sub integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update gcp pub sub integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update gcp pub sub integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update gcp pub sub integration default response | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_UpdateGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/gcp-pub-sub][%d] ApplicationService_UpdateGcpPubSubIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateGcpPubSubIntegrationBody application service update gcp pub sub integration body | ||||
| swagger:model ApplicationServiceUpdateGcpPubSubIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateGcpPubSubIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update gcp pub sub integration body | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update gcp pub sub integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateGcpPubSubIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Credentials file. | ||||
| 	// This IAM service-account credentials file (JSON) must have the following | ||||
| 	// Pub/Sub roles: | ||||
| 	// * Pub/Sub Publisher | ||||
| 	CredentialsFile string `json:"credentialsFile,omitempty"` | ||||
|  | ||||
| 	// Encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// Project ID. | ||||
| 	ProjectID string `json:"projectId,omitempty"` | ||||
|  | ||||
| 	// Topic name. | ||||
| 	// This is the name of the Pub/Sub topic. | ||||
| 	TopicName string `json:"topicName,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update gcp pub sub integration params body integration | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update gcp pub sub integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateGcpPubSubIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateHTTPIntegrationParams creates a new ApplicationServiceUpdateHTTPIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateHTTPIntegrationParams() *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateHTTPIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateHTTPIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateHTTPIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateHTTPIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateHTTPIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateHTTPIntegrationParamsWithContext creates a new ApplicationServiceUpdateHTTPIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateHTTPIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateHTTPIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateHTTPIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateHTTPIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateHTTPIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateHTTPIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateHTTPIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update Http integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateHTTPIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateHTTPIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WithDefaults() *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update Http integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WithBody(body ApplicationServiceUpdateHTTPIntegrationBody) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) SetBody(body ApplicationServiceUpdateHTTPIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateHTTPIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update Http integration params | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,389 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateHTTPIntegrationReader is a Reader for the ApplicationServiceUpdateHTTPIntegration structure. | ||||
| type ApplicationServiceUpdateHTTPIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateHTTPIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateHTTPIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateHTTPIntegrationOK creates a ApplicationServiceUpdateHTTPIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateHTTPIntegrationOK() *ApplicationServiceUpdateHTTPIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateHTTPIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateHTTPIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateHTTPIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update Http integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update Http integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update Http integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update Http integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update Http integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update Http integration o k response | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/http][%d] applicationServiceUpdateHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/http][%d] applicationServiceUpdateHttpIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateHTTPIntegrationDefault creates a ApplicationServiceUpdateHTTPIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateHTTPIntegrationDefault(code int) *ApplicationServiceUpdateHTTPIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateHTTPIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateHTTPIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateHTTPIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update Http integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update Http integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update Http integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update Http integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update Http integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update Http integration default response | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/http][%d] ApplicationService_UpdateHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/http][%d] ApplicationService_UpdateHttpIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateHTTPIntegrationBody application service update HTTP integration body | ||||
| swagger:model ApplicationServiceUpdateHTTPIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateHTTPIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update HTTP integration body | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update HTTP integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateHTTPIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Payload encoding. | ||||
| 	Encoding *models.APIEncoding `json:"encoding,omitempty"` | ||||
|  | ||||
| 	// Event endpoint URL. | ||||
| 	// The HTTP integration will POST all events to this enpoint. The request | ||||
| 	// will contain a query parameters "event" containing the type of the | ||||
| 	// event. | ||||
| 	EventEndpointURL string `json:"eventEndpointUrl,omitempty"` | ||||
|  | ||||
| 	// HTTP headers to set when making requests. | ||||
| 	Headers map[string]string `json:"headers,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update HTTP integration params body integration | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateEncoding(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration) validateEncoding(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Encoding) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
| 		if err := o.Encoding.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update HTTP integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateEncoding(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Encoding != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Encoding) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Encoding.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "encoding") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateHTTPIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateIftttIntegrationParams creates a new ApplicationServiceUpdateIftttIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateIftttIntegrationParams() *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateIftttIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateIftttIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateIftttIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateIftttIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateIftttIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateIftttIntegrationParamsWithContext creates a new ApplicationServiceUpdateIftttIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateIftttIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateIftttIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateIftttIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateIftttIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateIftttIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateIftttIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateIftttIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update ifttt integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateIftttIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateIftttIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WithDefaults() *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update ifttt integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WithBody(body ApplicationServiceUpdateIftttIntegrationBody) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) SetBody(body ApplicationServiceUpdateIftttIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateIftttIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update ifttt integration params | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,346 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateIftttIntegrationReader is a Reader for the ApplicationServiceUpdateIftttIntegration structure. | ||||
| type ApplicationServiceUpdateIftttIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateIftttIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateIftttIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateIftttIntegrationOK creates a ApplicationServiceUpdateIftttIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateIftttIntegrationOK() *ApplicationServiceUpdateIftttIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateIftttIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateIftttIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateIftttIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update ifttt integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update ifttt integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update ifttt integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update ifttt integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update ifttt integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update ifttt integration o k response | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/ifttt][%d] applicationServiceUpdateIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/ifttt][%d] applicationServiceUpdateIftttIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateIftttIntegrationDefault creates a ApplicationServiceUpdateIftttIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateIftttIntegrationDefault(code int) *ApplicationServiceUpdateIftttIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateIftttIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateIftttIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateIftttIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update ifttt integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update ifttt integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update ifttt integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update ifttt integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update ifttt integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update ifttt integration default response | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/ifttt][%d] ApplicationService_UpdateIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/ifttt][%d] ApplicationService_UpdateIftttIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateIftttIntegrationBody application service update ifttt integration body | ||||
| swagger:model ApplicationServiceUpdateIftttIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateIftttIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update ifttt integration body | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update ifttt integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateIftttIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Arbitrary JSON. | ||||
| 	// If set to true, ChirpStack events will be sent as-is as arbitrary JSON | ||||
| 	// payload. If set to false (default), the 3 JSON values format will be used. | ||||
| 	ArbitraryJSON bool `json:"arbitraryJson,omitempty"` | ||||
|  | ||||
| 	// Event prefix. | ||||
| 	// If set, the event name will be PREFIX_EVENT. For example if event_prefix | ||||
| 	// is set to weatherstation, and uplink event will be sent as | ||||
| 	// weatherstation_up to the IFTTT webhook. | ||||
| 	// Note: Only characters in the A-Z, a-z and 0-9 range are allowed. | ||||
| 	EventPrefix string `json:"eventPrefix,omitempty"` | ||||
|  | ||||
| 	// Key. | ||||
| 	// This key can be obtained from the IFTTT Webhooks documentation page. | ||||
| 	Key string `json:"key,omitempty"` | ||||
|  | ||||
| 	// Values. | ||||
| 	// Up to 2 values can be forwarded to IFTTT. These values must map to the | ||||
| 	// decoded payload keys. For example: | ||||
| 	// { | ||||
| 	//   "batteryLevel": 75.3, | ||||
| 	//   "buttons": [{"pressed": false}, {"pressed": true}] | ||||
| 	// } | ||||
| 	// You would specify the following fields: | ||||
| 	// uplink_values = ["batteryLevel", "buttons_0_pressed"] | ||||
| 	UplinkValues []string `json:"uplinkValues"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update ifttt integration params body integration | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service update ifttt integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateIftttIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateInfluxDbIntegrationParams creates a new ApplicationServiceUpdateInfluxDbIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateInfluxDbIntegrationParams() *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateInfluxDbIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateInfluxDbIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateInfluxDbIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateInfluxDbIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateInfluxDbIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateInfluxDbIntegrationParamsWithContext creates a new ApplicationServiceUpdateInfluxDbIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateInfluxDbIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateInfluxDbIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateInfluxDbIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateInfluxDbIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateInfluxDbIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateInfluxDbIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateInfluxDbIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update influx db integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateInfluxDbIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateInfluxDbIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WithDefaults() *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update influx db integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WithBody(body ApplicationServiceUpdateInfluxDbIntegrationBody) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) SetBody(body ApplicationServiceUpdateInfluxDbIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateInfluxDbIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update influx db integration params | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,455 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateInfluxDbIntegrationReader is a Reader for the ApplicationServiceUpdateInfluxDbIntegration structure. | ||||
| type ApplicationServiceUpdateInfluxDbIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateInfluxDbIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateInfluxDbIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateInfluxDbIntegrationOK creates a ApplicationServiceUpdateInfluxDbIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateInfluxDbIntegrationOK() *ApplicationServiceUpdateInfluxDbIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateInfluxDbIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateInfluxDbIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateInfluxDbIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update influx db integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update influx db integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update influx db integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update influx db integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update influx db integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update influx db integration o k response | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/influxdb][%d] applicationServiceUpdateInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/influxdb][%d] applicationServiceUpdateInfluxDbIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateInfluxDbIntegrationDefault creates a ApplicationServiceUpdateInfluxDbIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateInfluxDbIntegrationDefault(code int) *ApplicationServiceUpdateInfluxDbIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateInfluxDbIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateInfluxDbIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateInfluxDbIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update influx db integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update influx db integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update influx db integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update influx db integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update influx db integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update influx db integration default response | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/influxdb][%d] ApplicationService_UpdateInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/influxdb][%d] ApplicationService_UpdateInfluxDbIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateInfluxDbIntegrationBody application service update influx db integration body | ||||
| swagger:model ApplicationServiceUpdateInfluxDbIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateInfluxDbIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update influx db integration body | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update influx db integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateInfluxDbIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Bucket. (InfluxDb v2) | ||||
| 	Bucket string `json:"bucket,omitempty"` | ||||
|  | ||||
| 	// InfluxDb database name. (InfluxDb v1) | ||||
| 	Db string `json:"db,omitempty"` | ||||
|  | ||||
| 	// InfluxDb API write endpoint (e.g. http://localhost:8086/write). | ||||
| 	Endpoint string `json:"endpoint,omitempty"` | ||||
|  | ||||
| 	// Organization. (InfluxDb v2) | ||||
| 	Organization string `json:"organization,omitempty"` | ||||
|  | ||||
| 	// InfluxDb password. (InfluxDb v1) | ||||
| 	Password string `json:"password,omitempty"` | ||||
|  | ||||
| 	// InfluxDb timestamp precision (InfluxDb v1). | ||||
| 	Precision *models.APIInfluxDbPrecision `json:"precision,omitempty"` | ||||
|  | ||||
| 	// InfluxDb retention policy name. (InfluxDb v1) | ||||
| 	RetentionPolicyName string `json:"retentionPolicyName,omitempty"` | ||||
|  | ||||
| 	// Token. (InfluxDb v2) | ||||
| 	Token string `json:"token,omitempty"` | ||||
|  | ||||
| 	// InfluxDb username. (InfluxDb v1) | ||||
| 	Username string `json:"username,omitempty"` | ||||
|  | ||||
| 	// InfluxDb version. | ||||
| 	Version *models.APIInfluxDbVersion `json:"version,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update influx db integration params body integration | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validatePrecision(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if err := o.validateVersion(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) validatePrecision(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Precision) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Precision != nil { | ||||
| 		if err := o.Precision.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) validateVersion(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Version) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Version != nil { | ||||
| 		if err := o.Version.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update influx db integration params body integration based on the context it is used | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidatePrecision(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if err := o.contextValidateVersion(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) contextValidatePrecision(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Precision != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Precision) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Precision.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "precision") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) contextValidateVersion(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Version != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Version) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Version.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration" + "." + "version") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateInfluxDbIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateMyDevicesIntegrationParams creates a new ApplicationServiceUpdateMyDevicesIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateMyDevicesIntegrationParams() *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateMyDevicesIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateMyDevicesIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateMyDevicesIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateMyDevicesIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateMyDevicesIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateMyDevicesIntegrationParamsWithContext creates a new ApplicationServiceUpdateMyDevicesIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateMyDevicesIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateMyDevicesIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateMyDevicesIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateMyDevicesIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateMyDevicesIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateMyDevicesIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateMyDevicesIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update my devices integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateMyDevicesIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateMyDevicesIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WithDefaults() *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update my devices integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WithBody(body ApplicationServiceUpdateMyDevicesIntegrationBody) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) SetBody(body ApplicationServiceUpdateMyDevicesIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateMyDevicesIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update my devices integration params | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,322 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateMyDevicesIntegrationReader is a Reader for the ApplicationServiceUpdateMyDevicesIntegration structure. | ||||
| type ApplicationServiceUpdateMyDevicesIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateMyDevicesIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateMyDevicesIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateMyDevicesIntegrationOK creates a ApplicationServiceUpdateMyDevicesIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateMyDevicesIntegrationOK() *ApplicationServiceUpdateMyDevicesIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateMyDevicesIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateMyDevicesIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateMyDevicesIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update my devices integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update my devices integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update my devices integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update my devices integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update my devices integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update my devices integration o k response | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/mydevices][%d] applicationServiceUpdateMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/mydevices][%d] applicationServiceUpdateMyDevicesIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateMyDevicesIntegrationDefault creates a ApplicationServiceUpdateMyDevicesIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateMyDevicesIntegrationDefault(code int) *ApplicationServiceUpdateMyDevicesIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateMyDevicesIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateMyDevicesIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateMyDevicesIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update my devices integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update my devices integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update my devices integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update my devices integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update my devices integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update my devices integration default response | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/mydevices][%d] ApplicationService_UpdateMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/mydevices][%d] ApplicationService_UpdateMyDevicesIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateMyDevicesIntegrationBody application service update my devices integration body | ||||
| swagger:model ApplicationServiceUpdateMyDevicesIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateMyDevicesIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update my devices integration body | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update my devices integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateMyDevicesIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// myDevices API endpoint. | ||||
| 	Endpoint string `json:"endpoint,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update my devices integration params body integration | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service update my devices integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateMyDevicesIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,169 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateParams creates a new ApplicationServiceUpdateParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateParams() *ApplicationServiceUpdateParams { | ||||
| 	return &ApplicationServiceUpdateParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateParamsWithTimeout creates a new ApplicationServiceUpdateParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateParams { | ||||
| 	return &ApplicationServiceUpdateParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateParamsWithContext creates a new ApplicationServiceUpdateParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateParamsWithContext(ctx context.Context) *ApplicationServiceUpdateParams { | ||||
| 	return &ApplicationServiceUpdateParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateParamsWithHTTPClient creates a new ApplicationServiceUpdateParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateParams { | ||||
| 	return &ApplicationServiceUpdateParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateParams struct { | ||||
|  | ||||
| 	/* ApplicationID. | ||||
|  | ||||
| 	     Application ID (UUID). | ||||
| 	Note: on create this will be automatically generated. | ||||
| 	*/ | ||||
| 	ApplicationID string | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateBody | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateParams) WithDefaults() *ApplicationServiceUpdateParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) WithContext(ctx context.Context) *ApplicationServiceUpdateParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithApplicationID adds the applicationID to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) WithApplicationID(applicationID string) *ApplicationServiceUpdateParams { | ||||
| 	o.SetApplicationID(applicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetApplicationID adds the applicationId to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) SetApplicationID(applicationID string) { | ||||
| 	o.ApplicationID = applicationID | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) WithBody(body ApplicationServiceUpdateBody) *ApplicationServiceUpdateParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update params | ||||
| func (o *ApplicationServiceUpdateParams) SetBody(body ApplicationServiceUpdateBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param application.id | ||||
| 	if err := r.SetPathParam("application.id", o.ApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdatePilotThingsIntegrationParams creates a new ApplicationServiceUpdatePilotThingsIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdatePilotThingsIntegrationParams() *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdatePilotThingsIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdatePilotThingsIntegrationParamsWithTimeout creates a new ApplicationServiceUpdatePilotThingsIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdatePilotThingsIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdatePilotThingsIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdatePilotThingsIntegrationParamsWithContext creates a new ApplicationServiceUpdatePilotThingsIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdatePilotThingsIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdatePilotThingsIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdatePilotThingsIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdatePilotThingsIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdatePilotThingsIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	return &ApplicationServiceUpdatePilotThingsIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdatePilotThingsIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update pilot things integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdatePilotThingsIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdatePilotThingsIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WithDefaults() *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update pilot things integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WithBody(body ApplicationServiceUpdatePilotThingsIntegrationBody) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) SetBody(body ApplicationServiceUpdatePilotThingsIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdatePilotThingsIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update pilot things integration params | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,325 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdatePilotThingsIntegrationReader is a Reader for the ApplicationServiceUpdatePilotThingsIntegration structure. | ||||
| type ApplicationServiceUpdatePilotThingsIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdatePilotThingsIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdatePilotThingsIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdatePilotThingsIntegrationOK creates a ApplicationServiceUpdatePilotThingsIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdatePilotThingsIntegrationOK() *ApplicationServiceUpdatePilotThingsIntegrationOK { | ||||
| 	return &ApplicationServiceUpdatePilotThingsIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdatePilotThingsIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdatePilotThingsIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update pilot things integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update pilot things integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update pilot things integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update pilot things integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update pilot things integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update pilot things integration o k response | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/pilot-things][%d] applicationServiceUpdatePilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/pilot-things][%d] applicationServiceUpdatePilotThingsIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdatePilotThingsIntegrationDefault creates a ApplicationServiceUpdatePilotThingsIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdatePilotThingsIntegrationDefault(code int) *ApplicationServiceUpdatePilotThingsIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdatePilotThingsIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdatePilotThingsIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdatePilotThingsIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update pilot things integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update pilot things integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update pilot things integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update pilot things integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update pilot things integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update pilot things integration default response | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/pilot-things][%d] ApplicationService_UpdatePilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/pilot-things][%d] ApplicationService_UpdatePilotThingsIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdatePilotThingsIntegrationBody application service update pilot things integration body | ||||
| swagger:model ApplicationServiceUpdatePilotThingsIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdatePilotThingsIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update pilot things integration body | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update pilot things integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdatePilotThingsIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// Server URL. | ||||
| 	Server string `json:"server,omitempty"` | ||||
|  | ||||
| 	// Authentication token. | ||||
| 	Token string `json:"token,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update pilot things integration params body integration | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service update pilot things integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdatePilotThingsIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,334 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateReader is a Reader for the ApplicationServiceUpdate structure. | ||||
| type ApplicationServiceUpdateReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateOK creates a ApplicationServiceUpdateOK with default headers values | ||||
| func NewApplicationServiceUpdateOK() *ApplicationServiceUpdateOK { | ||||
| 	return &ApplicationServiceUpdateOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update o k response | ||||
| func (o *ApplicationServiceUpdateOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{application.id}][%d] applicationServiceUpdateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{application.id}][%d] applicationServiceUpdateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateDefault creates a ApplicationServiceUpdateDefault with default headers values | ||||
| func NewApplicationServiceUpdateDefault(code int) *ApplicationServiceUpdateDefault { | ||||
| 	return &ApplicationServiceUpdateDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update default response | ||||
| func (o *ApplicationServiceUpdateDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{application.id}][%d] ApplicationService_Update default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{application.id}][%d] ApplicationService_Update default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateBody application service update body | ||||
| swagger:model ApplicationServiceUpdateBody | ||||
| */ | ||||
| type ApplicationServiceUpdateBody struct { | ||||
|  | ||||
| 	// application | ||||
| 	Application *ApplicationServiceUpdateParamsBodyApplication `json:"application,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update body | ||||
| func (o *ApplicationServiceUpdateBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateApplication(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateBody) validateApplication(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Application) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Application != nil { | ||||
| 		if err := o.Application.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "application") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "application") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateApplication(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateBody) contextValidateApplication(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Application != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Application) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Application.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "application") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "application") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateParamsBodyApplication Application object. | ||||
| swagger:model ApplicationServiceUpdateParamsBodyApplication | ||||
| */ | ||||
| type ApplicationServiceUpdateParamsBodyApplication struct { | ||||
|  | ||||
| 	// Application description. | ||||
| 	Description string `json:"description,omitempty"` | ||||
|  | ||||
| 	// Application name. | ||||
| 	Name string `json:"name,omitempty"` | ||||
|  | ||||
| 	// Tags (user defined). | ||||
| 	// These tags can be used to add additional information to the application. | ||||
| 	// These tags are exposed in all the integration events of devices under | ||||
| 	// this application. | ||||
| 	Tags map[string]string `json:"tags,omitempty"` | ||||
|  | ||||
| 	// Tenant ID (UUID). | ||||
| 	TenantID string `json:"tenantId,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update params body application | ||||
| func (o *ApplicationServiceUpdateParamsBodyApplication) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service update params body application based on context it is used | ||||
| func (o *ApplicationServiceUpdateParamsBodyApplication) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateParamsBodyApplication) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateParamsBodyApplication) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateParamsBodyApplication | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,168 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewApplicationServiceUpdateThingsBoardIntegrationParams creates a new ApplicationServiceUpdateThingsBoardIntegrationParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewApplicationServiceUpdateThingsBoardIntegrationParams() *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateThingsBoardIntegrationParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateThingsBoardIntegrationParamsWithTimeout creates a new ApplicationServiceUpdateThingsBoardIntegrationParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewApplicationServiceUpdateThingsBoardIntegrationParamsWithTimeout(timeout time.Duration) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateThingsBoardIntegrationParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateThingsBoardIntegrationParamsWithContext creates a new ApplicationServiceUpdateThingsBoardIntegrationParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewApplicationServiceUpdateThingsBoardIntegrationParamsWithContext(ctx context.Context) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateThingsBoardIntegrationParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateThingsBoardIntegrationParamsWithHTTPClient creates a new ApplicationServiceUpdateThingsBoardIntegrationParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewApplicationServiceUpdateThingsBoardIntegrationParamsWithHTTPClient(client *http.Client) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	return &ApplicationServiceUpdateThingsBoardIntegrationParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateThingsBoardIntegrationParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the application service update things board integration operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type ApplicationServiceUpdateThingsBoardIntegrationParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body ApplicationServiceUpdateThingsBoardIntegrationBody | ||||
|  | ||||
| 	/* IntegrationApplicationID. | ||||
|  | ||||
| 	   Application ID (UUID). | ||||
| 	*/ | ||||
| 	IntegrationApplicationID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the application service update things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WithDefaults() *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the application service update things board integration params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WithTimeout(timeout time.Duration) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WithContext(ctx context.Context) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WithHTTPClient(client *http.Client) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WithBody(body ApplicationServiceUpdateThingsBoardIntegrationBody) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) SetBody(body ApplicationServiceUpdateThingsBoardIntegrationBody) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WithIntegrationApplicationID adds the integrationApplicationID to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WithIntegrationApplicationID(integrationApplicationID string) *ApplicationServiceUpdateThingsBoardIntegrationParams { | ||||
| 	o.SetIntegrationApplicationID(integrationApplicationID) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetIntegrationApplicationID adds the integrationApplicationId to the application service update things board integration params | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) SetIntegrationApplicationID(integrationApplicationID string) { | ||||
| 	o.IntegrationApplicationID = integrationApplicationID | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// path param integration.applicationId | ||||
| 	if err := r.SetPathParam("integration.applicationId", o.IntegrationApplicationID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,322 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package application_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| 	"github.com/go-openapi/swag" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // ApplicationServiceUpdateThingsBoardIntegrationReader is a Reader for the ApplicationServiceUpdateThingsBoardIntegration structure. | ||||
| type ApplicationServiceUpdateThingsBoardIntegrationReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewApplicationServiceUpdateThingsBoardIntegrationOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewApplicationServiceUpdateThingsBoardIntegrationDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateThingsBoardIntegrationOK creates a ApplicationServiceUpdateThingsBoardIntegrationOK with default headers values | ||||
| func NewApplicationServiceUpdateThingsBoardIntegrationOK() *ApplicationServiceUpdateThingsBoardIntegrationOK { | ||||
| 	return &ApplicationServiceUpdateThingsBoardIntegrationOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateThingsBoardIntegrationOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type ApplicationServiceUpdateThingsBoardIntegrationOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update things board integration o k response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update things board integration o k response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update things board integration o k response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update things board integration o k response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update things board integration o k response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update things board integration o k response | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/thingsboard][%d] applicationServiceUpdateThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/thingsboard][%d] applicationServiceUpdateThingsBoardIntegrationOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewApplicationServiceUpdateThingsBoardIntegrationDefault creates a ApplicationServiceUpdateThingsBoardIntegrationDefault with default headers values | ||||
| func NewApplicationServiceUpdateThingsBoardIntegrationDefault(code int) *ApplicationServiceUpdateThingsBoardIntegrationDefault { | ||||
| 	return &ApplicationServiceUpdateThingsBoardIntegrationDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateThingsBoardIntegrationDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type ApplicationServiceUpdateThingsBoardIntegrationDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this application service update things board integration default response has a 2xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this application service update things board integration default response has a 3xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this application service update things board integration default response has a 4xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this application service update things board integration default response has a 5xx status code | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this application service update things board integration default response a status code equal to that given | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the application service update things board integration default response | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/thingsboard][%d] ApplicationService_UpdateThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[PUT /api/applications/{integration.applicationId}/integrations/thingsboard][%d] ApplicationService_UpdateThingsBoardIntegration default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateThingsBoardIntegrationBody application service update things board integration body | ||||
| swagger:model ApplicationServiceUpdateThingsBoardIntegrationBody | ||||
| */ | ||||
| type ApplicationServiceUpdateThingsBoardIntegrationBody struct { | ||||
|  | ||||
| 	// integration | ||||
| 	Integration *ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration `json:"integration,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update things board integration body | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationBody) Validate(formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.validateIntegration(formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationBody) validateIntegration(formats strfmt.Registry) error { | ||||
| 	if swag.IsZero(o.Integration) { // not required | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
| 		if err := o.Integration.Validate(formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validate this application service update things board integration body based on the context it is used | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	var res []error | ||||
|  | ||||
| 	if err := o.contextValidateIntegration(ctx, formats); err != nil { | ||||
| 		res = append(res, err) | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationBody) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error { | ||||
|  | ||||
| 	if o.Integration != nil { | ||||
|  | ||||
| 		if swag.IsZero(o.Integration) { // not required | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if err := o.Integration.ContextValidate(ctx, formats); err != nil { | ||||
| 			if ve, ok := err.(*errors.Validation); ok { | ||||
| 				return ve.ValidateName("body" + "." + "integration") | ||||
| 			} else if ce, ok := err.(*errors.CompositeError); ok { | ||||
| 				return ce.ValidateName("body" + "." + "integration") | ||||
| 			} | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationBody) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationBody) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateThingsBoardIntegrationBody | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| /* | ||||
| ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration Integration object to update. | ||||
| swagger:model ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration | ||||
| */ | ||||
| type ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration struct { | ||||
|  | ||||
| 	// ThingsBoard server endpoint, e.g. https://example.com | ||||
| 	Server string `json:"server,omitempty"` | ||||
| } | ||||
|  | ||||
| // Validate validates this application service update things board integration params body integration | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration) Validate(formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // ContextValidate validates this application service update things board integration params body integration based on context it is used | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // MarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration) MarshalBinary() ([]byte, error) { | ||||
| 	if o == nil { | ||||
| 		return nil, nil | ||||
| 	} | ||||
| 	return swag.WriteJSON(o) | ||||
| } | ||||
|  | ||||
| // UnmarshalBinary interface implementation | ||||
| func (o *ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration) UnmarshalBinary(b []byte) error { | ||||
| 	var res ApplicationServiceUpdateThingsBoardIntegrationParamsBodyIntegration | ||||
| 	if err := swag.ReadJSON(b, &res); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	*o = res | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,147 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package client | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	httptransport "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/application_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/device_profile_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/device_profile_template_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/device_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/gateway_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/multicast_group_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/tenant_service" | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/client/user_service" | ||||
| ) | ||||
|  | ||||
| // Default chirp stack r e s t API HTTP client. | ||||
| var Default = NewHTTPClient(nil) | ||||
|  | ||||
| const ( | ||||
| 	// DefaultHost is the default Host | ||||
| 	// found in Meta (info) section of spec file | ||||
| 	DefaultHost string = "localhost" | ||||
| 	// DefaultBasePath is the default BasePath | ||||
| 	// found in Meta (info) section of spec file | ||||
| 	DefaultBasePath string = "/" | ||||
| ) | ||||
|  | ||||
| // DefaultSchemes are the default schemes found in Meta (info) section of spec file | ||||
| var DefaultSchemes = []string{"http", "https"} | ||||
|  | ||||
| // NewHTTPClient creates a new chirp stack r e s t API HTTP client. | ||||
| func NewHTTPClient(formats strfmt.Registry) *ChirpStackRESTAPI { | ||||
| 	return NewHTTPClientWithConfig(formats, nil) | ||||
| } | ||||
|  | ||||
| // NewHTTPClientWithConfig creates a new chirp stack r e s t API HTTP client, | ||||
| // using a customizable transport config. | ||||
| func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ChirpStackRESTAPI { | ||||
| 	// ensure nullable parameters have default | ||||
| 	if cfg == nil { | ||||
| 		cfg = DefaultTransportConfig() | ||||
| 	} | ||||
|  | ||||
| 	// create transport and client | ||||
| 	transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) | ||||
| 	return New(transport, formats) | ||||
| } | ||||
|  | ||||
| // New creates a new chirp stack r e s t API client | ||||
| func New(transport runtime.ClientTransport, formats strfmt.Registry) *ChirpStackRESTAPI { | ||||
| 	// ensure nullable parameters have default | ||||
| 	if formats == nil { | ||||
| 		formats = strfmt.Default | ||||
| 	} | ||||
|  | ||||
| 	cli := new(ChirpStackRESTAPI) | ||||
| 	cli.Transport = transport | ||||
| 	cli.ApplicationService = application_service.New(transport, formats) | ||||
| 	cli.DeviceProfileService = device_profile_service.New(transport, formats) | ||||
| 	cli.DeviceProfileTemplateService = device_profile_template_service.New(transport, formats) | ||||
| 	cli.DeviceService = device_service.New(transport, formats) | ||||
| 	cli.GatewayService = gateway_service.New(transport, formats) | ||||
| 	cli.MulticastGroupService = multicast_group_service.New(transport, formats) | ||||
| 	cli.TenantService = tenant_service.New(transport, formats) | ||||
| 	cli.UserService = user_service.New(transport, formats) | ||||
| 	return cli | ||||
| } | ||||
|  | ||||
| // DefaultTransportConfig creates a TransportConfig with the | ||||
| // default settings taken from the meta section of the spec file. | ||||
| func DefaultTransportConfig() *TransportConfig { | ||||
| 	return &TransportConfig{ | ||||
| 		Host:     DefaultHost, | ||||
| 		BasePath: DefaultBasePath, | ||||
| 		Schemes:  DefaultSchemes, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // TransportConfig contains the transport related info, | ||||
| // found in the meta section of the spec file. | ||||
| type TransportConfig struct { | ||||
| 	Host     string | ||||
| 	BasePath string | ||||
| 	Schemes  []string | ||||
| } | ||||
|  | ||||
| // WithHost overrides the default host, | ||||
| // provided by the meta section of the spec file. | ||||
| func (cfg *TransportConfig) WithHost(host string) *TransportConfig { | ||||
| 	cfg.Host = host | ||||
| 	return cfg | ||||
| } | ||||
|  | ||||
| // WithBasePath overrides the default basePath, | ||||
| // provided by the meta section of the spec file. | ||||
| func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { | ||||
| 	cfg.BasePath = basePath | ||||
| 	return cfg | ||||
| } | ||||
|  | ||||
| // WithSchemes overrides the default schemes, | ||||
| // provided by the meta section of the spec file. | ||||
| func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { | ||||
| 	cfg.Schemes = schemes | ||||
| 	return cfg | ||||
| } | ||||
|  | ||||
| // ChirpStackRESTAPI is a client for chirp stack r e s t API | ||||
| type ChirpStackRESTAPI struct { | ||||
| 	ApplicationService application_service.ClientService | ||||
|  | ||||
| 	DeviceProfileService device_profile_service.ClientService | ||||
|  | ||||
| 	DeviceProfileTemplateService device_profile_template_service.ClientService | ||||
|  | ||||
| 	DeviceService device_service.ClientService | ||||
|  | ||||
| 	GatewayService gateway_service.ClientService | ||||
|  | ||||
| 	MulticastGroupService multicast_group_service.ClientService | ||||
|  | ||||
| 	TenantService tenant_service.ClientService | ||||
|  | ||||
| 	UserService user_service.ClientService | ||||
|  | ||||
| 	Transport runtime.ClientTransport | ||||
| } | ||||
|  | ||||
| // SetTransport changes the transport on the client and all its subresources | ||||
| func (c *ChirpStackRESTAPI) SetTransport(transport runtime.ClientTransport) { | ||||
| 	c.Transport = transport | ||||
| 	c.ApplicationService.SetTransport(transport) | ||||
| 	c.DeviceProfileService.SetTransport(transport) | ||||
| 	c.DeviceProfileTemplateService.SetTransport(transport) | ||||
| 	c.DeviceService.SetTransport(transport) | ||||
| 	c.GatewayService.SetTransport(transport) | ||||
| 	c.MulticastGroupService.SetTransport(transport) | ||||
| 	c.TenantService.SetTransport(transport) | ||||
| 	c.UserService.SetTransport(transport) | ||||
| } | ||||
| @@ -0,0 +1,303 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	httptransport "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // New creates a new device profile service API client. | ||||
| func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { | ||||
| 	return &Client{transport: transport, formats: formats} | ||||
| } | ||||
|  | ||||
| // New creates a new device profile service API client with basic auth credentials. | ||||
| // It takes the following parameters: | ||||
| // - host: http host (github.com). | ||||
| // - basePath: any base path for the API client ("/v1", "/v3"). | ||||
| // - scheme: http scheme ("http", "https"). | ||||
| // - user: user for basic authentication header. | ||||
| // - password: password for basic authentication header. | ||||
| func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { | ||||
| 	transport := httptransport.New(host, basePath, []string{scheme}) | ||||
| 	transport.DefaultAuthentication = httptransport.BasicAuth(user, password) | ||||
| 	return &Client{transport: transport, formats: strfmt.Default} | ||||
| } | ||||
|  | ||||
| // New creates a new device profile service API client with a bearer token for authentication. | ||||
| // It takes the following parameters: | ||||
| // - host: http host (github.com). | ||||
| // - basePath: any base path for the API client ("/v1", "/v3"). | ||||
| // - scheme: http scheme ("http", "https"). | ||||
| // - bearerToken: bearer token for Bearer authentication header. | ||||
| func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { | ||||
| 	transport := httptransport.New(host, basePath, []string{scheme}) | ||||
| 	transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) | ||||
| 	return &Client{transport: transport, formats: strfmt.Default} | ||||
| } | ||||
|  | ||||
| /* | ||||
| Client for device profile service API | ||||
| */ | ||||
| type Client struct { | ||||
| 	transport runtime.ClientTransport | ||||
| 	formats   strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ClientOption may be used to customize the behavior of Client methods. | ||||
| type ClientOption func(*runtime.ClientOperation) | ||||
|  | ||||
| // ClientService is the interface for Client methods | ||||
| type ClientService interface { | ||||
| 	DeviceProfileServiceCreate(params *DeviceProfileServiceCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceCreateOK, error) | ||||
|  | ||||
| 	DeviceProfileServiceDelete(params *DeviceProfileServiceDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceDeleteOK, error) | ||||
|  | ||||
| 	DeviceProfileServiceGet(params *DeviceProfileServiceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceGetOK, error) | ||||
|  | ||||
| 	DeviceProfileServiceList(params *DeviceProfileServiceListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceListOK, error) | ||||
|  | ||||
| 	DeviceProfileServiceListAdrAlgorithms(params *DeviceProfileServiceListAdrAlgorithmsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceListAdrAlgorithmsOK, error) | ||||
|  | ||||
| 	DeviceProfileServiceUpdate(params *DeviceProfileServiceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceUpdateOK, error) | ||||
|  | ||||
| 	SetTransport(transport runtime.ClientTransport) | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceCreate creates the given device profile | ||||
| */ | ||||
| func (a *Client) DeviceProfileServiceCreate(params *DeviceProfileServiceCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceCreateOK, error) { | ||||
| 	// TODO: Validate the params before sending | ||||
| 	if params == nil { | ||||
| 		params = NewDeviceProfileServiceCreateParams() | ||||
| 	} | ||||
| 	op := &runtime.ClientOperation{ | ||||
| 		ID:                 "DeviceProfileService_Create", | ||||
| 		Method:             "POST", | ||||
| 		PathPattern:        "/api/device-profiles", | ||||
| 		ProducesMediaTypes: []string{"application/json"}, | ||||
| 		ConsumesMediaTypes: []string{"application/json"}, | ||||
| 		Schemes:            []string{"http", "https"}, | ||||
| 		Params:             params, | ||||
| 		Reader:             &DeviceProfileServiceCreateReader{formats: a.formats}, | ||||
| 		AuthInfo:           authInfo, | ||||
| 		Context:            params.Context, | ||||
| 		Client:             params.HTTPClient, | ||||
| 	} | ||||
| 	for _, opt := range opts { | ||||
| 		opt(op) | ||||
| 	} | ||||
|  | ||||
| 	result, err := a.transport.Submit(op) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	success, ok := result.(*DeviceProfileServiceCreateOK) | ||||
| 	if ok { | ||||
| 		return success, nil | ||||
| 	} | ||||
| 	// unexpected success response | ||||
| 	unexpectedSuccess := result.(*DeviceProfileServiceCreateDefault) | ||||
| 	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceDelete deletes the device profile with the given ID | ||||
| */ | ||||
| func (a *Client) DeviceProfileServiceDelete(params *DeviceProfileServiceDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceDeleteOK, error) { | ||||
| 	// TODO: Validate the params before sending | ||||
| 	if params == nil { | ||||
| 		params = NewDeviceProfileServiceDeleteParams() | ||||
| 	} | ||||
| 	op := &runtime.ClientOperation{ | ||||
| 		ID:                 "DeviceProfileService_Delete", | ||||
| 		Method:             "DELETE", | ||||
| 		PathPattern:        "/api/device-profiles/{id}", | ||||
| 		ProducesMediaTypes: []string{"application/json"}, | ||||
| 		ConsumesMediaTypes: []string{"application/json"}, | ||||
| 		Schemes:            []string{"http", "https"}, | ||||
| 		Params:             params, | ||||
| 		Reader:             &DeviceProfileServiceDeleteReader{formats: a.formats}, | ||||
| 		AuthInfo:           authInfo, | ||||
| 		Context:            params.Context, | ||||
| 		Client:             params.HTTPClient, | ||||
| 	} | ||||
| 	for _, opt := range opts { | ||||
| 		opt(op) | ||||
| 	} | ||||
|  | ||||
| 	result, err := a.transport.Submit(op) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	success, ok := result.(*DeviceProfileServiceDeleteOK) | ||||
| 	if ok { | ||||
| 		return success, nil | ||||
| 	} | ||||
| 	// unexpected success response | ||||
| 	unexpectedSuccess := result.(*DeviceProfileServiceDeleteDefault) | ||||
| 	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceGet gets the device profile for the given ID | ||||
| */ | ||||
| func (a *Client) DeviceProfileServiceGet(params *DeviceProfileServiceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceGetOK, error) { | ||||
| 	// TODO: Validate the params before sending | ||||
| 	if params == nil { | ||||
| 		params = NewDeviceProfileServiceGetParams() | ||||
| 	} | ||||
| 	op := &runtime.ClientOperation{ | ||||
| 		ID:                 "DeviceProfileService_Get", | ||||
| 		Method:             "GET", | ||||
| 		PathPattern:        "/api/device-profiles/{id}", | ||||
| 		ProducesMediaTypes: []string{"application/json"}, | ||||
| 		ConsumesMediaTypes: []string{"application/json"}, | ||||
| 		Schemes:            []string{"http", "https"}, | ||||
| 		Params:             params, | ||||
| 		Reader:             &DeviceProfileServiceGetReader{formats: a.formats}, | ||||
| 		AuthInfo:           authInfo, | ||||
| 		Context:            params.Context, | ||||
| 		Client:             params.HTTPClient, | ||||
| 	} | ||||
| 	for _, opt := range opts { | ||||
| 		opt(op) | ||||
| 	} | ||||
|  | ||||
| 	result, err := a.transport.Submit(op) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	success, ok := result.(*DeviceProfileServiceGetOK) | ||||
| 	if ok { | ||||
| 		return success, nil | ||||
| 	} | ||||
| 	// unexpected success response | ||||
| 	unexpectedSuccess := result.(*DeviceProfileServiceGetDefault) | ||||
| 	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceList lists the available device profiles | ||||
| */ | ||||
| func (a *Client) DeviceProfileServiceList(params *DeviceProfileServiceListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceListOK, error) { | ||||
| 	// TODO: Validate the params before sending | ||||
| 	if params == nil { | ||||
| 		params = NewDeviceProfileServiceListParams() | ||||
| 	} | ||||
| 	op := &runtime.ClientOperation{ | ||||
| 		ID:                 "DeviceProfileService_List", | ||||
| 		Method:             "GET", | ||||
| 		PathPattern:        "/api/device-profiles", | ||||
| 		ProducesMediaTypes: []string{"application/json"}, | ||||
| 		ConsumesMediaTypes: []string{"application/json"}, | ||||
| 		Schemes:            []string{"http", "https"}, | ||||
| 		Params:             params, | ||||
| 		Reader:             &DeviceProfileServiceListReader{formats: a.formats}, | ||||
| 		AuthInfo:           authInfo, | ||||
| 		Context:            params.Context, | ||||
| 		Client:             params.HTTPClient, | ||||
| 	} | ||||
| 	for _, opt := range opts { | ||||
| 		opt(op) | ||||
| 	} | ||||
|  | ||||
| 	result, err := a.transport.Submit(op) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	success, ok := result.(*DeviceProfileServiceListOK) | ||||
| 	if ok { | ||||
| 		return success, nil | ||||
| 	} | ||||
| 	// unexpected success response | ||||
| 	unexpectedSuccess := result.(*DeviceProfileServiceListDefault) | ||||
| 	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceListAdrAlgorithms lists available a d r algorithms | ||||
| */ | ||||
| func (a *Client) DeviceProfileServiceListAdrAlgorithms(params *DeviceProfileServiceListAdrAlgorithmsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceListAdrAlgorithmsOK, error) { | ||||
| 	// TODO: Validate the params before sending | ||||
| 	if params == nil { | ||||
| 		params = NewDeviceProfileServiceListAdrAlgorithmsParams() | ||||
| 	} | ||||
| 	op := &runtime.ClientOperation{ | ||||
| 		ID:                 "DeviceProfileService_ListAdrAlgorithms", | ||||
| 		Method:             "GET", | ||||
| 		PathPattern:        "/api/device-profiles/adr-algorithms", | ||||
| 		ProducesMediaTypes: []string{"application/json"}, | ||||
| 		ConsumesMediaTypes: []string{"application/json"}, | ||||
| 		Schemes:            []string{"http", "https"}, | ||||
| 		Params:             params, | ||||
| 		Reader:             &DeviceProfileServiceListAdrAlgorithmsReader{formats: a.formats}, | ||||
| 		AuthInfo:           authInfo, | ||||
| 		Context:            params.Context, | ||||
| 		Client:             params.HTTPClient, | ||||
| 	} | ||||
| 	for _, opt := range opts { | ||||
| 		opt(op) | ||||
| 	} | ||||
|  | ||||
| 	result, err := a.transport.Submit(op) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	success, ok := result.(*DeviceProfileServiceListAdrAlgorithmsOK) | ||||
| 	if ok { | ||||
| 		return success, nil | ||||
| 	} | ||||
| 	// unexpected success response | ||||
| 	unexpectedSuccess := result.(*DeviceProfileServiceListAdrAlgorithmsDefault) | ||||
| 	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceUpdate updates the given device profile | ||||
| */ | ||||
| func (a *Client) DeviceProfileServiceUpdate(params *DeviceProfileServiceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeviceProfileServiceUpdateOK, error) { | ||||
| 	// TODO: Validate the params before sending | ||||
| 	if params == nil { | ||||
| 		params = NewDeviceProfileServiceUpdateParams() | ||||
| 	} | ||||
| 	op := &runtime.ClientOperation{ | ||||
| 		ID:                 "DeviceProfileService_Update", | ||||
| 		Method:             "PUT", | ||||
| 		PathPattern:        "/api/device-profiles/{deviceProfile.id}", | ||||
| 		ProducesMediaTypes: []string{"application/json"}, | ||||
| 		ConsumesMediaTypes: []string{"application/json"}, | ||||
| 		Schemes:            []string{"http", "https"}, | ||||
| 		Params:             params, | ||||
| 		Reader:             &DeviceProfileServiceUpdateReader{formats: a.formats}, | ||||
| 		AuthInfo:           authInfo, | ||||
| 		Context:            params.Context, | ||||
| 		Client:             params.HTTPClient, | ||||
| 	} | ||||
| 	for _, opt := range opts { | ||||
| 		opt(op) | ||||
| 	} | ||||
|  | ||||
| 	result, err := a.transport.Submit(op) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	success, ok := result.(*DeviceProfileServiceUpdateOK) | ||||
| 	if ok { | ||||
| 		return success, nil | ||||
| 	} | ||||
| 	// unexpected success response | ||||
| 	unexpectedSuccess := result.(*DeviceProfileServiceUpdateDefault) | ||||
| 	return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) | ||||
| } | ||||
|  | ||||
| // SetTransport changes the transport on the client | ||||
| func (a *Client) SetTransport(transport runtime.ClientTransport) { | ||||
| 	a.transport = transport | ||||
| } | ||||
| @@ -0,0 +1,150 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // NewDeviceProfileServiceCreateParams creates a new DeviceProfileServiceCreateParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewDeviceProfileServiceCreateParams() *DeviceProfileServiceCreateParams { | ||||
| 	return &DeviceProfileServiceCreateParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceCreateParamsWithTimeout creates a new DeviceProfileServiceCreateParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewDeviceProfileServiceCreateParamsWithTimeout(timeout time.Duration) *DeviceProfileServiceCreateParams { | ||||
| 	return &DeviceProfileServiceCreateParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceCreateParamsWithContext creates a new DeviceProfileServiceCreateParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewDeviceProfileServiceCreateParamsWithContext(ctx context.Context) *DeviceProfileServiceCreateParams { | ||||
| 	return &DeviceProfileServiceCreateParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceCreateParamsWithHTTPClient creates a new DeviceProfileServiceCreateParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewDeviceProfileServiceCreateParamsWithHTTPClient(client *http.Client) *DeviceProfileServiceCreateParams { | ||||
| 	return &DeviceProfileServiceCreateParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceCreateParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the device profile service create operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type DeviceProfileServiceCreateParams struct { | ||||
|  | ||||
| 	// Body. | ||||
| 	Body *models.APICreateDeviceProfileRequest | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the device profile service create params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceCreateParams) WithDefaults() *DeviceProfileServiceCreateParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the device profile service create params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceCreateParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) WithTimeout(timeout time.Duration) *DeviceProfileServiceCreateParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) WithContext(ctx context.Context) *DeviceProfileServiceCreateParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) WithHTTPClient(client *http.Client) *DeviceProfileServiceCreateParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithBody adds the body to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) WithBody(body *models.APICreateDeviceProfileRequest) *DeviceProfileServiceCreateParams { | ||||
| 	o.SetBody(body) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetBody adds the body to the device profile service create params | ||||
| func (o *DeviceProfileServiceCreateParams) SetBody(body *models.APICreateDeviceProfileRequest) { | ||||
| 	o.Body = body | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *DeviceProfileServiceCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
| 	if o.Body != nil { | ||||
| 		if err := r.SetBodyParam(o.Body); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // DeviceProfileServiceCreateReader is a Reader for the DeviceProfileServiceCreate structure. | ||||
| type DeviceProfileServiceCreateReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *DeviceProfileServiceCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewDeviceProfileServiceCreateOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewDeviceProfileServiceCreateDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceCreateOK creates a DeviceProfileServiceCreateOK with default headers values | ||||
| func NewDeviceProfileServiceCreateOK() *DeviceProfileServiceCreateOK { | ||||
| 	return &DeviceProfileServiceCreateOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceCreateOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type DeviceProfileServiceCreateOK struct { | ||||
| 	Payload *models.APICreateDeviceProfileResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this device profile service create o k response has a 2xx status code | ||||
| func (o *DeviceProfileServiceCreateOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this device profile service create o k response has a 3xx status code | ||||
| func (o *DeviceProfileServiceCreateOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this device profile service create o k response has a 4xx status code | ||||
| func (o *DeviceProfileServiceCreateOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this device profile service create o k response has a 5xx status code | ||||
| func (o *DeviceProfileServiceCreateOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this device profile service create o k response a status code equal to that given | ||||
| func (o *DeviceProfileServiceCreateOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the device profile service create o k response | ||||
| func (o *DeviceProfileServiceCreateOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/device-profiles][%d] deviceProfileServiceCreateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/device-profiles][%d] deviceProfileServiceCreateOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateOK) GetPayload() *models.APICreateDeviceProfileResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APICreateDeviceProfileResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceCreateDefault creates a DeviceProfileServiceCreateDefault with default headers values | ||||
| func NewDeviceProfileServiceCreateDefault(code int) *DeviceProfileServiceCreateDefault { | ||||
| 	return &DeviceProfileServiceCreateDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceCreateDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type DeviceProfileServiceCreateDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this device profile service create default response has a 2xx status code | ||||
| func (o *DeviceProfileServiceCreateDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this device profile service create default response has a 3xx status code | ||||
| func (o *DeviceProfileServiceCreateDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this device profile service create default response has a 4xx status code | ||||
| func (o *DeviceProfileServiceCreateDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this device profile service create default response has a 5xx status code | ||||
| func (o *DeviceProfileServiceCreateDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this device profile service create default response a status code equal to that given | ||||
| func (o *DeviceProfileServiceCreateDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the device profile service create default response | ||||
| func (o *DeviceProfileServiceCreateDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/device-profiles][%d] DeviceProfileService_Create default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[POST /api/device-profiles][%d] DeviceProfileService_Create default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceCreateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewDeviceProfileServiceDeleteParams creates a new DeviceProfileServiceDeleteParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewDeviceProfileServiceDeleteParams() *DeviceProfileServiceDeleteParams { | ||||
| 	return &DeviceProfileServiceDeleteParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceDeleteParamsWithTimeout creates a new DeviceProfileServiceDeleteParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewDeviceProfileServiceDeleteParamsWithTimeout(timeout time.Duration) *DeviceProfileServiceDeleteParams { | ||||
| 	return &DeviceProfileServiceDeleteParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceDeleteParamsWithContext creates a new DeviceProfileServiceDeleteParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewDeviceProfileServiceDeleteParamsWithContext(ctx context.Context) *DeviceProfileServiceDeleteParams { | ||||
| 	return &DeviceProfileServiceDeleteParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceDeleteParamsWithHTTPClient creates a new DeviceProfileServiceDeleteParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewDeviceProfileServiceDeleteParamsWithHTTPClient(client *http.Client) *DeviceProfileServiceDeleteParams { | ||||
| 	return &DeviceProfileServiceDeleteParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceDeleteParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the device profile service delete operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type DeviceProfileServiceDeleteParams struct { | ||||
|  | ||||
| 	/* ID. | ||||
|  | ||||
| 	   ID (UUID). | ||||
| 	*/ | ||||
| 	ID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the device profile service delete params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceDeleteParams) WithDefaults() *DeviceProfileServiceDeleteParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the device profile service delete params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceDeleteParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) WithTimeout(timeout time.Duration) *DeviceProfileServiceDeleteParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) WithContext(ctx context.Context) *DeviceProfileServiceDeleteParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) WithHTTPClient(client *http.Client) *DeviceProfileServiceDeleteParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithID adds the id to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) WithID(id string) *DeviceProfileServiceDeleteParams { | ||||
| 	o.SetID(id) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetID adds the id to the device profile service delete params | ||||
| func (o *DeviceProfileServiceDeleteParams) SetID(id string) { | ||||
| 	o.ID = id | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *DeviceProfileServiceDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param id | ||||
| 	if err := r.SetPathParam("id", o.ID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,185 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // DeviceProfileServiceDeleteReader is a Reader for the DeviceProfileServiceDelete structure. | ||||
| type DeviceProfileServiceDeleteReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *DeviceProfileServiceDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewDeviceProfileServiceDeleteOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewDeviceProfileServiceDeleteDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceDeleteOK creates a DeviceProfileServiceDeleteOK with default headers values | ||||
| func NewDeviceProfileServiceDeleteOK() *DeviceProfileServiceDeleteOK { | ||||
| 	return &DeviceProfileServiceDeleteOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceDeleteOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type DeviceProfileServiceDeleteOK struct { | ||||
| 	Payload interface{} | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this device profile service delete o k response has a 2xx status code | ||||
| func (o *DeviceProfileServiceDeleteOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this device profile service delete o k response has a 3xx status code | ||||
| func (o *DeviceProfileServiceDeleteOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this device profile service delete o k response has a 4xx status code | ||||
| func (o *DeviceProfileServiceDeleteOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this device profile service delete o k response has a 5xx status code | ||||
| func (o *DeviceProfileServiceDeleteOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this device profile service delete o k response a status code equal to that given | ||||
| func (o *DeviceProfileServiceDeleteOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the device profile service delete o k response | ||||
| func (o *DeviceProfileServiceDeleteOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/device-profiles/{id}][%d] deviceProfileServiceDeleteOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/device-profiles/{id}][%d] deviceProfileServiceDeleteOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteOK) GetPayload() interface{} { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceDeleteDefault creates a DeviceProfileServiceDeleteDefault with default headers values | ||||
| func NewDeviceProfileServiceDeleteDefault(code int) *DeviceProfileServiceDeleteDefault { | ||||
| 	return &DeviceProfileServiceDeleteDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceDeleteDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type DeviceProfileServiceDeleteDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this device profile service delete default response has a 2xx status code | ||||
| func (o *DeviceProfileServiceDeleteDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this device profile service delete default response has a 3xx status code | ||||
| func (o *DeviceProfileServiceDeleteDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this device profile service delete default response has a 4xx status code | ||||
| func (o *DeviceProfileServiceDeleteDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this device profile service delete default response has a 5xx status code | ||||
| func (o *DeviceProfileServiceDeleteDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this device profile service delete default response a status code equal to that given | ||||
| func (o *DeviceProfileServiceDeleteDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the device profile service delete default response | ||||
| func (o *DeviceProfileServiceDeleteDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/device-profiles/{id}][%d] DeviceProfileService_Delete default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[DELETE /api/device-profiles/{id}][%d] DeviceProfileService_Delete default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceDeleteDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,151 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewDeviceProfileServiceGetParams creates a new DeviceProfileServiceGetParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewDeviceProfileServiceGetParams() *DeviceProfileServiceGetParams { | ||||
| 	return &DeviceProfileServiceGetParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceGetParamsWithTimeout creates a new DeviceProfileServiceGetParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewDeviceProfileServiceGetParamsWithTimeout(timeout time.Duration) *DeviceProfileServiceGetParams { | ||||
| 	return &DeviceProfileServiceGetParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceGetParamsWithContext creates a new DeviceProfileServiceGetParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewDeviceProfileServiceGetParamsWithContext(ctx context.Context) *DeviceProfileServiceGetParams { | ||||
| 	return &DeviceProfileServiceGetParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceGetParamsWithHTTPClient creates a new DeviceProfileServiceGetParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewDeviceProfileServiceGetParamsWithHTTPClient(client *http.Client) *DeviceProfileServiceGetParams { | ||||
| 	return &DeviceProfileServiceGetParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceGetParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the device profile service get operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type DeviceProfileServiceGetParams struct { | ||||
|  | ||||
| 	/* ID. | ||||
|  | ||||
| 	   ID (UUID). | ||||
| 	*/ | ||||
| 	ID string | ||||
|  | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the device profile service get params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceGetParams) WithDefaults() *DeviceProfileServiceGetParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the device profile service get params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceGetParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) WithTimeout(timeout time.Duration) *DeviceProfileServiceGetParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) WithContext(ctx context.Context) *DeviceProfileServiceGetParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) WithHTTPClient(client *http.Client) *DeviceProfileServiceGetParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WithID adds the id to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) WithID(id string) *DeviceProfileServiceGetParams { | ||||
| 	o.SetID(id) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetID adds the id to the device profile service get params | ||||
| func (o *DeviceProfileServiceGetParams) SetID(id string) { | ||||
| 	o.ID = id | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *DeviceProfileServiceGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	// path param id | ||||
| 	if err := r.SetPathParam("id", o.ID); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,187 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
|  | ||||
| 	"git.huangwc.com/pig/pig-farm-controller/internal/app/service/lora/chirp_stack/models" | ||||
| ) | ||||
|  | ||||
| // DeviceProfileServiceGetReader is a Reader for the DeviceProfileServiceGet structure. | ||||
| type DeviceProfileServiceGetReader struct { | ||||
| 	formats strfmt.Registry | ||||
| } | ||||
|  | ||||
| // ReadResponse reads a server response into the received o. | ||||
| func (o *DeviceProfileServiceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { | ||||
| 	switch response.Code() { | ||||
| 	case 200: | ||||
| 		result := NewDeviceProfileServiceGetOK() | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		return result, nil | ||||
| 	default: | ||||
| 		result := NewDeviceProfileServiceGetDefault(response.Code()) | ||||
| 		if err := result.readResponse(response, consumer, o.formats); err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if response.Code()/100 == 2 { | ||||
| 			return result, nil | ||||
| 		} | ||||
| 		return nil, result | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceGetOK creates a DeviceProfileServiceGetOK with default headers values | ||||
| func NewDeviceProfileServiceGetOK() *DeviceProfileServiceGetOK { | ||||
| 	return &DeviceProfileServiceGetOK{} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceGetOK describes a response with status code 200, with default header values. | ||||
|  | ||||
| A successful response. | ||||
| */ | ||||
| type DeviceProfileServiceGetOK struct { | ||||
| 	Payload *models.APIGetDeviceProfileResponse | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this device profile service get o k response has a 2xx status code | ||||
| func (o *DeviceProfileServiceGetOK) IsSuccess() bool { | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this device profile service get o k response has a 3xx status code | ||||
| func (o *DeviceProfileServiceGetOK) IsRedirect() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this device profile service get o k response has a 4xx status code | ||||
| func (o *DeviceProfileServiceGetOK) IsClientError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this device profile service get o k response has a 5xx status code | ||||
| func (o *DeviceProfileServiceGetOK) IsServerError() bool { | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this device profile service get o k response a status code equal to that given | ||||
| func (o *DeviceProfileServiceGetOK) IsCode(code int) bool { | ||||
| 	return code == 200 | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the device profile service get o k response | ||||
| func (o *DeviceProfileServiceGetOK) Code() int { | ||||
| 	return 200 | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetOK) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/device-profiles/{id}][%d] deviceProfileServiceGetOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetOK) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/device-profiles/{id}][%d] deviceProfileServiceGetOK %s", 200, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetOK) GetPayload() *models.APIGetDeviceProfileResponse { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.APIGetDeviceProfileResponse) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceGetDefault creates a DeviceProfileServiceGetDefault with default headers values | ||||
| func NewDeviceProfileServiceGetDefault(code int) *DeviceProfileServiceGetDefault { | ||||
| 	return &DeviceProfileServiceGetDefault{ | ||||
| 		_statusCode: code, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceGetDefault describes a response with status code -1, with default header values. | ||||
|  | ||||
| An unexpected error response. | ||||
| */ | ||||
| type DeviceProfileServiceGetDefault struct { | ||||
| 	_statusCode int | ||||
|  | ||||
| 	Payload *models.RPCStatus | ||||
| } | ||||
|  | ||||
| // IsSuccess returns true when this device profile service get default response has a 2xx status code | ||||
| func (o *DeviceProfileServiceGetDefault) IsSuccess() bool { | ||||
| 	return o._statusCode/100 == 2 | ||||
| } | ||||
|  | ||||
| // IsRedirect returns true when this device profile service get default response has a 3xx status code | ||||
| func (o *DeviceProfileServiceGetDefault) IsRedirect() bool { | ||||
| 	return o._statusCode/100 == 3 | ||||
| } | ||||
|  | ||||
| // IsClientError returns true when this device profile service get default response has a 4xx status code | ||||
| func (o *DeviceProfileServiceGetDefault) IsClientError() bool { | ||||
| 	return o._statusCode/100 == 4 | ||||
| } | ||||
|  | ||||
| // IsServerError returns true when this device profile service get default response has a 5xx status code | ||||
| func (o *DeviceProfileServiceGetDefault) IsServerError() bool { | ||||
| 	return o._statusCode/100 == 5 | ||||
| } | ||||
|  | ||||
| // IsCode returns true when this device profile service get default response a status code equal to that given | ||||
| func (o *DeviceProfileServiceGetDefault) IsCode(code int) bool { | ||||
| 	return o._statusCode == code | ||||
| } | ||||
|  | ||||
| // Code gets the status code for the device profile service get default response | ||||
| func (o *DeviceProfileServiceGetDefault) Code() int { | ||||
| 	return o._statusCode | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetDefault) Error() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/device-profiles/{id}][%d] DeviceProfileService_Get default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetDefault) String() string { | ||||
| 	payload, _ := json.Marshal(o.Payload) | ||||
| 	return fmt.Sprintf("[GET /api/device-profiles/{id}][%d] DeviceProfileService_Get default %s", o._statusCode, payload) | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetDefault) GetPayload() *models.RPCStatus { | ||||
| 	return o.Payload | ||||
| } | ||||
|  | ||||
| func (o *DeviceProfileServiceGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { | ||||
|  | ||||
| 	o.Payload = new(models.RPCStatus) | ||||
|  | ||||
| 	// response payload | ||||
| 	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
| @@ -0,0 +1,128 @@ | ||||
| // Code generated by go-swagger; DO NOT EDIT. | ||||
|  | ||||
| package device_profile_service | ||||
|  | ||||
| // This file was generated by the swagger tool. | ||||
| // Editing this file might prove futile when you re-run the swagger generate command | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/go-openapi/errors" | ||||
| 	"github.com/go-openapi/runtime" | ||||
| 	cr "github.com/go-openapi/runtime/client" | ||||
| 	"github.com/go-openapi/strfmt" | ||||
| ) | ||||
|  | ||||
| // NewDeviceProfileServiceListAdrAlgorithmsParams creates a new DeviceProfileServiceListAdrAlgorithmsParams object, | ||||
| // with the default timeout for this client. | ||||
| // | ||||
| // Default values are not hydrated, since defaults are normally applied by the API server side. | ||||
| // | ||||
| // To enforce default values in parameter, use SetDefaults or WithDefaults. | ||||
| func NewDeviceProfileServiceListAdrAlgorithmsParams() *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	return &DeviceProfileServiceListAdrAlgorithmsParams{ | ||||
| 		timeout: cr.DefaultTimeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceListAdrAlgorithmsParamsWithTimeout creates a new DeviceProfileServiceListAdrAlgorithmsParams object | ||||
| // with the ability to set a timeout on a request. | ||||
| func NewDeviceProfileServiceListAdrAlgorithmsParamsWithTimeout(timeout time.Duration) *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	return &DeviceProfileServiceListAdrAlgorithmsParams{ | ||||
| 		timeout: timeout, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceListAdrAlgorithmsParamsWithContext creates a new DeviceProfileServiceListAdrAlgorithmsParams object | ||||
| // with the ability to set a context for a request. | ||||
| func NewDeviceProfileServiceListAdrAlgorithmsParamsWithContext(ctx context.Context) *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	return &DeviceProfileServiceListAdrAlgorithmsParams{ | ||||
| 		Context: ctx, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewDeviceProfileServiceListAdrAlgorithmsParamsWithHTTPClient creates a new DeviceProfileServiceListAdrAlgorithmsParams object | ||||
| // with the ability to set a custom HTTPClient for a request. | ||||
| func NewDeviceProfileServiceListAdrAlgorithmsParamsWithHTTPClient(client *http.Client) *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	return &DeviceProfileServiceListAdrAlgorithmsParams{ | ||||
| 		HTTPClient: client, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| /* | ||||
| DeviceProfileServiceListAdrAlgorithmsParams contains all the parameters to send to the API endpoint | ||||
|  | ||||
| 	for the device profile service list adr algorithms operation. | ||||
|  | ||||
| 	Typically these are written to a http.Request. | ||||
| */ | ||||
| type DeviceProfileServiceListAdrAlgorithmsParams struct { | ||||
| 	timeout    time.Duration | ||||
| 	Context    context.Context | ||||
| 	HTTPClient *http.Client | ||||
| } | ||||
|  | ||||
| // WithDefaults hydrates default values in the device profile service list adr algorithms params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) WithDefaults() *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	o.SetDefaults() | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetDefaults hydrates default values in the device profile service list adr algorithms params (not the query body). | ||||
| // | ||||
| // All values with no default are reset to their zero value. | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) SetDefaults() { | ||||
| 	// no default values defined for this parameter | ||||
| } | ||||
|  | ||||
| // WithTimeout adds the timeout to the device profile service list adr algorithms params | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) WithTimeout(timeout time.Duration) *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	o.SetTimeout(timeout) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetTimeout adds the timeout to the device profile service list adr algorithms params | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) SetTimeout(timeout time.Duration) { | ||||
| 	o.timeout = timeout | ||||
| } | ||||
|  | ||||
| // WithContext adds the context to the device profile service list adr algorithms params | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) WithContext(ctx context.Context) *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	o.SetContext(ctx) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetContext adds the context to the device profile service list adr algorithms params | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) SetContext(ctx context.Context) { | ||||
| 	o.Context = ctx | ||||
| } | ||||
|  | ||||
| // WithHTTPClient adds the HTTPClient to the device profile service list adr algorithms params | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) WithHTTPClient(client *http.Client) *DeviceProfileServiceListAdrAlgorithmsParams { | ||||
| 	o.SetHTTPClient(client) | ||||
| 	return o | ||||
| } | ||||
|  | ||||
| // SetHTTPClient adds the HTTPClient to the device profile service list adr algorithms params | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) SetHTTPClient(client *http.Client) { | ||||
| 	o.HTTPClient = client | ||||
| } | ||||
|  | ||||
| // WriteToRequest writes these params to a swagger request | ||||
| func (o *DeviceProfileServiceListAdrAlgorithmsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { | ||||
|  | ||||
| 	if err := r.SetTimeout(o.timeout); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	var res []error | ||||
|  | ||||
| 	if len(res) > 0 { | ||||
| 		return errors.CompositeValidationError(res...) | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user