diff --git a/client/gke/gke_client.go b/client/gke/gke_client.go index a3d00394..cba36571 100644 --- a/client/gke/gke_client.go +++ b/client/gke/gke_client.go @@ -46,8 +46,20 @@ type ClientService interface { ListGKEZones(params *ListGKEZonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListGKEZonesOK, error) + ListProjectGKEDiskTypes(params *ListProjectGKEDiskTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEDiskTypesOK, error) + + ListProjectGKEImages(params *ListProjectGKEImagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEImagesOK, error) + + ListProjectGKEVMSizes(params *ListProjectGKEVMSizesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEVMSizesOK, error) + + ListProjectGKEVersions(params *ListProjectGKEVersionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEVersionsOK, error) + + ListProjectGKEZones(params *ListProjectGKEZonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEZonesOK, error) + ValidateGKECredentials(params *ValidateGKECredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateGKECredentialsOK, error) + ValidateProjectGKECredentials(params *ValidateProjectGKECredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateProjectGKECredentialsOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -393,6 +405,196 @@ func (a *Client) ListGKEZones(params *ListGKEZonesParams, authInfo runtime.Clien return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ListProjectGKEDiskTypes lists g k e machine disk types +*/ +func (a *Client) ListProjectGKEDiskTypes(params *ListProjectGKEDiskTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEDiskTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListProjectGKEDiskTypesParams() + } + op := &runtime.ClientOperation{ + ID: "listProjectGKEDiskTypes", + Method: "GET", + PathPattern: "/api/v2/projects/{project_id}/providers/gke/disktypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListProjectGKEDiskTypesReader{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.(*ListProjectGKEDiskTypesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListProjectGKEDiskTypesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ListProjectGKEImages lists g k e image types +*/ +func (a *Client) ListProjectGKEImages(params *ListProjectGKEImagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEImagesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListProjectGKEImagesParams() + } + op := &runtime.ClientOperation{ + ID: "listProjectGKEImages", + Method: "GET", + PathPattern: "/api/v2/projects/{project_id}/providers/gke/images", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListProjectGKEImagesReader{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.(*ListProjectGKEImagesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListProjectGKEImagesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ListProjectGKEVMSizes lists g k e VM sizes +*/ +func (a *Client) ListProjectGKEVMSizes(params *ListProjectGKEVMSizesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEVMSizesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListProjectGKEVMSizesParams() + } + op := &runtime.ClientOperation{ + ID: "listProjectGKEVMSizes", + Method: "GET", + PathPattern: "/api/v2/projects/{project_id}/providers/gke/vmsizes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListProjectGKEVMSizesReader{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.(*ListProjectGKEVMSizesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListProjectGKEVMSizesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ListProjectGKEVersions lists g k e versions +*/ +func (a *Client) ListProjectGKEVersions(params *ListProjectGKEVersionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEVersionsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListProjectGKEVersionsParams() + } + op := &runtime.ClientOperation{ + ID: "listProjectGKEVersions", + Method: "GET", + PathPattern: "/api/v2/projects/{project_id}/providers/gke/versions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListProjectGKEVersionsReader{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.(*ListProjectGKEVersionsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListProjectGKEVersionsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ListProjectGKEZones lists g k e zones +*/ +func (a *Client) ListProjectGKEZones(params *ListProjectGKEZonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProjectGKEZonesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListProjectGKEZonesParams() + } + op := &runtime.ClientOperation{ + ID: "listProjectGKEZones", + Method: "GET", + PathPattern: "/api/v2/projects/{project_id}/providers/gke/zones", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListProjectGKEZonesReader{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.(*ListProjectGKEZonesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListProjectGKEZonesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ValidateGKECredentials Validates GKE credentials */ @@ -431,6 +633,44 @@ func (a *Client) ValidateGKECredentials(params *ValidateGKECredentialsParams, au return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ValidateProjectGKECredentials validates g k e credentials +*/ +func (a *Client) ValidateProjectGKECredentials(params *ValidateProjectGKECredentialsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateProjectGKECredentialsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateProjectGKECredentialsParams() + } + op := &runtime.ClientOperation{ + ID: "validateProjectGKECredentials", + Method: "GET", + PathPattern: "/api/v2/projects/{project_id}/providers/gke/validatecredentials", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateProjectGKECredentialsReader{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.(*ValidateProjectGKECredentialsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ValidateProjectGKECredentialsDefault) + 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 diff --git a/client/gke/list_project_g_k_e_disk_types_parameters.go b/client/gke/list_project_g_k_e_disk_types_parameters.go new file mode 100644 index 00000000..b3512b20 --- /dev/null +++ b/client/gke/list_project_g_k_e_disk_types_parameters.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// 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" +) + +// NewListProjectGKEDiskTypesParams creates a new ListProjectGKEDiskTypesParams 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 NewListProjectGKEDiskTypesParams() *ListProjectGKEDiskTypesParams { + return &ListProjectGKEDiskTypesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListProjectGKEDiskTypesParamsWithTimeout creates a new ListProjectGKEDiskTypesParams object +// with the ability to set a timeout on a request. +func NewListProjectGKEDiskTypesParamsWithTimeout(timeout time.Duration) *ListProjectGKEDiskTypesParams { + return &ListProjectGKEDiskTypesParams{ + timeout: timeout, + } +} + +// NewListProjectGKEDiskTypesParamsWithContext creates a new ListProjectGKEDiskTypesParams object +// with the ability to set a context for a request. +func NewListProjectGKEDiskTypesParamsWithContext(ctx context.Context) *ListProjectGKEDiskTypesParams { + return &ListProjectGKEDiskTypesParams{ + Context: ctx, + } +} + +// NewListProjectGKEDiskTypesParamsWithHTTPClient creates a new ListProjectGKEDiskTypesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListProjectGKEDiskTypesParamsWithHTTPClient(client *http.Client) *ListProjectGKEDiskTypesParams { + return &ListProjectGKEDiskTypesParams{ + HTTPClient: client, + } +} + +/* +ListProjectGKEDiskTypesParams contains all the parameters to send to the API endpoint + + for the list project g k e disk types operation. + + Typically these are written to a http.Request. +*/ +type ListProjectGKEDiskTypesParams struct { + + /* Credential. + + The credential name used in the preset for the GCP provider + */ + Credential *string + + /* ServiceAccount. + + The plain GCP service account + */ + ServiceAccount *string + + /* Zone. + + The zone name + */ + Zone *string + + // ProjectID. + ProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list project g k e disk types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEDiskTypesParams) WithDefaults() *ListProjectGKEDiskTypesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list project g k e disk types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEDiskTypesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithTimeout(timeout time.Duration) *ListProjectGKEDiskTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithContext(ctx context.Context) *ListProjectGKEDiskTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithHTTPClient(client *http.Client) *ListProjectGKEDiskTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredential adds the credential to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithCredential(credential *string) *ListProjectGKEDiskTypesParams { + o.SetCredential(credential) + return o +} + +// SetCredential adds the credential to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetCredential(credential *string) { + o.Credential = credential +} + +// WithServiceAccount adds the serviceAccount to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithServiceAccount(serviceAccount *string) *ListProjectGKEDiskTypesParams { + o.SetServiceAccount(serviceAccount) + return o +} + +// SetServiceAccount adds the serviceAccount to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetServiceAccount(serviceAccount *string) { + o.ServiceAccount = serviceAccount +} + +// WithZone adds the zone to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithZone(zone *string) *ListProjectGKEDiskTypesParams { + o.SetZone(zone) + return o +} + +// SetZone adds the zone to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetZone(zone *string) { + o.Zone = zone +} + +// WithProjectID adds the projectID to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) WithProjectID(projectID string) *ListProjectGKEDiskTypesParams { + o.SetProjectID(projectID) + return o +} + +// SetProjectID adds the projectId to the list project g k e disk types params +func (o *ListProjectGKEDiskTypesParams) SetProjectID(projectID string) { + o.ProjectID = projectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProjectGKEDiskTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Credential != nil { + + // header param Credential + if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { + return err + } + } + + if o.ServiceAccount != nil { + + // header param ServiceAccount + if err := r.SetHeaderParam("ServiceAccount", *o.ServiceAccount); err != nil { + return err + } + } + + if o.Zone != nil { + + // header param Zone + if err := r.SetHeaderParam("Zone", *o.Zone); err != nil { + return err + } + } + + // path param project_id + if err := r.SetPathParam("project_id", o.ProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/gke/list_project_g_k_e_disk_types_responses.go b/client/gke/list_project_g_k_e_disk_types_responses.go new file mode 100644 index 00000000..81e5ecfa --- /dev/null +++ b/client/gke/list_project_g_k_e_disk_types_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/kubermatic/go-kubermatic/models" +) + +// ListProjectGKEDiskTypesReader is a Reader for the ListProjectGKEDiskTypes structure. +type ListProjectGKEDiskTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProjectGKEDiskTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProjectGKEDiskTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListProjectGKEDiskTypesDefault(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 + } +} + +// NewListProjectGKEDiskTypesOK creates a ListProjectGKEDiskTypesOK with default headers values +func NewListProjectGKEDiskTypesOK() *ListProjectGKEDiskTypesOK { + return &ListProjectGKEDiskTypesOK{} +} + +/* +ListProjectGKEDiskTypesOK describes a response with status code 200, with default header values. + +GKEDiskTypeList +*/ +type ListProjectGKEDiskTypesOK struct { + Payload models.GKEDiskTypeList +} + +// IsSuccess returns true when this list project g k e disk types o k response has a 2xx status code +func (o *ListProjectGKEDiskTypesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list project g k e disk types o k response has a 3xx status code +func (o *ListProjectGKEDiskTypesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list project g k e disk types o k response has a 4xx status code +func (o *ListProjectGKEDiskTypesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list project g k e disk types o k response has a 5xx status code +func (o *ListProjectGKEDiskTypesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list project g k e disk types o k response a status code equal to that given +func (o *ListProjectGKEDiskTypesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListProjectGKEDiskTypesOK) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/disktypes][%d] listProjectGKEDiskTypesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEDiskTypesOK) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/disktypes][%d] listProjectGKEDiskTypesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEDiskTypesOK) GetPayload() models.GKEDiskTypeList { + return o.Payload +} + +func (o *ListProjectGKEDiskTypesOK) 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 +} + +// NewListProjectGKEDiskTypesDefault creates a ListProjectGKEDiskTypesDefault with default headers values +func NewListProjectGKEDiskTypesDefault(code int) *ListProjectGKEDiskTypesDefault { + return &ListProjectGKEDiskTypesDefault{ + _statusCode: code, + } +} + +/* +ListProjectGKEDiskTypesDefault describes a response with status code -1, with default header values. + +errorResponse +*/ +type ListProjectGKEDiskTypesDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the list project g k e disk types default response +func (o *ListProjectGKEDiskTypesDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this list project g k e disk types default response has a 2xx status code +func (o *ListProjectGKEDiskTypesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list project g k e disk types default response has a 3xx status code +func (o *ListProjectGKEDiskTypesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list project g k e disk types default response has a 4xx status code +func (o *ListProjectGKEDiskTypesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list project g k e disk types default response has a 5xx status code +func (o *ListProjectGKEDiskTypesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list project g k e disk types default response a status code equal to that given +func (o *ListProjectGKEDiskTypesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *ListProjectGKEDiskTypesDefault) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/disktypes][%d] listProjectGKEDiskTypes default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEDiskTypesDefault) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/disktypes][%d] listProjectGKEDiskTypes default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEDiskTypesDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ListProjectGKEDiskTypesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/gke/list_project_g_k_e_images_parameters.go b/client/gke/list_project_g_k_e_images_parameters.go new file mode 100644 index 00000000..e2ab5273 --- /dev/null +++ b/client/gke/list_project_g_k_e_images_parameters.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// 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" +) + +// NewListProjectGKEImagesParams creates a new ListProjectGKEImagesParams 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 NewListProjectGKEImagesParams() *ListProjectGKEImagesParams { + return &ListProjectGKEImagesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListProjectGKEImagesParamsWithTimeout creates a new ListProjectGKEImagesParams object +// with the ability to set a timeout on a request. +func NewListProjectGKEImagesParamsWithTimeout(timeout time.Duration) *ListProjectGKEImagesParams { + return &ListProjectGKEImagesParams{ + timeout: timeout, + } +} + +// NewListProjectGKEImagesParamsWithContext creates a new ListProjectGKEImagesParams object +// with the ability to set a context for a request. +func NewListProjectGKEImagesParamsWithContext(ctx context.Context) *ListProjectGKEImagesParams { + return &ListProjectGKEImagesParams{ + Context: ctx, + } +} + +// NewListProjectGKEImagesParamsWithHTTPClient creates a new ListProjectGKEImagesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListProjectGKEImagesParamsWithHTTPClient(client *http.Client) *ListProjectGKEImagesParams { + return &ListProjectGKEImagesParams{ + HTTPClient: client, + } +} + +/* +ListProjectGKEImagesParams contains all the parameters to send to the API endpoint + + for the list project g k e images operation. + + Typically these are written to a http.Request. +*/ +type ListProjectGKEImagesParams struct { + + /* Credential. + + The credential name used in the preset for the GCP provider + */ + Credential *string + + /* ServiceAccount. + + The plain GCP service account + */ + ServiceAccount *string + + /* Zone. + + The zone name + */ + Zone *string + + // ProjectID. + ProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list project g k e images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEImagesParams) WithDefaults() *ListProjectGKEImagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list project g k e images params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEImagesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithTimeout(timeout time.Duration) *ListProjectGKEImagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithContext(ctx context.Context) *ListProjectGKEImagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithHTTPClient(client *http.Client) *ListProjectGKEImagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredential adds the credential to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithCredential(credential *string) *ListProjectGKEImagesParams { + o.SetCredential(credential) + return o +} + +// SetCredential adds the credential to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetCredential(credential *string) { + o.Credential = credential +} + +// WithServiceAccount adds the serviceAccount to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithServiceAccount(serviceAccount *string) *ListProjectGKEImagesParams { + o.SetServiceAccount(serviceAccount) + return o +} + +// SetServiceAccount adds the serviceAccount to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetServiceAccount(serviceAccount *string) { + o.ServiceAccount = serviceAccount +} + +// WithZone adds the zone to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithZone(zone *string) *ListProjectGKEImagesParams { + o.SetZone(zone) + return o +} + +// SetZone adds the zone to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetZone(zone *string) { + o.Zone = zone +} + +// WithProjectID adds the projectID to the list project g k e images params +func (o *ListProjectGKEImagesParams) WithProjectID(projectID string) *ListProjectGKEImagesParams { + o.SetProjectID(projectID) + return o +} + +// SetProjectID adds the projectId to the list project g k e images params +func (o *ListProjectGKEImagesParams) SetProjectID(projectID string) { + o.ProjectID = projectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProjectGKEImagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Credential != nil { + + // header param Credential + if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { + return err + } + } + + if o.ServiceAccount != nil { + + // header param ServiceAccount + if err := r.SetHeaderParam("ServiceAccount", *o.ServiceAccount); err != nil { + return err + } + } + + if o.Zone != nil { + + // header param Zone + if err := r.SetHeaderParam("Zone", *o.Zone); err != nil { + return err + } + } + + // path param project_id + if err := r.SetPathParam("project_id", o.ProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/gke/list_project_g_k_e_images_responses.go b/client/gke/list_project_g_k_e_images_responses.go new file mode 100644 index 00000000..bc686aa7 --- /dev/null +++ b/client/gke/list_project_g_k_e_images_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/kubermatic/go-kubermatic/models" +) + +// ListProjectGKEImagesReader is a Reader for the ListProjectGKEImages structure. +type ListProjectGKEImagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProjectGKEImagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProjectGKEImagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListProjectGKEImagesDefault(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 + } +} + +// NewListProjectGKEImagesOK creates a ListProjectGKEImagesOK with default headers values +func NewListProjectGKEImagesOK() *ListProjectGKEImagesOK { + return &ListProjectGKEImagesOK{} +} + +/* +ListProjectGKEImagesOK describes a response with status code 200, with default header values. + +GKEImageList +*/ +type ListProjectGKEImagesOK struct { + Payload models.GKEImageList +} + +// IsSuccess returns true when this list project g k e images o k response has a 2xx status code +func (o *ListProjectGKEImagesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list project g k e images o k response has a 3xx status code +func (o *ListProjectGKEImagesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list project g k e images o k response has a 4xx status code +func (o *ListProjectGKEImagesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list project g k e images o k response has a 5xx status code +func (o *ListProjectGKEImagesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list project g k e images o k response a status code equal to that given +func (o *ListProjectGKEImagesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListProjectGKEImagesOK) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/images][%d] listProjectGKEImagesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEImagesOK) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/images][%d] listProjectGKEImagesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEImagesOK) GetPayload() models.GKEImageList { + return o.Payload +} + +func (o *ListProjectGKEImagesOK) 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 +} + +// NewListProjectGKEImagesDefault creates a ListProjectGKEImagesDefault with default headers values +func NewListProjectGKEImagesDefault(code int) *ListProjectGKEImagesDefault { + return &ListProjectGKEImagesDefault{ + _statusCode: code, + } +} + +/* +ListProjectGKEImagesDefault describes a response with status code -1, with default header values. + +errorResponse +*/ +type ListProjectGKEImagesDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the list project g k e images default response +func (o *ListProjectGKEImagesDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this list project g k e images default response has a 2xx status code +func (o *ListProjectGKEImagesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list project g k e images default response has a 3xx status code +func (o *ListProjectGKEImagesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list project g k e images default response has a 4xx status code +func (o *ListProjectGKEImagesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list project g k e images default response has a 5xx status code +func (o *ListProjectGKEImagesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list project g k e images default response a status code equal to that given +func (o *ListProjectGKEImagesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *ListProjectGKEImagesDefault) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/images][%d] listProjectGKEImages default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEImagesDefault) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/images][%d] listProjectGKEImages default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEImagesDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ListProjectGKEImagesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/gke/list_project_g_k_e_versions_parameters.go b/client/gke/list_project_g_k_e_versions_parameters.go new file mode 100644 index 00000000..e9a30d72 --- /dev/null +++ b/client/gke/list_project_g_k_e_versions_parameters.go @@ -0,0 +1,275 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// 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" +) + +// NewListProjectGKEVersionsParams creates a new ListProjectGKEVersionsParams 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 NewListProjectGKEVersionsParams() *ListProjectGKEVersionsParams { + return &ListProjectGKEVersionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListProjectGKEVersionsParamsWithTimeout creates a new ListProjectGKEVersionsParams object +// with the ability to set a timeout on a request. +func NewListProjectGKEVersionsParamsWithTimeout(timeout time.Duration) *ListProjectGKEVersionsParams { + return &ListProjectGKEVersionsParams{ + timeout: timeout, + } +} + +// NewListProjectGKEVersionsParamsWithContext creates a new ListProjectGKEVersionsParams object +// with the ability to set a context for a request. +func NewListProjectGKEVersionsParamsWithContext(ctx context.Context) *ListProjectGKEVersionsParams { + return &ListProjectGKEVersionsParams{ + Context: ctx, + } +} + +// NewListProjectGKEVersionsParamsWithHTTPClient creates a new ListProjectGKEVersionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListProjectGKEVersionsParamsWithHTTPClient(client *http.Client) *ListProjectGKEVersionsParams { + return &ListProjectGKEVersionsParams{ + HTTPClient: client, + } +} + +/* +ListProjectGKEVersionsParams contains all the parameters to send to the API endpoint + + for the list project g k e versions operation. + + Typically these are written to a http.Request. +*/ +type ListProjectGKEVersionsParams struct { + + /* Credential. + + The credential name used in the preset for the GCP provider + */ + Credential *string + + /* Mode. + + The Mode is how you want GKE Control plane version to be managed. + Manual: Manually manage the version upgrades. + Auto: automatically manage the cluster's control plane version. + */ + Mode *string + + /* ReleaseChannel. + + The ReleaseChannel + */ + ReleaseChannel *string + + /* ServiceAccount. + + The plain GCP service account + */ + ServiceAccount *string + + /* Zone. + + The zone name + */ + Zone *string + + // ProjectID. + ProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list project g k e versions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEVersionsParams) WithDefaults() *ListProjectGKEVersionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list project g k e versions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEVersionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithTimeout(timeout time.Duration) *ListProjectGKEVersionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithContext(ctx context.Context) *ListProjectGKEVersionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithHTTPClient(client *http.Client) *ListProjectGKEVersionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredential adds the credential to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithCredential(credential *string) *ListProjectGKEVersionsParams { + o.SetCredential(credential) + return o +} + +// SetCredential adds the credential to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetCredential(credential *string) { + o.Credential = credential +} + +// WithMode adds the mode to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithMode(mode *string) *ListProjectGKEVersionsParams { + o.SetMode(mode) + return o +} + +// SetMode adds the mode to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetMode(mode *string) { + o.Mode = mode +} + +// WithReleaseChannel adds the releaseChannel to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithReleaseChannel(releaseChannel *string) *ListProjectGKEVersionsParams { + o.SetReleaseChannel(releaseChannel) + return o +} + +// SetReleaseChannel adds the releaseChannel to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetReleaseChannel(releaseChannel *string) { + o.ReleaseChannel = releaseChannel +} + +// WithServiceAccount adds the serviceAccount to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithServiceAccount(serviceAccount *string) *ListProjectGKEVersionsParams { + o.SetServiceAccount(serviceAccount) + return o +} + +// SetServiceAccount adds the serviceAccount to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetServiceAccount(serviceAccount *string) { + o.ServiceAccount = serviceAccount +} + +// WithZone adds the zone to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithZone(zone *string) *ListProjectGKEVersionsParams { + o.SetZone(zone) + return o +} + +// SetZone adds the zone to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetZone(zone *string) { + o.Zone = zone +} + +// WithProjectID adds the projectID to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) WithProjectID(projectID string) *ListProjectGKEVersionsParams { + o.SetProjectID(projectID) + return o +} + +// SetProjectID adds the projectId to the list project g k e versions params +func (o *ListProjectGKEVersionsParams) SetProjectID(projectID string) { + o.ProjectID = projectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProjectGKEVersionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Credential != nil { + + // header param Credential + if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { + return err + } + } + + if o.Mode != nil { + + // header param Mode + if err := r.SetHeaderParam("Mode", *o.Mode); err != nil { + return err + } + } + + if o.ReleaseChannel != nil { + + // header param ReleaseChannel + if err := r.SetHeaderParam("ReleaseChannel", *o.ReleaseChannel); err != nil { + return err + } + } + + if o.ServiceAccount != nil { + + // header param ServiceAccount + if err := r.SetHeaderParam("ServiceAccount", *o.ServiceAccount); err != nil { + return err + } + } + + if o.Zone != nil { + + // header param Zone + if err := r.SetHeaderParam("Zone", *o.Zone); err != nil { + return err + } + } + + // path param project_id + if err := r.SetPathParam("project_id", o.ProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/gke/list_project_g_k_e_versions_responses.go b/client/gke/list_project_g_k_e_versions_responses.go new file mode 100644 index 00000000..49329d31 --- /dev/null +++ b/client/gke/list_project_g_k_e_versions_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/kubermatic/go-kubermatic/models" +) + +// ListProjectGKEVersionsReader is a Reader for the ListProjectGKEVersions structure. +type ListProjectGKEVersionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProjectGKEVersionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProjectGKEVersionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListProjectGKEVersionsDefault(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 + } +} + +// NewListProjectGKEVersionsOK creates a ListProjectGKEVersionsOK with default headers values +func NewListProjectGKEVersionsOK() *ListProjectGKEVersionsOK { + return &ListProjectGKEVersionsOK{} +} + +/* +ListProjectGKEVersionsOK describes a response with status code 200, with default header values. + +MasterVersion +*/ +type ListProjectGKEVersionsOK struct { + Payload []*models.MasterVersion +} + +// IsSuccess returns true when this list project g k e versions o k response has a 2xx status code +func (o *ListProjectGKEVersionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list project g k e versions o k response has a 3xx status code +func (o *ListProjectGKEVersionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list project g k e versions o k response has a 4xx status code +func (o *ListProjectGKEVersionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list project g k e versions o k response has a 5xx status code +func (o *ListProjectGKEVersionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list project g k e versions o k response a status code equal to that given +func (o *ListProjectGKEVersionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListProjectGKEVersionsOK) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/versions][%d] listProjectGKEVersionsOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEVersionsOK) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/versions][%d] listProjectGKEVersionsOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEVersionsOK) GetPayload() []*models.MasterVersion { + return o.Payload +} + +func (o *ListProjectGKEVersionsOK) 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 +} + +// NewListProjectGKEVersionsDefault creates a ListProjectGKEVersionsDefault with default headers values +func NewListProjectGKEVersionsDefault(code int) *ListProjectGKEVersionsDefault { + return &ListProjectGKEVersionsDefault{ + _statusCode: code, + } +} + +/* +ListProjectGKEVersionsDefault describes a response with status code -1, with default header values. + +errorResponse +*/ +type ListProjectGKEVersionsDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the list project g k e versions default response +func (o *ListProjectGKEVersionsDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this list project g k e versions default response has a 2xx status code +func (o *ListProjectGKEVersionsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list project g k e versions default response has a 3xx status code +func (o *ListProjectGKEVersionsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list project g k e versions default response has a 4xx status code +func (o *ListProjectGKEVersionsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list project g k e versions default response has a 5xx status code +func (o *ListProjectGKEVersionsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list project g k e versions default response a status code equal to that given +func (o *ListProjectGKEVersionsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *ListProjectGKEVersionsDefault) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/versions][%d] listProjectGKEVersions default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEVersionsDefault) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/versions][%d] listProjectGKEVersions default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEVersionsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ListProjectGKEVersionsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/gke/list_project_g_k_e_vm_sizes_parameters.go b/client/gke/list_project_g_k_e_vm_sizes_parameters.go new file mode 100644 index 00000000..b8a9fed4 --- /dev/null +++ b/client/gke/list_project_g_k_e_vm_sizes_parameters.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// 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" +) + +// NewListProjectGKEVMSizesParams creates a new ListProjectGKEVMSizesParams 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 NewListProjectGKEVMSizesParams() *ListProjectGKEVMSizesParams { + return &ListProjectGKEVMSizesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListProjectGKEVMSizesParamsWithTimeout creates a new ListProjectGKEVMSizesParams object +// with the ability to set a timeout on a request. +func NewListProjectGKEVMSizesParamsWithTimeout(timeout time.Duration) *ListProjectGKEVMSizesParams { + return &ListProjectGKEVMSizesParams{ + timeout: timeout, + } +} + +// NewListProjectGKEVMSizesParamsWithContext creates a new ListProjectGKEVMSizesParams object +// with the ability to set a context for a request. +func NewListProjectGKEVMSizesParamsWithContext(ctx context.Context) *ListProjectGKEVMSizesParams { + return &ListProjectGKEVMSizesParams{ + Context: ctx, + } +} + +// NewListProjectGKEVMSizesParamsWithHTTPClient creates a new ListProjectGKEVMSizesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListProjectGKEVMSizesParamsWithHTTPClient(client *http.Client) *ListProjectGKEVMSizesParams { + return &ListProjectGKEVMSizesParams{ + HTTPClient: client, + } +} + +/* +ListProjectGKEVMSizesParams contains all the parameters to send to the API endpoint + + for the list project g k e VM sizes operation. + + Typically these are written to a http.Request. +*/ +type ListProjectGKEVMSizesParams struct { + + /* Credential. + + The credential name used in the preset for the GCP provider + */ + Credential *string + + /* ServiceAccount. + + The plain GCP service account + */ + ServiceAccount *string + + /* Zone. + + The zone name + */ + Zone *string + + // ProjectID. + ProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list project g k e VM sizes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEVMSizesParams) WithDefaults() *ListProjectGKEVMSizesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list project g k e VM sizes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEVMSizesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithTimeout(timeout time.Duration) *ListProjectGKEVMSizesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithContext(ctx context.Context) *ListProjectGKEVMSizesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithHTTPClient(client *http.Client) *ListProjectGKEVMSizesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredential adds the credential to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithCredential(credential *string) *ListProjectGKEVMSizesParams { + o.SetCredential(credential) + return o +} + +// SetCredential adds the credential to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetCredential(credential *string) { + o.Credential = credential +} + +// WithServiceAccount adds the serviceAccount to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithServiceAccount(serviceAccount *string) *ListProjectGKEVMSizesParams { + o.SetServiceAccount(serviceAccount) + return o +} + +// SetServiceAccount adds the serviceAccount to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetServiceAccount(serviceAccount *string) { + o.ServiceAccount = serviceAccount +} + +// WithZone adds the zone to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithZone(zone *string) *ListProjectGKEVMSizesParams { + o.SetZone(zone) + return o +} + +// SetZone adds the zone to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetZone(zone *string) { + o.Zone = zone +} + +// WithProjectID adds the projectID to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) WithProjectID(projectID string) *ListProjectGKEVMSizesParams { + o.SetProjectID(projectID) + return o +} + +// SetProjectID adds the projectId to the list project g k e VM sizes params +func (o *ListProjectGKEVMSizesParams) SetProjectID(projectID string) { + o.ProjectID = projectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProjectGKEVMSizesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Credential != nil { + + // header param Credential + if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { + return err + } + } + + if o.ServiceAccount != nil { + + // header param ServiceAccount + if err := r.SetHeaderParam("ServiceAccount", *o.ServiceAccount); err != nil { + return err + } + } + + if o.Zone != nil { + + // header param Zone + if err := r.SetHeaderParam("Zone", *o.Zone); err != nil { + return err + } + } + + // path param project_id + if err := r.SetPathParam("project_id", o.ProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/gke/list_project_g_k_e_vm_sizes_responses.go b/client/gke/list_project_g_k_e_vm_sizes_responses.go new file mode 100644 index 00000000..b4183e5e --- /dev/null +++ b/client/gke/list_project_g_k_e_vm_sizes_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/kubermatic/go-kubermatic/models" +) + +// ListProjectGKEVMSizesReader is a Reader for the ListProjectGKEVMSizes structure. +type ListProjectGKEVMSizesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProjectGKEVMSizesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProjectGKEVMSizesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListProjectGKEVMSizesDefault(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 + } +} + +// NewListProjectGKEVMSizesOK creates a ListProjectGKEVMSizesOK with default headers values +func NewListProjectGKEVMSizesOK() *ListProjectGKEVMSizesOK { + return &ListProjectGKEVMSizesOK{} +} + +/* +ListProjectGKEVMSizesOK describes a response with status code 200, with default header values. + +GCPMachineSizeList +*/ +type ListProjectGKEVMSizesOK struct { + Payload models.GCPMachineSizeList +} + +// IsSuccess returns true when this list project g k e Vm sizes o k response has a 2xx status code +func (o *ListProjectGKEVMSizesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list project g k e Vm sizes o k response has a 3xx status code +func (o *ListProjectGKEVMSizesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list project g k e Vm sizes o k response has a 4xx status code +func (o *ListProjectGKEVMSizesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list project g k e Vm sizes o k response has a 5xx status code +func (o *ListProjectGKEVMSizesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list project g k e Vm sizes o k response a status code equal to that given +func (o *ListProjectGKEVMSizesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListProjectGKEVMSizesOK) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/vmsizes][%d] listProjectGKEVmSizesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEVMSizesOK) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/vmsizes][%d] listProjectGKEVmSizesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEVMSizesOK) GetPayload() models.GCPMachineSizeList { + return o.Payload +} + +func (o *ListProjectGKEVMSizesOK) 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 +} + +// NewListProjectGKEVMSizesDefault creates a ListProjectGKEVMSizesDefault with default headers values +func NewListProjectGKEVMSizesDefault(code int) *ListProjectGKEVMSizesDefault { + return &ListProjectGKEVMSizesDefault{ + _statusCode: code, + } +} + +/* +ListProjectGKEVMSizesDefault describes a response with status code -1, with default header values. + +errorResponse +*/ +type ListProjectGKEVMSizesDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the list project g k e VM sizes default response +func (o *ListProjectGKEVMSizesDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this list project g k e VM sizes default response has a 2xx status code +func (o *ListProjectGKEVMSizesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list project g k e VM sizes default response has a 3xx status code +func (o *ListProjectGKEVMSizesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list project g k e VM sizes default response has a 4xx status code +func (o *ListProjectGKEVMSizesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list project g k e VM sizes default response has a 5xx status code +func (o *ListProjectGKEVMSizesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list project g k e VM sizes default response a status code equal to that given +func (o *ListProjectGKEVMSizesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *ListProjectGKEVMSizesDefault) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/vmsizes][%d] listProjectGKEVMSizes default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEVMSizesDefault) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/vmsizes][%d] listProjectGKEVMSizes default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEVMSizesDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ListProjectGKEVMSizesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/gke/list_project_g_k_e_zones_parameters.go b/client/gke/list_project_g_k_e_zones_parameters.go new file mode 100644 index 00000000..357c36c4 --- /dev/null +++ b/client/gke/list_project_g_k_e_zones_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// 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" +) + +// NewListProjectGKEZonesParams creates a new ListProjectGKEZonesParams 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 NewListProjectGKEZonesParams() *ListProjectGKEZonesParams { + return &ListProjectGKEZonesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListProjectGKEZonesParamsWithTimeout creates a new ListProjectGKEZonesParams object +// with the ability to set a timeout on a request. +func NewListProjectGKEZonesParamsWithTimeout(timeout time.Duration) *ListProjectGKEZonesParams { + return &ListProjectGKEZonesParams{ + timeout: timeout, + } +} + +// NewListProjectGKEZonesParamsWithContext creates a new ListProjectGKEZonesParams object +// with the ability to set a context for a request. +func NewListProjectGKEZonesParamsWithContext(ctx context.Context) *ListProjectGKEZonesParams { + return &ListProjectGKEZonesParams{ + Context: ctx, + } +} + +// NewListProjectGKEZonesParamsWithHTTPClient creates a new ListProjectGKEZonesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListProjectGKEZonesParamsWithHTTPClient(client *http.Client) *ListProjectGKEZonesParams { + return &ListProjectGKEZonesParams{ + HTTPClient: client, + } +} + +/* +ListProjectGKEZonesParams contains all the parameters to send to the API endpoint + + for the list project g k e zones operation. + + Typically these are written to a http.Request. +*/ +type ListProjectGKEZonesParams struct { + + /* Credential. + + The credential name used in the preset for the GCP provider + */ + Credential *string + + /* ServiceAccount. + + The plain GCP service account + */ + ServiceAccount *string + + // ProjectID. + ProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list project g k e zones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEZonesParams) WithDefaults() *ListProjectGKEZonesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list project g k e zones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProjectGKEZonesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list project g k e zones params +func (o *ListProjectGKEZonesParams) WithTimeout(timeout time.Duration) *ListProjectGKEZonesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list project g k e zones params +func (o *ListProjectGKEZonesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list project g k e zones params +func (o *ListProjectGKEZonesParams) WithContext(ctx context.Context) *ListProjectGKEZonesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list project g k e zones params +func (o *ListProjectGKEZonesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list project g k e zones params +func (o *ListProjectGKEZonesParams) WithHTTPClient(client *http.Client) *ListProjectGKEZonesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list project g k e zones params +func (o *ListProjectGKEZonesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredential adds the credential to the list project g k e zones params +func (o *ListProjectGKEZonesParams) WithCredential(credential *string) *ListProjectGKEZonesParams { + o.SetCredential(credential) + return o +} + +// SetCredential adds the credential to the list project g k e zones params +func (o *ListProjectGKEZonesParams) SetCredential(credential *string) { + o.Credential = credential +} + +// WithServiceAccount adds the serviceAccount to the list project g k e zones params +func (o *ListProjectGKEZonesParams) WithServiceAccount(serviceAccount *string) *ListProjectGKEZonesParams { + o.SetServiceAccount(serviceAccount) + return o +} + +// SetServiceAccount adds the serviceAccount to the list project g k e zones params +func (o *ListProjectGKEZonesParams) SetServiceAccount(serviceAccount *string) { + o.ServiceAccount = serviceAccount +} + +// WithProjectID adds the projectID to the list project g k e zones params +func (o *ListProjectGKEZonesParams) WithProjectID(projectID string) *ListProjectGKEZonesParams { + o.SetProjectID(projectID) + return o +} + +// SetProjectID adds the projectId to the list project g k e zones params +func (o *ListProjectGKEZonesParams) SetProjectID(projectID string) { + o.ProjectID = projectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProjectGKEZonesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Credential != nil { + + // header param Credential + if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { + return err + } + } + + if o.ServiceAccount != nil { + + // header param ServiceAccount + if err := r.SetHeaderParam("ServiceAccount", *o.ServiceAccount); err != nil { + return err + } + } + + // path param project_id + if err := r.SetPathParam("project_id", o.ProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/gke/list_project_g_k_e_zones_responses.go b/client/gke/list_project_g_k_e_zones_responses.go new file mode 100644 index 00000000..382dcda5 --- /dev/null +++ b/client/gke/list_project_g_k_e_zones_responses.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/kubermatic/go-kubermatic/models" +) + +// ListProjectGKEZonesReader is a Reader for the ListProjectGKEZones structure. +type ListProjectGKEZonesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProjectGKEZonesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProjectGKEZonesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListProjectGKEZonesDefault(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 + } +} + +// NewListProjectGKEZonesOK creates a ListProjectGKEZonesOK with default headers values +func NewListProjectGKEZonesOK() *ListProjectGKEZonesOK { + return &ListProjectGKEZonesOK{} +} + +/* +ListProjectGKEZonesOK describes a response with status code 200, with default header values. + +GKEZoneList +*/ +type ListProjectGKEZonesOK struct { + Payload models.GKEZoneList +} + +// IsSuccess returns true when this list project g k e zones o k response has a 2xx status code +func (o *ListProjectGKEZonesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list project g k e zones o k response has a 3xx status code +func (o *ListProjectGKEZonesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list project g k e zones o k response has a 4xx status code +func (o *ListProjectGKEZonesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list project g k e zones o k response has a 5xx status code +func (o *ListProjectGKEZonesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list project g k e zones o k response a status code equal to that given +func (o *ListProjectGKEZonesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListProjectGKEZonesOK) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/zones][%d] listProjectGKEZonesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEZonesOK) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/zones][%d] listProjectGKEZonesOK %+v", 200, o.Payload) +} + +func (o *ListProjectGKEZonesOK) GetPayload() models.GKEZoneList { + return o.Payload +} + +func (o *ListProjectGKEZonesOK) 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 +} + +// NewListProjectGKEZonesDefault creates a ListProjectGKEZonesDefault with default headers values +func NewListProjectGKEZonesDefault(code int) *ListProjectGKEZonesDefault { + return &ListProjectGKEZonesDefault{ + _statusCode: code, + } +} + +/* +ListProjectGKEZonesDefault describes a response with status code -1, with default header values. + +errorResponse +*/ +type ListProjectGKEZonesDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the list project g k e zones default response +func (o *ListProjectGKEZonesDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this list project g k e zones default response has a 2xx status code +func (o *ListProjectGKEZonesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list project g k e zones default response has a 3xx status code +func (o *ListProjectGKEZonesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list project g k e zones default response has a 4xx status code +func (o *ListProjectGKEZonesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list project g k e zones default response has a 5xx status code +func (o *ListProjectGKEZonesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list project g k e zones default response a status code equal to that given +func (o *ListProjectGKEZonesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *ListProjectGKEZonesDefault) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/zones][%d] listProjectGKEZones default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEZonesDefault) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/zones][%d] listProjectGKEZones default %+v", o._statusCode, o.Payload) +} + +func (o *ListProjectGKEZonesDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ListProjectGKEZonesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/gke/validate_project_g_k_e_credentials_parameters.go b/client/gke/validate_project_g_k_e_credentials_parameters.go new file mode 100644 index 00000000..59a5bdc6 --- /dev/null +++ b/client/gke/validate_project_g_k_e_credentials_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// 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" +) + +// NewValidateProjectGKECredentialsParams creates a new ValidateProjectGKECredentialsParams 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 NewValidateProjectGKECredentialsParams() *ValidateProjectGKECredentialsParams { + return &ValidateProjectGKECredentialsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateProjectGKECredentialsParamsWithTimeout creates a new ValidateProjectGKECredentialsParams object +// with the ability to set a timeout on a request. +func NewValidateProjectGKECredentialsParamsWithTimeout(timeout time.Duration) *ValidateProjectGKECredentialsParams { + return &ValidateProjectGKECredentialsParams{ + timeout: timeout, + } +} + +// NewValidateProjectGKECredentialsParamsWithContext creates a new ValidateProjectGKECredentialsParams object +// with the ability to set a context for a request. +func NewValidateProjectGKECredentialsParamsWithContext(ctx context.Context) *ValidateProjectGKECredentialsParams { + return &ValidateProjectGKECredentialsParams{ + Context: ctx, + } +} + +// NewValidateProjectGKECredentialsParamsWithHTTPClient creates a new ValidateProjectGKECredentialsParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateProjectGKECredentialsParamsWithHTTPClient(client *http.Client) *ValidateProjectGKECredentialsParams { + return &ValidateProjectGKECredentialsParams{ + HTTPClient: client, + } +} + +/* +ValidateProjectGKECredentialsParams contains all the parameters to send to the API endpoint + + for the validate project g k e credentials operation. + + Typically these are written to a http.Request. +*/ +type ValidateProjectGKECredentialsParams struct { + + /* Credential. + + The credential name used in the preset for the GCP provider + */ + Credential *string + + /* ServiceAccount. + + The plain GCP service account + */ + ServiceAccount *string + + // ProjectID. + ProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate project g k e credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateProjectGKECredentialsParams) WithDefaults() *ValidateProjectGKECredentialsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate project g k e credentials params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateProjectGKECredentialsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) WithTimeout(timeout time.Duration) *ValidateProjectGKECredentialsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) WithContext(ctx context.Context) *ValidateProjectGKECredentialsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) WithHTTPClient(client *http.Client) *ValidateProjectGKECredentialsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCredential adds the credential to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) WithCredential(credential *string) *ValidateProjectGKECredentialsParams { + o.SetCredential(credential) + return o +} + +// SetCredential adds the credential to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) SetCredential(credential *string) { + o.Credential = credential +} + +// WithServiceAccount adds the serviceAccount to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) WithServiceAccount(serviceAccount *string) *ValidateProjectGKECredentialsParams { + o.SetServiceAccount(serviceAccount) + return o +} + +// SetServiceAccount adds the serviceAccount to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) SetServiceAccount(serviceAccount *string) { + o.ServiceAccount = serviceAccount +} + +// WithProjectID adds the projectID to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) WithProjectID(projectID string) *ValidateProjectGKECredentialsParams { + o.SetProjectID(projectID) + return o +} + +// SetProjectID adds the projectId to the validate project g k e credentials params +func (o *ValidateProjectGKECredentialsParams) SetProjectID(projectID string) { + o.ProjectID = projectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateProjectGKECredentialsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Credential != nil { + + // header param Credential + if err := r.SetHeaderParam("Credential", *o.Credential); err != nil { + return err + } + } + + if o.ServiceAccount != nil { + + // header param ServiceAccount + if err := r.SetHeaderParam("ServiceAccount", *o.ServiceAccount); err != nil { + return err + } + } + + // path param project_id + if err := r.SetPathParam("project_id", o.ProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/gke/validate_project_g_k_e_credentials_responses.go b/client/gke/validate_project_g_k_e_credentials_responses.go new file mode 100644 index 00000000..5e3d7703 --- /dev/null +++ b/client/gke/validate_project_g_k_e_credentials_responses.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package gke + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/kubermatic/go-kubermatic/models" +) + +// ValidateProjectGKECredentialsReader is a Reader for the ValidateProjectGKECredentials structure. +type ValidateProjectGKECredentialsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateProjectGKECredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateProjectGKECredentialsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewValidateProjectGKECredentialsDefault(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 + } +} + +// NewValidateProjectGKECredentialsOK creates a ValidateProjectGKECredentialsOK with default headers values +func NewValidateProjectGKECredentialsOK() *ValidateProjectGKECredentialsOK { + return &ValidateProjectGKECredentialsOK{} +} + +/* +ValidateProjectGKECredentialsOK describes a response with status code 200, with default header values. + +EmptyResponse is a empty response +*/ +type ValidateProjectGKECredentialsOK struct { +} + +// IsSuccess returns true when this validate project g k e credentials o k response has a 2xx status code +func (o *ValidateProjectGKECredentialsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate project g k e credentials o k response has a 3xx status code +func (o *ValidateProjectGKECredentialsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate project g k e credentials o k response has a 4xx status code +func (o *ValidateProjectGKECredentialsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate project g k e credentials o k response has a 5xx status code +func (o *ValidateProjectGKECredentialsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate project g k e credentials o k response a status code equal to that given +func (o *ValidateProjectGKECredentialsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ValidateProjectGKECredentialsOK) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/validatecredentials][%d] validateProjectGKECredentialsOK ", 200) +} + +func (o *ValidateProjectGKECredentialsOK) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/validatecredentials][%d] validateProjectGKECredentialsOK ", 200) +} + +func (o *ValidateProjectGKECredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewValidateProjectGKECredentialsDefault creates a ValidateProjectGKECredentialsDefault with default headers values +func NewValidateProjectGKECredentialsDefault(code int) *ValidateProjectGKECredentialsDefault { + return &ValidateProjectGKECredentialsDefault{ + _statusCode: code, + } +} + +/* +ValidateProjectGKECredentialsDefault describes a response with status code -1, with default header values. + +errorResponse +*/ +type ValidateProjectGKECredentialsDefault struct { + _statusCode int + + Payload *models.ErrorResponse +} + +// Code gets the status code for the validate project g k e credentials default response +func (o *ValidateProjectGKECredentialsDefault) Code() int { + return o._statusCode +} + +// IsSuccess returns true when this validate project g k e credentials default response has a 2xx status code +func (o *ValidateProjectGKECredentialsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this validate project g k e credentials default response has a 3xx status code +func (o *ValidateProjectGKECredentialsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this validate project g k e credentials default response has a 4xx status code +func (o *ValidateProjectGKECredentialsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this validate project g k e credentials default response has a 5xx status code +func (o *ValidateProjectGKECredentialsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this validate project g k e credentials default response a status code equal to that given +func (o *ValidateProjectGKECredentialsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +func (o *ValidateProjectGKECredentialsDefault) Error() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/validatecredentials][%d] validateProjectGKECredentials default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateProjectGKECredentialsDefault) String() string { + return fmt.Sprintf("[GET /api/v2/projects/{project_id}/providers/gke/validatecredentials][%d] validateProjectGKECredentials default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateProjectGKECredentialsDefault) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *ValidateProjectGKECredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +}