From eae70a6219b102025b667ebc1761512765c2befa Mon Sep 17 00:00:00 2001 From: Christian Staude Date: Wed, 6 Dec 2023 11:05:37 +0100 Subject: [PATCH] Fix client (#92) * go-swagger doesnt handle referenced enums well, spec was patched to get working code * make generate --- Makefile | 2 +- .../operations/app_roles_query_responses.go | 106 ++++++++- .../operations/app_roles_update_parameters.go | 14 +- .../operations/app_roles_update_responses.go | 203 ++++++++++++++++- .../organzation_groups_list_responses.go | 115 +++++++++- go/models/app_roles_query_o_k_body.go | 115 ---------- go/models/app_roles_query_o_k_body_all_of1.go | 50 ----- go/models/app_roles_update_o_k_body.go | 115 ---------- .../app_roles_update_o_k_body_all_of1.go | 50 ----- go/models/app_roles_update_params_body.go | 115 ---------- .../app_roles_update_params_body_all_of1.go | 50 ----- .../organzation_groups_list_o_k_body_items.go | 115 ---------- ...tion_groups_list_o_k_body_items_all_of1.go | 53 ----- go/models/v0_app_list_response_model.go | 33 +-- .../v0_app_list_response_model_paging.go | 93 -------- .../v0_app_webhook_list_response_model.go | 33 +-- ..._app_webhook_list_response_model_paging.go | 93 -------- .../v0_archived_build_list_response_model.go | 33 +-- ...chived_build_list_response_model_paging.go | 93 -------- go/models/v0_artifact_list_response_model.go | 33 +-- .../v0_artifact_list_response_model_paging.go | 93 -------- .../v0_bitrise_y_m_l_config_get_response.go | 76 ++++--- ...rise_y_m_l_config_get_response_location.go | 93 -------- .../v0_bitrise_y_m_l_config_update_params.go | 76 ++++--- ...ise_y_m_l_config_update_params_location.go | 94 -------- ...0_build_certificate_list_response_model.go | 33 +-- ..._certificate_list_response_model_paging.go | 93 -------- go/models/v0_build_list_all_response_model.go | 33 +-- ...v0_build_list_all_response_model_paging.go | 93 -------- go/models/v0_build_list_response_model.go | 33 +-- .../v0_build_list_response_model_paging.go | 93 -------- go/models/v0_build_trigger_params.go | 33 +-- .../v0_build_trigger_params_build_params.go | 204 +++++++++++++++--- ...ganization_update_machine_type_response.go | 42 +++- ...date_machine_type_response_errors_items.go | 53 ----- go/models/v0_pipeline_list_response_model.go | 33 +-- .../v0_pipeline_list_response_model_paging.go | 93 -------- ...roject_file_storage_list_response_model.go | 33 +-- ...file_storage_list_response_model_paging.go | 93 -------- ...0_provision_profile_list_response_model.go | 33 +-- ...sion_profile_list_response_model_paging.go | 93 -------- swagger.json | 25 +-- 42 files changed, 766 insertions(+), 2293 deletions(-) delete mode 100644 go/models/app_roles_query_o_k_body.go delete mode 100644 go/models/app_roles_query_o_k_body_all_of1.go delete mode 100644 go/models/app_roles_update_o_k_body.go delete mode 100644 go/models/app_roles_update_o_k_body_all_of1.go delete mode 100644 go/models/app_roles_update_params_body.go delete mode 100644 go/models/app_roles_update_params_body_all_of1.go delete mode 100644 go/models/organzation_groups_list_o_k_body_items.go delete mode 100644 go/models/organzation_groups_list_o_k_body_items_all_of1.go delete mode 100644 go/models/v0_app_list_response_model_paging.go delete mode 100644 go/models/v0_app_webhook_list_response_model_paging.go delete mode 100644 go/models/v0_archived_build_list_response_model_paging.go delete mode 100644 go/models/v0_artifact_list_response_model_paging.go delete mode 100644 go/models/v0_bitrise_y_m_l_config_get_response_location.go delete mode 100644 go/models/v0_bitrise_y_m_l_config_update_params_location.go delete mode 100644 go/models/v0_build_certificate_list_response_model_paging.go delete mode 100644 go/models/v0_build_list_all_response_model_paging.go delete mode 100644 go/models/v0_build_list_response_model_paging.go delete mode 100644 go/models/v0_organization_update_machine_type_response_errors_items.go delete mode 100644 go/models/v0_pipeline_list_response_model_paging.go delete mode 100644 go/models/v0_project_file_storage_list_response_model_paging.go delete mode 100644 go/models/v0_provision_profile_list_response_model_paging.go diff --git a/Makefile b/Makefile index dd4ef95..40df366 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ generate: clean ## Generate the API Go client and the JSON document for the UI --spec $(SWAGGER_SPEC) \ --target go \ --default-scheme=https \ - --with-flatten=full \ + --with-flatten=minimal \ --skip-tag-packages validate: ## Check that the swagger spec is valid. diff --git a/go/client/operations/app_roles_query_responses.go b/go/client/operations/app_roles_query_responses.go index 6822948..675ee0e 100644 --- a/go/client/operations/app_roles_query_responses.go +++ b/go/client/operations/app_roles_query_responses.go @@ -6,11 +6,14 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" "github.com/Staffbase/bitrise-api/go/models" ) @@ -51,7 +54,7 @@ AppRolesQueryOK describes a response with status code 200, with default header v List of group slugs */ type AppRolesQueryOK struct { - Payload *models.AppRolesQueryOKBody + Payload *AppRolesQueryOKBody } // IsSuccess returns true when this app roles query o k response has a 2xx status code @@ -92,13 +95,13 @@ func (o *AppRolesQueryOK) String() string { return fmt.Sprintf("[GET /apps/{app-slug}/roles/{role-name}][%d] appRolesQueryOK %+v", 200, o.Payload) } -func (o *AppRolesQueryOK) GetPayload() *models.AppRolesQueryOKBody { +func (o *AppRolesQueryOK) GetPayload() *AppRolesQueryOKBody { return o.Payload } func (o *AppRolesQueryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.AppRolesQueryOKBody) + o.Payload = new(AppRolesQueryOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -175,3 +178,100 @@ func (o *AppRolesQueryNotFound) readResponse(response runtime.ClientResponse, co return nil } + +/* +AppRolesQueryOKBody app roles query o k body +swagger:model AppRolesQueryOKBody +*/ +type AppRolesQueryOKBody struct { + AppRolesQueryOKBodyAllOf0 + + // groups + Groups []string `json:"groups"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (o *AppRolesQueryOKBody) UnmarshalJSON(raw []byte) error { + // AppRolesQueryOKBodyAO0 + var appRolesQueryOKBodyAO0 AppRolesQueryOKBodyAllOf0 + if err := swag.ReadJSON(raw, &appRolesQueryOKBodyAO0); err != nil { + return err + } + o.AppRolesQueryOKBodyAllOf0 = appRolesQueryOKBodyAO0 + + // AppRolesQueryOKBodyAO1 + var dataAppRolesQueryOKBodyAO1 struct { + Groups []string `json:"groups"` + } + if err := swag.ReadJSON(raw, &dataAppRolesQueryOKBodyAO1); err != nil { + return err + } + + o.Groups = dataAppRolesQueryOKBodyAO1.Groups + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (o AppRolesQueryOKBody) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + appRolesQueryOKBodyAO0, err := swag.WriteJSON(o.AppRolesQueryOKBodyAllOf0) + if err != nil { + return nil, err + } + _parts = append(_parts, appRolesQueryOKBodyAO0) + var dataAppRolesQueryOKBodyAO1 struct { + Groups []string `json:"groups"` + } + + dataAppRolesQueryOKBodyAO1.Groups = o.Groups + + jsonDataAppRolesQueryOKBodyAO1, errAppRolesQueryOKBodyAO1 := swag.WriteJSON(dataAppRolesQueryOKBodyAO1) + if errAppRolesQueryOKBodyAO1 != nil { + return nil, errAppRolesQueryOKBodyAO1 + } + _parts = append(_parts, jsonDataAppRolesQueryOKBodyAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this app roles query o k body +func (o *AppRolesQueryOKBody) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with AppRolesQueryOKBodyAllOf0 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this app roles query o k body based on context it is used +func (o *AppRolesQueryOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AppRolesQueryOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AppRolesQueryOKBody) UnmarshalBinary(b []byte) error { + var res AppRolesQueryOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AppRolesQueryOKBodyAllOf0 app roles query o k body all of0 +swagger:model AppRolesQueryOKBodyAllOf0 +*/ +type AppRolesQueryOKBodyAllOf0 interface{} diff --git a/go/client/operations/app_roles_update_parameters.go b/go/client/operations/app_roles_update_parameters.go index 1025d32..e2cc117 100644 --- a/go/client/operations/app_roles_update_parameters.go +++ b/go/client/operations/app_roles_update_parameters.go @@ -14,8 +14,6 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - - "github.com/Staffbase/bitrise-api/go/models" ) // NewAppRolesUpdateParams creates a new AppRolesUpdateParams object, @@ -73,7 +71,7 @@ type AppRolesUpdateParams struct { List of group slugs */ - Groups *models.AppRolesUpdateParamsBody + Groups AppRolesUpdateBody /* RoleName. @@ -146,13 +144,13 @@ func (o *AppRolesUpdateParams) SetAppSlug(appSlug string) { } // WithGroups adds the groups to the app roles update params -func (o *AppRolesUpdateParams) WithGroups(groups *models.AppRolesUpdateParamsBody) *AppRolesUpdateParams { +func (o *AppRolesUpdateParams) WithGroups(groups AppRolesUpdateBody) *AppRolesUpdateParams { o.SetGroups(groups) return o } // SetGroups adds the groups to the app roles update params -func (o *AppRolesUpdateParams) SetGroups(groups *models.AppRolesUpdateParamsBody) { +func (o *AppRolesUpdateParams) SetGroups(groups AppRolesUpdateBody) { o.Groups = groups } @@ -179,10 +177,8 @@ func (o *AppRolesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfm if err := r.SetPathParam("app-slug", o.AppSlug); err != nil { return err } - if o.Groups != nil { - if err := r.SetBodyParam(o.Groups); err != nil { - return err - } + if err := r.SetBodyParam(o.Groups); err != nil { + return err } // path param role-name diff --git a/go/client/operations/app_roles_update_responses.go b/go/client/operations/app_roles_update_responses.go index 2e2a343..51b2809 100644 --- a/go/client/operations/app_roles_update_responses.go +++ b/go/client/operations/app_roles_update_responses.go @@ -6,11 +6,14 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" "github.com/Staffbase/bitrise-api/go/models" ) @@ -51,7 +54,7 @@ AppRolesUpdateOK describes a response with status code 200, with default header List of group slugs */ type AppRolesUpdateOK struct { - Payload *models.AppRolesUpdateOKBody + Payload *AppRolesUpdateOKBody } // IsSuccess returns true when this app roles update o k response has a 2xx status code @@ -92,13 +95,13 @@ func (o *AppRolesUpdateOK) String() string { return fmt.Sprintf("[PUT /apps/{app-slug}/roles/{role-name}][%d] appRolesUpdateOK %+v", 200, o.Payload) } -func (o *AppRolesUpdateOK) GetPayload() *models.AppRolesUpdateOKBody { +func (o *AppRolesUpdateOK) GetPayload() *AppRolesUpdateOKBody { return o.Payload } func (o *AppRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.AppRolesUpdateOKBody) + o.Payload = new(AppRolesUpdateOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -175,3 +178,197 @@ func (o *AppRolesUpdateUnprocessableEntity) readResponse(response runtime.Client return nil } + +/* +AppRolesUpdateBody app roles update body +swagger:model AppRolesUpdateBody +*/ +type AppRolesUpdateBody struct { + AppRolesUpdateParamsBodyAllOf0 + + // groups + Groups []string `json:"groups"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (o *AppRolesUpdateBody) UnmarshalJSON(raw []byte) error { + // AppRolesUpdateParamsBodyAO0 + var appRolesUpdateParamsBodyAO0 AppRolesUpdateParamsBodyAllOf0 + if err := swag.ReadJSON(raw, &appRolesUpdateParamsBodyAO0); err != nil { + return err + } + o.AppRolesUpdateParamsBodyAllOf0 = appRolesUpdateParamsBodyAO0 + + // AppRolesUpdateParamsBodyAO1 + var dataAppRolesUpdateParamsBodyAO1 struct { + Groups []string `json:"groups"` + } + if err := swag.ReadJSON(raw, &dataAppRolesUpdateParamsBodyAO1); err != nil { + return err + } + + o.Groups = dataAppRolesUpdateParamsBodyAO1.Groups + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (o AppRolesUpdateBody) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + appRolesUpdateParamsBodyAO0, err := swag.WriteJSON(o.AppRolesUpdateParamsBodyAllOf0) + if err != nil { + return nil, err + } + _parts = append(_parts, appRolesUpdateParamsBodyAO0) + var dataAppRolesUpdateParamsBodyAO1 struct { + Groups []string `json:"groups"` + } + + dataAppRolesUpdateParamsBodyAO1.Groups = o.Groups + + jsonDataAppRolesUpdateParamsBodyAO1, errAppRolesUpdateParamsBodyAO1 := swag.WriteJSON(dataAppRolesUpdateParamsBodyAO1) + if errAppRolesUpdateParamsBodyAO1 != nil { + return nil, errAppRolesUpdateParamsBodyAO1 + } + _parts = append(_parts, jsonDataAppRolesUpdateParamsBodyAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this app roles update body +func (o *AppRolesUpdateBody) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with AppRolesUpdateParamsBodyAllOf0 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this app roles update body based on context it is used +func (o *AppRolesUpdateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AppRolesUpdateBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AppRolesUpdateBody) UnmarshalBinary(b []byte) error { + var res AppRolesUpdateBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AppRolesUpdateOKBody app roles update o k body +swagger:model AppRolesUpdateOKBody +*/ +type AppRolesUpdateOKBody struct { + AppRolesUpdateOKBodyAllOf0 + + // groups + Groups []string `json:"groups"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (o *AppRolesUpdateOKBody) UnmarshalJSON(raw []byte) error { + // AppRolesUpdateOKBodyAO0 + var appRolesUpdateOKBodyAO0 AppRolesUpdateOKBodyAllOf0 + if err := swag.ReadJSON(raw, &appRolesUpdateOKBodyAO0); err != nil { + return err + } + o.AppRolesUpdateOKBodyAllOf0 = appRolesUpdateOKBodyAO0 + + // AppRolesUpdateOKBodyAO1 + var dataAppRolesUpdateOKBodyAO1 struct { + Groups []string `json:"groups"` + } + if err := swag.ReadJSON(raw, &dataAppRolesUpdateOKBodyAO1); err != nil { + return err + } + + o.Groups = dataAppRolesUpdateOKBodyAO1.Groups + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (o AppRolesUpdateOKBody) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + appRolesUpdateOKBodyAO0, err := swag.WriteJSON(o.AppRolesUpdateOKBodyAllOf0) + if err != nil { + return nil, err + } + _parts = append(_parts, appRolesUpdateOKBodyAO0) + var dataAppRolesUpdateOKBodyAO1 struct { + Groups []string `json:"groups"` + } + + dataAppRolesUpdateOKBodyAO1.Groups = o.Groups + + jsonDataAppRolesUpdateOKBodyAO1, errAppRolesUpdateOKBodyAO1 := swag.WriteJSON(dataAppRolesUpdateOKBodyAO1) + if errAppRolesUpdateOKBodyAO1 != nil { + return nil, errAppRolesUpdateOKBodyAO1 + } + _parts = append(_parts, jsonDataAppRolesUpdateOKBodyAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this app roles update o k body +func (o *AppRolesUpdateOKBody) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with AppRolesUpdateOKBodyAllOf0 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this app roles update o k body based on context it is used +func (o *AppRolesUpdateOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AppRolesUpdateOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AppRolesUpdateOKBody) UnmarshalBinary(b []byte) error { + var res AppRolesUpdateOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AppRolesUpdateOKBodyAllOf0 app roles update o k body all of0 +swagger:model AppRolesUpdateOKBodyAllOf0 +*/ +type AppRolesUpdateOKBodyAllOf0 interface{} + +/* +AppRolesUpdateParamsBodyAllOf0 app roles update params body all of0 +swagger:model AppRolesUpdateParamsBodyAllOf0 +*/ +type AppRolesUpdateParamsBodyAllOf0 interface{} diff --git a/go/client/operations/organzation_groups_list_responses.go b/go/client/operations/organzation_groups_list_responses.go index 7ebf484..6009992 100644 --- a/go/client/operations/organzation_groups_list_responses.go +++ b/go/client/operations/organzation_groups_list_responses.go @@ -6,11 +6,14 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" "github.com/Staffbase/bitrise-api/go/models" ) @@ -51,7 +54,7 @@ OrganzationGroupsListOK describes a response with status code 200, with default list of groups */ type OrganzationGroupsListOK struct { - Payload []*models.OrganzationGroupsListOKBodyItems + Payload []*OrganzationGroupsListOKBodyItems0 } // IsSuccess returns true when this organzation groups list o k response has a 2xx status code @@ -92,7 +95,7 @@ func (o *OrganzationGroupsListOK) String() string { return fmt.Sprintf("[GET /organizations/{org-slug}/groups][%d] organzationGroupsListOK %+v", 200, o.Payload) } -func (o *OrganzationGroupsListOK) GetPayload() []*models.OrganzationGroupsListOKBodyItems { +func (o *OrganzationGroupsListOK) GetPayload() []*OrganzationGroupsListOKBodyItems0 { return o.Payload } @@ -173,3 +176,111 @@ func (o *OrganzationGroupsListNotFound) readResponse(response runtime.ClientResp return nil } + +/* +OrganzationGroupsListOKBodyItems0 organzation groups list o k body items0 +swagger:model OrganzationGroupsListOKBodyItems0 +*/ +type OrganzationGroupsListOKBodyItems0 struct { + OrganzationGroupsListOKBodyItems0AllOf0 + + // name + Name string `json:"name,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (o *OrganzationGroupsListOKBodyItems0) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 OrganzationGroupsListOKBodyItems0AllOf0 + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + o.OrganzationGroupsListOKBodyItems0AllOf0 = aO0 + + // AO1 + var dataAO1 struct { + Name string `json:"name,omitempty"` + + Slug string `json:"slug,omitempty"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + o.Name = dataAO1.Name + + o.Slug = dataAO1.Slug + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (o OrganzationGroupsListOKBodyItems0) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(o.OrganzationGroupsListOKBodyItems0AllOf0) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + Name string `json:"name,omitempty"` + + Slug string `json:"slug,omitempty"` + } + + dataAO1.Name = o.Name + + dataAO1.Slug = o.Slug + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this organzation groups list o k body items0 +func (o *OrganzationGroupsListOKBodyItems0) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with OrganzationGroupsListOKBodyItems0AllOf0 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this organzation groups list o k body items0 based on context it is used +func (o *OrganzationGroupsListOKBodyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *OrganzationGroupsListOKBodyItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *OrganzationGroupsListOKBodyItems0) UnmarshalBinary(b []byte) error { + var res OrganzationGroupsListOKBodyItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +OrganzationGroupsListOKBodyItems0AllOf0 organzation groups list o k body items0 all of0 +swagger:model OrganzationGroupsListOKBodyItems0AllOf0 +*/ +type OrganzationGroupsListOKBodyItems0AllOf0 interface{} diff --git a/go/models/app_roles_query_o_k_body.go b/go/models/app_roles_query_o_k_body.go deleted file mode 100644 index 473d744..0000000 --- a/go/models/app_roles_query_o_k_body.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AppRolesQueryOKBody app roles query o k body -// -// swagger:model appRolesQueryOKBody -type AppRolesQueryOKBody struct { - AppRolesQueryOKBodyAllOf0 - - AppRolesQueryOKBodyAllOf1 -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AppRolesQueryOKBody) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 AppRolesQueryOKBodyAllOf0 - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.AppRolesQueryOKBodyAllOf0 = aO0 - - // AO1 - var aO1 AppRolesQueryOKBodyAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.AppRolesQueryOKBodyAllOf1 = aO1 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AppRolesQueryOKBody) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.AppRolesQueryOKBodyAllOf0) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.AppRolesQueryOKBodyAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this app roles query o k body -func (m *AppRolesQueryOKBody) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AppRolesQueryOKBodyAllOf0 - // validation for a type composition with AppRolesQueryOKBodyAllOf1 - if err := m.AppRolesQueryOKBodyAllOf1.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this app roles query o k body based on the context it is used -func (m *AppRolesQueryOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AppRolesQueryOKBodyAllOf0 - // validation for a type composition with AppRolesQueryOKBodyAllOf1 - if err := m.AppRolesQueryOKBodyAllOf1.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *AppRolesQueryOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AppRolesQueryOKBody) UnmarshalBinary(b []byte) error { - var res AppRolesQueryOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// AppRolesQueryOKBodyAllOf0 app roles query o k body all of0 -// -// swagger:model AppRolesQueryOKBodyAllOf0 -type AppRolesQueryOKBodyAllOf0 interface{} diff --git a/go/models/app_roles_query_o_k_body_all_of1.go b/go/models/app_roles_query_o_k_body_all_of1.go deleted file mode 100644 index 041743e..0000000 --- a/go/models/app_roles_query_o_k_body_all_of1.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AppRolesQueryOKBodyAllOf1 app roles query o k body all of1 -// -// swagger:model appRolesQueryOKBodyAllOf1 -type AppRolesQueryOKBodyAllOf1 struct { - - // groups - Groups []string `json:"groups"` -} - -// Validate validates this app roles query o k body all of1 -func (m *AppRolesQueryOKBodyAllOf1) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this app roles query o k body all of1 based on context it is used -func (m *AppRolesQueryOKBodyAllOf1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AppRolesQueryOKBodyAllOf1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AppRolesQueryOKBodyAllOf1) UnmarshalBinary(b []byte) error { - var res AppRolesQueryOKBodyAllOf1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/app_roles_update_o_k_body.go b/go/models/app_roles_update_o_k_body.go deleted file mode 100644 index 7c8b37f..0000000 --- a/go/models/app_roles_update_o_k_body.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AppRolesUpdateOKBody app roles update o k body -// -// swagger:model appRolesUpdateOKBody -type AppRolesUpdateOKBody struct { - AppRolesUpdateOKBodyAllOf0 - - AppRolesUpdateOKBodyAllOf1 -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AppRolesUpdateOKBody) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 AppRolesUpdateOKBodyAllOf0 - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.AppRolesUpdateOKBodyAllOf0 = aO0 - - // AO1 - var aO1 AppRolesUpdateOKBodyAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.AppRolesUpdateOKBodyAllOf1 = aO1 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AppRolesUpdateOKBody) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.AppRolesUpdateOKBodyAllOf0) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.AppRolesUpdateOKBodyAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this app roles update o k body -func (m *AppRolesUpdateOKBody) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AppRolesUpdateOKBodyAllOf0 - // validation for a type composition with AppRolesUpdateOKBodyAllOf1 - if err := m.AppRolesUpdateOKBodyAllOf1.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this app roles update o k body based on the context it is used -func (m *AppRolesUpdateOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AppRolesUpdateOKBodyAllOf0 - // validation for a type composition with AppRolesUpdateOKBodyAllOf1 - if err := m.AppRolesUpdateOKBodyAllOf1.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *AppRolesUpdateOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AppRolesUpdateOKBody) UnmarshalBinary(b []byte) error { - var res AppRolesUpdateOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// AppRolesUpdateOKBodyAllOf0 app roles update o k body all of0 -// -// swagger:model AppRolesUpdateOKBodyAllOf0 -type AppRolesUpdateOKBodyAllOf0 interface{} diff --git a/go/models/app_roles_update_o_k_body_all_of1.go b/go/models/app_roles_update_o_k_body_all_of1.go deleted file mode 100644 index 64126fd..0000000 --- a/go/models/app_roles_update_o_k_body_all_of1.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AppRolesUpdateOKBodyAllOf1 app roles update o k body all of1 -// -// swagger:model appRolesUpdateOKBodyAllOf1 -type AppRolesUpdateOKBodyAllOf1 struct { - - // groups - Groups []string `json:"groups"` -} - -// Validate validates this app roles update o k body all of1 -func (m *AppRolesUpdateOKBodyAllOf1) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this app roles update o k body all of1 based on context it is used -func (m *AppRolesUpdateOKBodyAllOf1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AppRolesUpdateOKBodyAllOf1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AppRolesUpdateOKBodyAllOf1) UnmarshalBinary(b []byte) error { - var res AppRolesUpdateOKBodyAllOf1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/app_roles_update_params_body.go b/go/models/app_roles_update_params_body.go deleted file mode 100644 index 15189a4..0000000 --- a/go/models/app_roles_update_params_body.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AppRolesUpdateParamsBody app roles update params body -// -// swagger:model appRolesUpdateParamsBody -type AppRolesUpdateParamsBody struct { - AppRolesUpdateParamsBodyAllOf0 - - AppRolesUpdateParamsBodyAllOf1 -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AppRolesUpdateParamsBody) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 AppRolesUpdateParamsBodyAllOf0 - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.AppRolesUpdateParamsBodyAllOf0 = aO0 - - // AO1 - var aO1 AppRolesUpdateParamsBodyAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.AppRolesUpdateParamsBodyAllOf1 = aO1 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AppRolesUpdateParamsBody) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.AppRolesUpdateParamsBodyAllOf0) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.AppRolesUpdateParamsBodyAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this app roles update params body -func (m *AppRolesUpdateParamsBody) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AppRolesUpdateParamsBodyAllOf0 - // validation for a type composition with AppRolesUpdateParamsBodyAllOf1 - if err := m.AppRolesUpdateParamsBodyAllOf1.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this app roles update params body based on the context it is used -func (m *AppRolesUpdateParamsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AppRolesUpdateParamsBodyAllOf0 - // validation for a type composition with AppRolesUpdateParamsBodyAllOf1 - if err := m.AppRolesUpdateParamsBodyAllOf1.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *AppRolesUpdateParamsBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AppRolesUpdateParamsBody) UnmarshalBinary(b []byte) error { - var res AppRolesUpdateParamsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// AppRolesUpdateParamsBodyAllOf0 app roles update params body all of0 -// -// swagger:model AppRolesUpdateParamsBodyAllOf0 -type AppRolesUpdateParamsBodyAllOf0 interface{} diff --git a/go/models/app_roles_update_params_body_all_of1.go b/go/models/app_roles_update_params_body_all_of1.go deleted file mode 100644 index 3a42d91..0000000 --- a/go/models/app_roles_update_params_body_all_of1.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AppRolesUpdateParamsBodyAllOf1 app roles update params body all of1 -// -// swagger:model appRolesUpdateParamsBodyAllOf1 -type AppRolesUpdateParamsBodyAllOf1 struct { - - // groups - Groups []string `json:"groups"` -} - -// Validate validates this app roles update params body all of1 -func (m *AppRolesUpdateParamsBodyAllOf1) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this app roles update params body all of1 based on context it is used -func (m *AppRolesUpdateParamsBodyAllOf1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AppRolesUpdateParamsBodyAllOf1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AppRolesUpdateParamsBodyAllOf1) UnmarshalBinary(b []byte) error { - var res AppRolesUpdateParamsBodyAllOf1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/organzation_groups_list_o_k_body_items.go b/go/models/organzation_groups_list_o_k_body_items.go deleted file mode 100644 index 6719e9e..0000000 --- a/go/models/organzation_groups_list_o_k_body_items.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OrganzationGroupsListOKBodyItems organzation groups list o k body items -// -// swagger:model organzationGroupsListOKBodyItems -type OrganzationGroupsListOKBodyItems struct { - OrganzationGroupsListOKBodyItemsAllOf0 - - OrganzationGroupsListOKBodyItemsAllOf1 -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *OrganzationGroupsListOKBodyItems) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 OrganzationGroupsListOKBodyItemsAllOf0 - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.OrganzationGroupsListOKBodyItemsAllOf0 = aO0 - - // AO1 - var aO1 OrganzationGroupsListOKBodyItemsAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.OrganzationGroupsListOKBodyItemsAllOf1 = aO1 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m OrganzationGroupsListOKBodyItems) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.OrganzationGroupsListOKBodyItemsAllOf0) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.OrganzationGroupsListOKBodyItemsAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this organzation groups list o k body items -func (m *OrganzationGroupsListOKBodyItems) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with OrganzationGroupsListOKBodyItemsAllOf0 - // validation for a type composition with OrganzationGroupsListOKBodyItemsAllOf1 - if err := m.OrganzationGroupsListOKBodyItemsAllOf1.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this organzation groups list o k body items based on the context it is used -func (m *OrganzationGroupsListOKBodyItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with OrganzationGroupsListOKBodyItemsAllOf0 - // validation for a type composition with OrganzationGroupsListOKBodyItemsAllOf1 - if err := m.OrganzationGroupsListOKBodyItemsAllOf1.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *OrganzationGroupsListOKBodyItems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OrganzationGroupsListOKBodyItems) UnmarshalBinary(b []byte) error { - var res OrganzationGroupsListOKBodyItems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// OrganzationGroupsListOKBodyItemsAllOf0 organzation groups list o k body items all of0 -// -// swagger:model OrganzationGroupsListOKBodyItemsAllOf0 -type OrganzationGroupsListOKBodyItemsAllOf0 interface{} diff --git a/go/models/organzation_groups_list_o_k_body_items_all_of1.go b/go/models/organzation_groups_list_o_k_body_items_all_of1.go deleted file mode 100644 index a46a624..0000000 --- a/go/models/organzation_groups_list_o_k_body_items_all_of1.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OrganzationGroupsListOKBodyItemsAllOf1 organzation groups list o k body items all of1 -// -// swagger:model organzationGroupsListOKBodyItemsAllOf1 -type OrganzationGroupsListOKBodyItemsAllOf1 struct { - - // name - Name string `json:"name,omitempty"` - - // slug - Slug string `json:"slug,omitempty"` -} - -// Validate validates this organzation groups list o k body items all of1 -func (m *OrganzationGroupsListOKBodyItemsAllOf1) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this organzation groups list o k body items all of1 based on context it is used -func (m *OrganzationGroupsListOKBodyItemsAllOf1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OrganzationGroupsListOKBodyItemsAllOf1) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OrganzationGroupsListOKBodyItemsAllOf1) UnmarshalBinary(b []byte) error { - var res OrganzationGroupsListOKBodyItemsAllOf1 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_app_list_response_model.go b/go/models/v0_app_list_response_model.go index 5a4215c..e384800 100644 --- a/go/models/v0_app_list_response_model.go +++ b/go/models/v0_app_list_response_model.go @@ -22,8 +22,10 @@ type V0AppListResponseModel struct { // data Data []*V0AppResponseItemModel `json:"data"` - // paging - Paging *V0AppListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 app list response model @@ -75,17 +77,6 @@ func (m *V0AppListResponseModel) validatePaging(formats strfmt.Registry) error { return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0AppListResponseModel) contextValidateData(ctx context.Context, format func (m *V0AppListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_app_list_response_model_paging.go b/go/models/v0_app_list_response_model_paging.go deleted file mode 100644 index a4d386b..0000000 --- a/go/models/v0_app_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0AppListResponseModelPaging pagination -// -// swagger:model v0AppListResponseModelPaging -type V0AppListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0AppListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0AppListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 app list response model paging -func (m *V0AppListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 app list response model paging based on the context it is used -func (m *V0AppListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0AppListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0AppListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0AppListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_app_webhook_list_response_model.go b/go/models/v0_app_webhook_list_response_model.go index 4e9a865..f421af7 100644 --- a/go/models/v0_app_webhook_list_response_model.go +++ b/go/models/v0_app_webhook_list_response_model.go @@ -22,8 +22,10 @@ type V0AppWebhookListResponseModel struct { // data Data []*V0AppWebhookResponseItemModel `json:"data"` - // paging - Paging *V0AppWebhookListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 app webhook list response model @@ -75,17 +77,6 @@ func (m *V0AppWebhookListResponseModel) validatePaging(formats strfmt.Registry) return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0AppWebhookListResponseModel) contextValidateData(ctx context.Context, func (m *V0AppWebhookListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_app_webhook_list_response_model_paging.go b/go/models/v0_app_webhook_list_response_model_paging.go deleted file mode 100644 index 7bee2b9..0000000 --- a/go/models/v0_app_webhook_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0AppWebhookListResponseModelPaging pagination -// -// swagger:model v0AppWebhookListResponseModelPaging -type V0AppWebhookListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0AppWebhookListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0AppWebhookListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 app webhook list response model paging -func (m *V0AppWebhookListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 app webhook list response model paging based on the context it is used -func (m *V0AppWebhookListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0AppWebhookListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0AppWebhookListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0AppWebhookListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_archived_build_list_response_model.go b/go/models/v0_archived_build_list_response_model.go index 3d2f9b7..6a17c1f 100644 --- a/go/models/v0_archived_build_list_response_model.go +++ b/go/models/v0_archived_build_list_response_model.go @@ -22,8 +22,10 @@ type V0ArchivedBuildListResponseModel struct { // data Data []*V0ArchivedBuildResponseItemModel `json:"data"` - // paging - Paging *V0ArchivedBuildListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 archived build list response model @@ -75,17 +77,6 @@ func (m *V0ArchivedBuildListResponseModel) validatePaging(formats strfmt.Registr return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0ArchivedBuildListResponseModel) contextValidateData(ctx context.Conte func (m *V0ArchivedBuildListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_archived_build_list_response_model_paging.go b/go/models/v0_archived_build_list_response_model_paging.go deleted file mode 100644 index 3fce73c..0000000 --- a/go/models/v0_archived_build_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0ArchivedBuildListResponseModelPaging pagination -// -// swagger:model v0ArchivedBuildListResponseModelPaging -type V0ArchivedBuildListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0ArchivedBuildListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0ArchivedBuildListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 archived build list response model paging -func (m *V0ArchivedBuildListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 archived build list response model paging based on the context it is used -func (m *V0ArchivedBuildListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0ArchivedBuildListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0ArchivedBuildListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0ArchivedBuildListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_artifact_list_response_model.go b/go/models/v0_artifact_list_response_model.go index 5a20b2a..0148a6f 100644 --- a/go/models/v0_artifact_list_response_model.go +++ b/go/models/v0_artifact_list_response_model.go @@ -22,8 +22,10 @@ type V0ArtifactListResponseModel struct { // data Data []*V0ArtifactListElementResponseModel `json:"data"` - // paging - Paging *V0ArtifactListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 artifact list response model @@ -75,17 +77,6 @@ func (m *V0ArtifactListResponseModel) validatePaging(formats strfmt.Registry) er return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0ArtifactListResponseModel) contextValidateData(ctx context.Context, f func (m *V0ArtifactListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_artifact_list_response_model_paging.go b/go/models/v0_artifact_list_response_model_paging.go deleted file mode 100644 index 61dff4f..0000000 --- a/go/models/v0_artifact_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0ArtifactListResponseModelPaging pagination -// -// swagger:model v0ArtifactListResponseModelPaging -type V0ArtifactListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0ArtifactListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0ArtifactListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 artifact list response model paging -func (m *V0ArtifactListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 artifact list response model paging based on the context it is used -func (m *V0ArtifactListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0ArtifactListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0ArtifactListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0ArtifactListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_bitrise_y_m_l_config_get_response.go b/go/models/v0_bitrise_y_m_l_config_get_response.go index dae3fe9..d398cbd 100644 --- a/go/models/v0_bitrise_y_m_l_config_get_response.go +++ b/go/models/v0_bitrise_y_m_l_config_get_response.go @@ -7,10 +7,12 @@ package models import ( "context" + "encoding/json" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // V0BitriseYMLConfigGetResponse v0 bitrise y m l config get response @@ -18,8 +20,9 @@ import ( // swagger:model v0.BitriseYMLConfigGetResponse type V0BitriseYMLConfigGetResponse struct { - // location - Location *V0BitriseYMLConfigGetResponseLocation `json:"location,omitempty"` + // Location of bitrise.yml file. Enums(bitrise.io, repository) + // Enum: [bitrise.io repository] + Location string `json:"location,omitempty"` } // Validate validates this v0 bitrise y m l config get response @@ -36,60 +39,53 @@ func (m *V0BitriseYMLConfigGetResponse) Validate(formats strfmt.Registry) error return nil } -func (m *V0BitriseYMLConfigGetResponse) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(m.Location) { // not required - return nil - } +var v0BitriseYMLConfigGetResponseTypeLocationPropEnum []interface{} - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } +func init() { + var res []string + if err := json.Unmarshal([]byte(`["bitrise.io","repository"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + v0BitriseYMLConfigGetResponseTypeLocationPropEnum = append(v0BitriseYMLConfigGetResponseTypeLocationPropEnum, v) } - - return nil } -// ContextValidate validate this v0 bitrise y m l config get response based on the context it is used -func (m *V0BitriseYMLConfigGetResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +const ( - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } + // V0BitriseYMLConfigGetResponseLocationBitriseDotIo captures enum value "bitrise.io" + V0BitriseYMLConfigGetResponseLocationBitriseDotIo string = "bitrise.io" - if len(res) > 0 { - return errors.CompositeValidationError(res...) + // V0BitriseYMLConfigGetResponseLocationRepository captures enum value "repository" + V0BitriseYMLConfigGetResponseLocationRepository string = "repository" +) + +// prop value enum +func (m *V0BitriseYMLConfigGetResponse) validateLocationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, v0BitriseYMLConfigGetResponseTypeLocationPropEnum, true); err != nil { + return err } return nil } -func (m *V0BitriseYMLConfigGetResponse) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if swag.IsZero(m.Location) { // not required - return nil - } +func (m *V0BitriseYMLConfigGetResponse) validateLocation(formats strfmt.Registry) error { + if swag.IsZero(m.Location) { // not required + return nil + } - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } + // value enum + if err := m.validateLocationEnum("location", "body", m.Location); err != nil { + return err } return nil } +// ContextValidate validates this v0 bitrise y m l config get response based on context it is used +func (m *V0BitriseYMLConfigGetResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *V0BitriseYMLConfigGetResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/go/models/v0_bitrise_y_m_l_config_get_response_location.go b/go/models/v0_bitrise_y_m_l_config_get_response_location.go deleted file mode 100644 index 0e66320..0000000 --- a/go/models/v0_bitrise_y_m_l_config_get_response_location.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0BitriseYMLConfigGetResponseLocation Location of bitrise.yml file. Enums(bitrise.io, repository) -// -// swagger:model v0BitriseYMLConfigGetResponseLocation -type V0BitriseYMLConfigGetResponseLocation struct { - WebsiteBitriseYMLLocation -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0BitriseYMLConfigGetResponseLocation) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 WebsiteBitriseYMLLocation - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.WebsiteBitriseYMLLocation = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0BitriseYMLConfigGetResponseLocation) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.WebsiteBitriseYMLLocation) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 bitrise y m l config get response location -func (m *V0BitriseYMLConfigGetResponseLocation) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with WebsiteBitriseYMLLocation - if err := m.WebsiteBitriseYMLLocation.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 bitrise y m l config get response location based on the context it is used -func (m *V0BitriseYMLConfigGetResponseLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with WebsiteBitriseYMLLocation - if err := m.WebsiteBitriseYMLLocation.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0BitriseYMLConfigGetResponseLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0BitriseYMLConfigGetResponseLocation) UnmarshalBinary(b []byte) error { - var res V0BitriseYMLConfigGetResponseLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_bitrise_y_m_l_config_update_params.go b/go/models/v0_bitrise_y_m_l_config_update_params.go index 4d1aaa8..1f71f27 100644 --- a/go/models/v0_bitrise_y_m_l_config_update_params.go +++ b/go/models/v0_bitrise_y_m_l_config_update_params.go @@ -7,10 +7,12 @@ package models import ( "context" + "encoding/json" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // V0BitriseYMLConfigUpdateParams v0 bitrise y m l config update params @@ -18,8 +20,9 @@ import ( // swagger:model v0.BitriseYMLConfigUpdateParams type V0BitriseYMLConfigUpdateParams struct { - // location - Location *V0BitriseYMLConfigUpdateParamsLocation `json:"location,omitempty"` + // Location of bitrise.yml file. Enums(bitrise.io, repository) + // Enum: [bitrise.io repository] + Location string `json:"location,omitempty"` } // Validate validates this v0 bitrise y m l config update params @@ -36,60 +39,53 @@ func (m *V0BitriseYMLConfigUpdateParams) Validate(formats strfmt.Registry) error return nil } -func (m *V0BitriseYMLConfigUpdateParams) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(m.Location) { // not required - return nil - } +var v0BitriseYMLConfigUpdateParamsTypeLocationPropEnum []interface{} - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } +func init() { + var res []string + if err := json.Unmarshal([]byte(`["bitrise.io","repository"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + v0BitriseYMLConfigUpdateParamsTypeLocationPropEnum = append(v0BitriseYMLConfigUpdateParamsTypeLocationPropEnum, v) } - - return nil } -// ContextValidate validate this v0 bitrise y m l config update params based on the context it is used -func (m *V0BitriseYMLConfigUpdateParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error +const ( - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } + // V0BitriseYMLConfigUpdateParamsLocationBitriseDotIo captures enum value "bitrise.io" + V0BitriseYMLConfigUpdateParamsLocationBitriseDotIo string = "bitrise.io" - if len(res) > 0 { - return errors.CompositeValidationError(res...) + // V0BitriseYMLConfigUpdateParamsLocationRepository captures enum value "repository" + V0BitriseYMLConfigUpdateParamsLocationRepository string = "repository" +) + +// prop value enum +func (m *V0BitriseYMLConfigUpdateParams) validateLocationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, v0BitriseYMLConfigUpdateParamsTypeLocationPropEnum, true); err != nil { + return err } return nil } -func (m *V0BitriseYMLConfigUpdateParams) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if swag.IsZero(m.Location) { // not required - return nil - } +func (m *V0BitriseYMLConfigUpdateParams) validateLocation(formats strfmt.Registry) error { + if swag.IsZero(m.Location) { // not required + return nil + } - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } + // value enum + if err := m.validateLocationEnum("location", "body", m.Location); err != nil { + return err } return nil } +// ContextValidate validates this v0 bitrise y m l config update params based on context it is used +func (m *V0BitriseYMLConfigUpdateParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *V0BitriseYMLConfigUpdateParams) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/go/models/v0_bitrise_y_m_l_config_update_params_location.go b/go/models/v0_bitrise_y_m_l_config_update_params_location.go deleted file mode 100644 index 2506ee9..0000000 --- a/go/models/v0_bitrise_y_m_l_config_update_params_location.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0BitriseYMLConfigUpdateParamsLocation Location of bitrise.yml file. Enums(bitrise.io, repository) -// Example: repository -// -// swagger:model v0BitriseYMLConfigUpdateParamsLocation -type V0BitriseYMLConfigUpdateParamsLocation struct { - WebsiteBitriseYMLLocation -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0BitriseYMLConfigUpdateParamsLocation) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 WebsiteBitriseYMLLocation - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.WebsiteBitriseYMLLocation = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0BitriseYMLConfigUpdateParamsLocation) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.WebsiteBitriseYMLLocation) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 bitrise y m l config update params location -func (m *V0BitriseYMLConfigUpdateParamsLocation) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with WebsiteBitriseYMLLocation - if err := m.WebsiteBitriseYMLLocation.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 bitrise y m l config update params location based on the context it is used -func (m *V0BitriseYMLConfigUpdateParamsLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with WebsiteBitriseYMLLocation - if err := m.WebsiteBitriseYMLLocation.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0BitriseYMLConfigUpdateParamsLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0BitriseYMLConfigUpdateParamsLocation) UnmarshalBinary(b []byte) error { - var res V0BitriseYMLConfigUpdateParamsLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_build_certificate_list_response_model.go b/go/models/v0_build_certificate_list_response_model.go index 5b96bdb..beb9868 100644 --- a/go/models/v0_build_certificate_list_response_model.go +++ b/go/models/v0_build_certificate_list_response_model.go @@ -22,8 +22,10 @@ type V0BuildCertificateListResponseModel struct { // data Data []*V0BuildCertificateResponseItemModel `json:"data"` - // paging - Paging *V0BuildCertificateListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 build certificate list response model @@ -75,17 +77,6 @@ func (m *V0BuildCertificateListResponseModel) validatePaging(formats strfmt.Regi return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0BuildCertificateListResponseModel) contextValidateData(ctx context.Co func (m *V0BuildCertificateListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_build_certificate_list_response_model_paging.go b/go/models/v0_build_certificate_list_response_model_paging.go deleted file mode 100644 index 763705a..0000000 --- a/go/models/v0_build_certificate_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0BuildCertificateListResponseModelPaging pagination -// -// swagger:model v0BuildCertificateListResponseModelPaging -type V0BuildCertificateListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0BuildCertificateListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0BuildCertificateListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 build certificate list response model paging -func (m *V0BuildCertificateListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 build certificate list response model paging based on the context it is used -func (m *V0BuildCertificateListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0BuildCertificateListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0BuildCertificateListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0BuildCertificateListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_build_list_all_response_model.go b/go/models/v0_build_list_all_response_model.go index aafcef4..c275422 100644 --- a/go/models/v0_build_list_all_response_model.go +++ b/go/models/v0_build_list_all_response_model.go @@ -22,8 +22,10 @@ type V0BuildListAllResponseModel struct { // data Data []*V0BuildListAllResponseItemModel `json:"data"` - // paging - Paging *V0BuildListAllResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 build list all response model @@ -75,17 +77,6 @@ func (m *V0BuildListAllResponseModel) validatePaging(formats strfmt.Registry) er return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0BuildListAllResponseModel) contextValidateData(ctx context.Context, f func (m *V0BuildListAllResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_build_list_all_response_model_paging.go b/go/models/v0_build_list_all_response_model_paging.go deleted file mode 100644 index 9b33822..0000000 --- a/go/models/v0_build_list_all_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0BuildListAllResponseModelPaging pagination -// -// swagger:model v0BuildListAllResponseModelPaging -type V0BuildListAllResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0BuildListAllResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0BuildListAllResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 build list all response model paging -func (m *V0BuildListAllResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 build list all response model paging based on the context it is used -func (m *V0BuildListAllResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0BuildListAllResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0BuildListAllResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0BuildListAllResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_build_list_response_model.go b/go/models/v0_build_list_response_model.go index 7faeecc..a7b63a6 100644 --- a/go/models/v0_build_list_response_model.go +++ b/go/models/v0_build_list_response_model.go @@ -22,8 +22,10 @@ type V0BuildListResponseModel struct { // data Data []*V0BuildResponseItemModel `json:"data"` - // paging - Paging *V0BuildListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 build list response model @@ -75,17 +77,6 @@ func (m *V0BuildListResponseModel) validatePaging(formats strfmt.Registry) error return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0BuildListResponseModel) contextValidateData(ctx context.Context, form func (m *V0BuildListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_build_list_response_model_paging.go b/go/models/v0_build_list_response_model_paging.go deleted file mode 100644 index d40d296..0000000 --- a/go/models/v0_build_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0BuildListResponseModelPaging pagination -// -// swagger:model v0BuildListResponseModelPaging -type V0BuildListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0BuildListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0BuildListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 build list response model paging -func (m *V0BuildListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 build list response model paging based on the context it is used -func (m *V0BuildListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0BuildListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0BuildListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0BuildListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_build_trigger_params.go b/go/models/v0_build_trigger_params.go index 6285731..4ab42e2 100644 --- a/go/models/v0_build_trigger_params.go +++ b/go/models/v0_build_trigger_params.go @@ -18,8 +18,10 @@ import ( // swagger:model v0.BuildTriggerParams type V0BuildTriggerParams struct { - // build params - BuildParams *V0BuildTriggerParamsBuildParams `json:"build_params,omitempty"` + // The public part of the SSH key you would like to use + BuildParams struct { + V0BuildTriggerParamsBuildParams + } `json:"build_params,omitempty"` // hook info HookInfo *V0BuildTriggerParamsHookInfo `json:"hook_info,omitempty"` @@ -48,17 +50,6 @@ func (m *V0BuildTriggerParams) validateBuildParams(formats strfmt.Registry) erro return nil } - if m.BuildParams != nil { - if err := m.BuildParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("build_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("build_params") - } - return err - } - } - return nil } @@ -101,22 +92,6 @@ func (m *V0BuildTriggerParams) ContextValidate(ctx context.Context, formats strf func (m *V0BuildTriggerParams) contextValidateBuildParams(ctx context.Context, formats strfmt.Registry) error { - if m.BuildParams != nil { - - if swag.IsZero(m.BuildParams) { // not required - return nil - } - - if err := m.BuildParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("build_params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("build_params") - } - return err - } - } - return nil } diff --git a/go/models/v0_build_trigger_params_build_params.go b/go/models/v0_build_trigger_params_build_params.go index 3841848..6599a34 100644 --- a/go/models/v0_build_trigger_params_build_params.go +++ b/go/models/v0_build_trigger_params_build_params.go @@ -7,49 +7,94 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// V0BuildTriggerParamsBuildParams The public part of the SSH key you would like to use +// V0BuildTriggerParamsBuildParams v0 build trigger params build params // -// swagger:model v0BuildTriggerParamsBuildParams +// swagger:model v0.BuildTriggerParamsBuildParams type V0BuildTriggerParamsBuildParams struct { - *V0BuildTriggerParamsBuildParams -} -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0BuildTriggerParamsBuildParams) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0BuildTriggerParamsBuildParams - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0BuildTriggerParamsBuildParams = &aO0 + // base repository url + BaseRepositoryURL string `json:"base_repository_url,omitempty"` - return nil -} + // branch + Branch string `json:"branch,omitempty"` -// MarshalJSON marshals this object to a JSON structure -func (m V0BuildTriggerParamsBuildParams) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) + // branch dest + BranchDest string `json:"branch_dest,omitempty"` - aO0, err := swag.WriteJSON(m.V0BuildTriggerParamsBuildParams) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil + // branch dest repo owner + BranchDestRepoOwner string `json:"branch_dest_repo_owner,omitempty"` + + // branch repo owner + BranchRepoOwner string `json:"branch_repo_owner,omitempty"` + + // build request slug + BuildRequestSlug string `json:"build_request_slug,omitempty"` + + // commit hash + CommitHash string `json:"commit_hash,omitempty"` + + // commit message + CommitMessage string `json:"commit_message,omitempty"` + + // commit paths + CommitPaths []*V0CommitPaths `json:"commit_paths"` + + // diff url + DiffURL string `json:"diff_url,omitempty"` + + // environments + Environments []*V0BuildParamsEnvironment `json:"environments"` + + // head repository url + HeadRepositoryURL string `json:"head_repository_url,omitempty"` + + // pipeline id + PipelineID string `json:"pipeline_id,omitempty"` + + // pull request author + PullRequestAuthor string `json:"pull_request_author,omitempty"` + + // pull request head branch + PullRequestHeadBranch string `json:"pull_request_head_branch,omitempty"` + + // pull request id + PullRequestID interface{} `json:"pull_request_id,omitempty"` + + // pull request merge branch + PullRequestMergeBranch string `json:"pull_request_merge_branch,omitempty"` + + // pull request repository url + PullRequestRepositoryURL string `json:"pull_request_repository_url,omitempty"` + + // pull request unverified merge branch + PullRequestUnverifiedMergeBranch string `json:"pull_request_unverified_merge_branch,omitempty"` + + // skip git status report + SkipGitStatusReport bool `json:"skip_git_status_report,omitempty"` + + // tag + Tag string `json:"tag,omitempty"` + + // workflow id + WorkflowID string `json:"workflow_id,omitempty"` } // Validate validates this v0 build trigger params build params func (m *V0BuildTriggerParamsBuildParams) Validate(formats strfmt.Registry) error { var res []error - // validation for a type composition with V0BuildTriggerParamsBuildParams - if err := m.V0BuildTriggerParamsBuildParams.Validate(formats); err != nil { + if err := m.validateCommitPaths(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironments(formats); err != nil { res = append(res, err) } @@ -59,12 +104,67 @@ func (m *V0BuildTriggerParamsBuildParams) Validate(formats strfmt.Registry) erro return nil } +func (m *V0BuildTriggerParamsBuildParams) validateCommitPaths(formats strfmt.Registry) error { + if swag.IsZero(m.CommitPaths) { // not required + return nil + } + + for i := 0; i < len(m.CommitPaths); i++ { + if swag.IsZero(m.CommitPaths[i]) { // not required + continue + } + + if m.CommitPaths[i] != nil { + if err := m.CommitPaths[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("commit_paths" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("commit_paths" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *V0BuildTriggerParamsBuildParams) validateEnvironments(formats strfmt.Registry) error { + if swag.IsZero(m.Environments) { // not required + return nil + } + + for i := 0; i < len(m.Environments); i++ { + if swag.IsZero(m.Environments[i]) { // not required + continue + } + + if m.Environments[i] != nil { + if err := m.Environments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this v0 build trigger params build params based on the context it is used func (m *V0BuildTriggerParamsBuildParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - // validation for a type composition with V0BuildTriggerParamsBuildParams - if err := m.V0BuildTriggerParamsBuildParams.ContextValidate(ctx, formats); err != nil { + if err := m.contextValidateCommitPaths(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEnvironments(ctx, formats); err != nil { res = append(res, err) } @@ -74,6 +174,56 @@ func (m *V0BuildTriggerParamsBuildParams) ContextValidate(ctx context.Context, f return nil } +func (m *V0BuildTriggerParamsBuildParams) contextValidateCommitPaths(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CommitPaths); i++ { + + if m.CommitPaths[i] != nil { + + if swag.IsZero(m.CommitPaths[i]) { // not required + return nil + } + + if err := m.CommitPaths[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("commit_paths" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("commit_paths" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *V0BuildTriggerParamsBuildParams) contextValidateEnvironments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Environments); i++ { + + if m.Environments[i] != nil { + + if swag.IsZero(m.Environments[i]) { // not required + return nil + } + + if err := m.Environments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *V0BuildTriggerParamsBuildParams) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/go/models/v0_organization_update_machine_type_response.go b/go/models/v0_organization_update_machine_type_response.go index b7db19e..a91d58e 100644 --- a/go/models/v0_organization_update_machine_type_response.go +++ b/go/models/v0_organization_update_machine_type_response.go @@ -20,7 +20,7 @@ import ( type V0OrganizationUpdateMachineTypeResponse struct { // errors - Errors []*V0OrganizationUpdateMachineTypeResponseErrorsItems `json:"errors"` + Errors []*V0OrganizationUpdateMachineTypeResponseErrorsItems0 `json:"errors"` // The result of the migration Message string `json:"message,omitempty"` @@ -125,3 +125,43 @@ func (m *V0OrganizationUpdateMachineTypeResponse) UnmarshalBinary(b []byte) erro *m = res return nil } + +// V0OrganizationUpdateMachineTypeResponseErrorsItems0 v0 organization update machine type response errors items0 +// +// swagger:model V0OrganizationUpdateMachineTypeResponseErrorsItems0 +type V0OrganizationUpdateMachineTypeResponseErrorsItems0 struct { + + // The apps which had an error's identifiers in the following format "#{app.title} (#{app.slug})" + App string `json:"app,omitempty"` + + // error + Error string `json:"error,omitempty"` +} + +// Validate validates this v0 organization update machine type response errors items0 +func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this v0 organization update machine type response errors items0 based on context it is used +func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems0) UnmarshalBinary(b []byte) error { + var res V0OrganizationUpdateMachineTypeResponseErrorsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/go/models/v0_organization_update_machine_type_response_errors_items.go b/go/models/v0_organization_update_machine_type_response_errors_items.go deleted file mode 100644 index df1e64c..0000000 --- a/go/models/v0_organization_update_machine_type_response_errors_items.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0OrganizationUpdateMachineTypeResponseErrorsItems v0 organization update machine type response errors items -// -// swagger:model v0OrganizationUpdateMachineTypeResponseErrorsItems -type V0OrganizationUpdateMachineTypeResponseErrorsItems struct { - - // The apps which had an error's identifiers in the following format "#{app.title} (#{app.slug})" - App string `json:"app,omitempty"` - - // error - Error string `json:"error,omitempty"` -} - -// Validate validates this v0 organization update machine type response errors items -func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this v0 organization update machine type response errors items based on context it is used -func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0OrganizationUpdateMachineTypeResponseErrorsItems) UnmarshalBinary(b []byte) error { - var res V0OrganizationUpdateMachineTypeResponseErrorsItems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_pipeline_list_response_model.go b/go/models/v0_pipeline_list_response_model.go index b95ef95..00b3825 100644 --- a/go/models/v0_pipeline_list_response_model.go +++ b/go/models/v0_pipeline_list_response_model.go @@ -22,8 +22,10 @@ type V0PipelineListResponseModel struct { // data Data []*V0PipelineListResponseItemModel `json:"data"` - // paging - Paging *V0PipelineListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 pipeline list response model @@ -75,17 +77,6 @@ func (m *V0PipelineListResponseModel) validatePaging(formats strfmt.Registry) er return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0PipelineListResponseModel) contextValidateData(ctx context.Context, f func (m *V0PipelineListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_pipeline_list_response_model_paging.go b/go/models/v0_pipeline_list_response_model_paging.go deleted file mode 100644 index 9457d9c..0000000 --- a/go/models/v0_pipeline_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0PipelineListResponseModelPaging pagination -// -// swagger:model v0PipelineListResponseModelPaging -type V0PipelineListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0PipelineListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0PipelineListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 pipeline list response model paging -func (m *V0PipelineListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 pipeline list response model paging based on the context it is used -func (m *V0PipelineListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0PipelineListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0PipelineListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0PipelineListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_project_file_storage_list_response_model.go b/go/models/v0_project_file_storage_list_response_model.go index 2d2dece..2144e86 100644 --- a/go/models/v0_project_file_storage_list_response_model.go +++ b/go/models/v0_project_file_storage_list_response_model.go @@ -22,8 +22,10 @@ type V0ProjectFileStorageListResponseModel struct { // data Data []*V0ProjectFileStorageResponseItemModel `json:"data"` - // paging - Paging *V0ProjectFileStorageListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 project file storage list response model @@ -75,17 +77,6 @@ func (m *V0ProjectFileStorageListResponseModel) validatePaging(formats strfmt.Re return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0ProjectFileStorageListResponseModel) contextValidateData(ctx context. func (m *V0ProjectFileStorageListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_project_file_storage_list_response_model_paging.go b/go/models/v0_project_file_storage_list_response_model_paging.go deleted file mode 100644 index 231cb6e..0000000 --- a/go/models/v0_project_file_storage_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0ProjectFileStorageListResponseModelPaging pagination -// -// swagger:model v0ProjectFileStorageListResponseModelPaging -type V0ProjectFileStorageListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0ProjectFileStorageListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0ProjectFileStorageListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 project file storage list response model paging -func (m *V0ProjectFileStorageListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 project file storage list response model paging based on the context it is used -func (m *V0ProjectFileStorageListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0ProjectFileStorageListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0ProjectFileStorageListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0ProjectFileStorageListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/go/models/v0_provision_profile_list_response_model.go b/go/models/v0_provision_profile_list_response_model.go index ef92dbe..b775889 100644 --- a/go/models/v0_provision_profile_list_response_model.go +++ b/go/models/v0_provision_profile_list_response_model.go @@ -22,8 +22,10 @@ type V0ProvisionProfileListResponseModel struct { // data Data []*V0ProvisionProfileResponseItemModel `json:"data"` - // paging - Paging *V0ProvisionProfileListResponseModelPaging `json:"paging,omitempty"` + // pagination + Paging struct { + V0PagingResponseModel + } `json:"paging,omitempty"` } // Validate validates this v0 provision profile list response model @@ -75,17 +77,6 @@ func (m *V0ProvisionProfileListResponseModel) validatePaging(formats strfmt.Regi return nil } - if m.Paging != nil { - if err := m.Paging.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } @@ -134,22 +125,6 @@ func (m *V0ProvisionProfileListResponseModel) contextValidateData(ctx context.Co func (m *V0ProvisionProfileListResponseModel) contextValidatePaging(ctx context.Context, formats strfmt.Registry) error { - if m.Paging != nil { - - if swag.IsZero(m.Paging) { // not required - return nil - } - - if err := m.Paging.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paging") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paging") - } - return err - } - } - return nil } diff --git a/go/models/v0_provision_profile_list_response_model_paging.go b/go/models/v0_provision_profile_list_response_model_paging.go deleted file mode 100644 index 38bab17..0000000 --- a/go/models/v0_provision_profile_list_response_model_paging.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// V0ProvisionProfileListResponseModelPaging pagination -// -// swagger:model v0ProvisionProfileListResponseModelPaging -type V0ProvisionProfileListResponseModelPaging struct { - V0PagingResponseModel -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *V0ProvisionProfileListResponseModelPaging) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 V0PagingResponseModel - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.V0PagingResponseModel = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m V0ProvisionProfileListResponseModelPaging) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.V0PagingResponseModel) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this v0 provision profile list response model paging -func (m *V0ProvisionProfileListResponseModelPaging) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v0 provision profile list response model paging based on the context it is used -func (m *V0ProvisionProfileListResponseModelPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with V0PagingResponseModel - if err := m.V0PagingResponseModel.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *V0ProvisionProfileListResponseModelPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *V0ProvisionProfileListResponseModelPaging) UnmarshalBinary(b []byte) error { - var res V0ProvisionProfileListResponseModelPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/swagger.json b/swagger.json index ccb7c6a..dcea888 100644 --- a/swagger.json +++ b/swagger.json @@ -7833,12 +7833,12 @@ "type": "object", "properties": { "location": { + "enum": [ + "bitrise.io", + "repository" + ], "description": "Location of bitrise.yml file. Enums(bitrise.io, repository)", - "allOf": [ - { - "$ref": "#/definitions/website.BitriseYMLLocation" - } - ] + "type": "string" } } }, @@ -7846,13 +7846,12 @@ "type": "object", "properties": { "location": { - "description": "Location of bitrise.yml file. Enums(bitrise.io, repository)", - "allOf": [ - { - "$ref": "#/definitions/website.BitriseYMLLocation" - } + "enum": [ + "bitrise.io", + "repository" ], - "example": "repository" + "description": "Location of bitrise.yml file. Enums(bitrise.io, repository)", + "type": "string" } } }, @@ -9583,10 +9582,6 @@ "enum": [ "bitrise.io", "repository" - ], - "x-enum-varnames": [ - "LocationBitriseIo", - "LocationRepository" ] } },