diff --git a/CHANGELOG.md b/CHANGELOG.md index 5188c95887..d6d3e944f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,10 @@ - [v0.14.0](services/edge/CHANGELOG.md#v0140) - **Breaking change**: Removal of deprecated compatibility layer previously found in the root of the SDK module - `functions`: + - [v0.2.0](services/functions/CHANGELOG.md#v020) + - `v1alphaapi`: + - **Feature**: New `MaxScale` field in `ResourceLimits` model + - **Breaking Change**: Renamed API method `CreateFunctionRevision` to `CreateRevision` and models `CreateFunctionRevisionPayload`/`CreateFunctionRevisionPayloadState` to `CreateRevisionPayload`/`CreateRevisionPayloadState` - [v0.1.0](services/functions/CHANGELOG.md#v010) - `v1alphaapi`: - **Feature**: initial release diff --git a/examples/functions/functions.go b/examples/functions/functions.go index 26cdba1045..22f13f6a06 100644 --- a/examples/functions/functions.go +++ b/examples/functions/functions.go @@ -82,8 +82,8 @@ func main() { } // Create function revision deployment - revisionData := *functions.NewCreateFunctionRevisionPayload(*functions.NewResourceLimits(100, "f2"), "ghcr.io/stackitcloud/example-image:0.1.0") - functionRevision, err := functionsClient.DefaultAPI.CreateFunctionRevision(context.Background(), projectId, *function.Id).CreateFunctionRevisionPayload(revisionData).Execute() + revisionData := *functions.NewCreateRevisionPayload(*functions.NewResourceLimits(100, "f2"), "ghcr.io/stackitcloud/example-image:0.1.0") + functionRevision, err := functionsClient.DefaultAPI.CreateRevision(context.Background(), projectId, *function.Id).CreateRevisionPayload(revisionData).Execute() if err != nil || functionRevision.Id == nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateFunctionRevision`: %v\n", err) os.Exit(1) diff --git a/services/functions/CHANGELOG.md b/services/functions/CHANGELOG.md index 426c759900..4e96778525 100644 --- a/services/functions/CHANGELOG.md +++ b/services/functions/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.2.0 +- Package `v1alphaapi`: + - **Feature**: New `MaxScale` field in `ResourceLimits` model to configure the maximum number of running instances + - **Breaking Change**: Renamed API method `CreateFunctionRevision` to `CreateRevision` (including request type `ApiCreateFunctionRevisionRequest` to `ApiCreateRevisionRequest`) + - **Breaking Change**: Renamed models `CreateFunctionRevisionPayload` to `CreateRevisionPayload` and `CreateFunctionRevisionPayloadState` to `CreateRevisionPayloadState` + ## v0.1.0 - Package `v1alphaapi`: - **Feature**: initial release diff --git a/services/functions/VERSION b/services/functions/VERSION index 9ff151c5b3..81fd7ba087 100644 --- a/services/functions/VERSION +++ b/services/functions/VERSION @@ -1 +1 @@ -v0.1.0 \ No newline at end of file +v0.2.0 \ No newline at end of file diff --git a/services/functions/oas_commit b/services/functions/oas_commit index a648e2a2f5..ed3614a237 100644 --- a/services/functions/oas_commit +++ b/services/functions/oas_commit @@ -1 +1 @@ -44a901bdd528890908c0d4bd761e16115ee9ed5b +6c5332d5f71263507049f2f2ef036fe07937b63a diff --git a/services/functions/v1alphaapi/api_default.go b/services/functions/v1alphaapi/api_default.go index b02bebac77..f78fe4efed 100644 --- a/services/functions/v1alphaapi/api_default.go +++ b/services/functions/v1alphaapi/api_default.go @@ -39,35 +39,35 @@ type DefaultAPI interface { CreateFunctionExecute(r ApiCreateFunctionRequest) (*Function, error) /* - CreateFunctionRevision Method for CreateFunctionRevision + CreatePullCredential Create OCI image registry pull credential definition - Create a new function revision + Create a new OCI image registry pull credential configuration. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT portal project UUID the resource is located in. - @param functionId The STACKIT Functions functionId - @return ApiCreateFunctionRevisionRequest + @return ApiCreatePullCredentialRequest */ - CreateFunctionRevision(ctx context.Context, projectId string, functionId string) ApiCreateFunctionRevisionRequest + CreatePullCredential(ctx context.Context, projectId string) ApiCreatePullCredentialRequest - // CreateFunctionRevisionExecute executes the request - // @return Revision - CreateFunctionRevisionExecute(r ApiCreateFunctionRevisionRequest) (*Revision, error) + // CreatePullCredentialExecute executes the request + // @return PullCredential + CreatePullCredentialExecute(r ApiCreatePullCredentialRequest) (*PullCredential, error) /* - CreatePullCredential Create OCI image registry pull credential definition + CreateRevision Method for CreateRevision - Create a new OCI image registry pull credential configuration. + Create a new function revision @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT portal project UUID the resource is located in. - @return ApiCreatePullCredentialRequest + @param functionId The STACKIT Functions functionId + @return ApiCreateRevisionRequest */ - CreatePullCredential(ctx context.Context, projectId string) ApiCreatePullCredentialRequest + CreateRevision(ctx context.Context, projectId string, functionId string) ApiCreateRevisionRequest - // CreatePullCredentialExecute executes the request - // @return PullCredential - CreatePullCredentialExecute(r ApiCreatePullCredentialRequest) (*PullCredential, error) + // CreateRevisionExecute executes the request + // @return Revision + CreateRevisionExecute(r ApiCreateRevisionRequest) (*Revision, error) /* DeleteFunction Method for DeleteFunction @@ -421,67 +421,63 @@ func (a *DefaultAPIService) CreateFunctionExecute(r ApiCreateFunctionRequest) (* return localVarReturnValue, nil } -type ApiCreateFunctionRevisionRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - functionId string - createFunctionRevisionPayload *CreateFunctionRevisionPayload +type ApiCreatePullCredentialRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createPullCredentialPayload *CreatePullCredentialPayload } -func (r ApiCreateFunctionRevisionRequest) CreateFunctionRevisionPayload(createFunctionRevisionPayload CreateFunctionRevisionPayload) ApiCreateFunctionRevisionRequest { - r.createFunctionRevisionPayload = &createFunctionRevisionPayload +func (r ApiCreatePullCredentialRequest) CreatePullCredentialPayload(createPullCredentialPayload CreatePullCredentialPayload) ApiCreatePullCredentialRequest { + r.createPullCredentialPayload = &createPullCredentialPayload return r } -func (r ApiCreateFunctionRevisionRequest) Execute() (*Revision, error) { - return r.ApiService.CreateFunctionRevisionExecute(r) +func (r ApiCreatePullCredentialRequest) Execute() (*PullCredential, error) { + return r.ApiService.CreatePullCredentialExecute(r) } /* -CreateFunctionRevision Method for CreateFunctionRevision +CreatePullCredential Create OCI image registry pull credential definition -Create a new function revision +Create a new OCI image registry pull credential configuration. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT portal project UUID the resource is located in. - @param functionId The STACKIT Functions functionId - @return ApiCreateFunctionRevisionRequest + @return ApiCreatePullCredentialRequest */ -func (a *DefaultAPIService) CreateFunctionRevision(ctx context.Context, projectId string, functionId string) ApiCreateFunctionRevisionRequest { - return ApiCreateFunctionRevisionRequest{ +func (a *DefaultAPIService) CreatePullCredential(ctx context.Context, projectId string) ApiCreatePullCredentialRequest { + return ApiCreatePullCredentialRequest{ ApiService: a, ctx: ctx, projectId: projectId, - functionId: functionId, } } // Execute executes the request // -// @return Revision -func (a *DefaultAPIService) CreateFunctionRevisionExecute(r ApiCreateFunctionRevisionRequest) (*Revision, error) { +// @return PullCredential +func (a *DefaultAPIService) CreatePullCredentialExecute(r ApiCreatePullCredentialRequest) (*PullCredential, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Revision + localVarReturnValue *PullCredential ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateFunctionRevision") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreatePullCredential") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/functions/{functionId}/revisions" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/pull-credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"functionId"+"}", url.PathEscape(parameterValueToString(r.functionId, "functionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createFunctionRevisionPayload == nil { - return localVarReturnValue, reportError("createFunctionRevisionPayload is required and must be specified") + if r.createPullCredentialPayload == nil { + return localVarReturnValue, reportError("createPullCredentialPayload is required and must be specified") } // to determine the Content-Type header @@ -502,7 +498,7 @@ func (a *DefaultAPIService) CreateFunctionRevisionExecute(r ApiCreateFunctionRev localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createFunctionRevisionPayload + localVarPostBody = r.createPullCredentialPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -583,63 +579,67 @@ func (a *DefaultAPIService) CreateFunctionRevisionExecute(r ApiCreateFunctionRev return localVarReturnValue, nil } -type ApiCreatePullCredentialRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - createPullCredentialPayload *CreatePullCredentialPayload +type ApiCreateRevisionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + functionId string + createRevisionPayload *CreateRevisionPayload } -func (r ApiCreatePullCredentialRequest) CreatePullCredentialPayload(createPullCredentialPayload CreatePullCredentialPayload) ApiCreatePullCredentialRequest { - r.createPullCredentialPayload = &createPullCredentialPayload +func (r ApiCreateRevisionRequest) CreateRevisionPayload(createRevisionPayload CreateRevisionPayload) ApiCreateRevisionRequest { + r.createRevisionPayload = &createRevisionPayload return r } -func (r ApiCreatePullCredentialRequest) Execute() (*PullCredential, error) { - return r.ApiService.CreatePullCredentialExecute(r) +func (r ApiCreateRevisionRequest) Execute() (*Revision, error) { + return r.ApiService.CreateRevisionExecute(r) } /* -CreatePullCredential Create OCI image registry pull credential definition +CreateRevision Method for CreateRevision -Create a new OCI image registry pull credential configuration. +Create a new function revision @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT portal project UUID the resource is located in. - @return ApiCreatePullCredentialRequest + @param functionId The STACKIT Functions functionId + @return ApiCreateRevisionRequest */ -func (a *DefaultAPIService) CreatePullCredential(ctx context.Context, projectId string) ApiCreatePullCredentialRequest { - return ApiCreatePullCredentialRequest{ +func (a *DefaultAPIService) CreateRevision(ctx context.Context, projectId string, functionId string) ApiCreateRevisionRequest { + return ApiCreateRevisionRequest{ ApiService: a, ctx: ctx, projectId: projectId, + functionId: functionId, } } // Execute executes the request // -// @return PullCredential -func (a *DefaultAPIService) CreatePullCredentialExecute(r ApiCreatePullCredentialRequest) (*PullCredential, error) { +// @return Revision +func (a *DefaultAPIService) CreateRevisionExecute(r ApiCreateRevisionRequest) (*Revision, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PullCredential + localVarReturnValue *Revision ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreatePullCredential") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateRevision") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha/projects/{projectId}/pull-credentials" + localVarPath := localBasePath + "/v1alpha/projects/{projectId}/functions/{functionId}/revisions" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"functionId"+"}", url.PathEscape(parameterValueToString(r.functionId, "functionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createPullCredentialPayload == nil { - return localVarReturnValue, reportError("createPullCredentialPayload is required and must be specified") + if r.createRevisionPayload == nil { + return localVarReturnValue, reportError("createRevisionPayload is required and must be specified") } // to determine the Content-Type header @@ -660,7 +660,7 @@ func (a *DefaultAPIService) CreatePullCredentialExecute(r ApiCreatePullCredentia localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createPullCredentialPayload + localVarPostBody = r.createRevisionPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/functions/v1alphaapi/api_default_mock.go b/services/functions/v1alphaapi/api_default_mock.go index a7eb27d65c..d924442539 100644 --- a/services/functions/v1alphaapi/api_default_mock.go +++ b/services/functions/v1alphaapi/api_default_mock.go @@ -22,10 +22,10 @@ var _ DefaultAPI = &DefaultAPIServiceMock{} type DefaultAPIServiceMock struct { // CreateFunctionExecuteMock can be populated to implement the behavior of the CreateFunctionExecute function of this mock CreateFunctionExecuteMock *func(r ApiCreateFunctionRequest) (*Function, error) - // CreateFunctionRevisionExecuteMock can be populated to implement the behavior of the CreateFunctionRevisionExecute function of this mock - CreateFunctionRevisionExecuteMock *func(r ApiCreateFunctionRevisionRequest) (*Revision, error) // CreatePullCredentialExecuteMock can be populated to implement the behavior of the CreatePullCredentialExecute function of this mock CreatePullCredentialExecuteMock *func(r ApiCreatePullCredentialRequest) (*PullCredential, error) + // CreateRevisionExecuteMock can be populated to implement the behavior of the CreateRevisionExecute function of this mock + CreateRevisionExecuteMock *func(r ApiCreateRevisionRequest) (*Revision, error) // DeleteFunctionExecuteMock can be populated to implement the behavior of the DeleteFunctionExecute function of this mock DeleteFunctionExecuteMock *func(r ApiDeleteFunctionRequest) error // DeletePullCredentialExecuteMock can be populated to implement the behavior of the DeletePullCredentialExecute function of this mock @@ -70,41 +70,41 @@ func (a DefaultAPIServiceMock) CreateFunctionExecute(r ApiCreateFunctionRequest) return (*a.CreateFunctionExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreateFunctionRevision(ctx context.Context, projectId string, functionId string) ApiCreateFunctionRevisionRequest { - return ApiCreateFunctionRevisionRequest{ +func (a DefaultAPIServiceMock) CreatePullCredential(ctx context.Context, projectId string) ApiCreatePullCredentialRequest { + return ApiCreatePullCredentialRequest{ ApiService: a, ctx: ctx, projectId: projectId, - functionId: functionId, } } -// CreateFunctionRevisionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateFunctionRevisionExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreateFunctionRevisionExecute(r ApiCreateFunctionRevisionRequest) (*Revision, error) { - if a.CreateFunctionRevisionExecuteMock == nil { - var localVarReturnValue *Revision +// CreatePullCredentialExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreatePullCredentialExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreatePullCredentialExecute(r ApiCreatePullCredentialRequest) (*PullCredential, error) { + if a.CreatePullCredentialExecuteMock == nil { + var localVarReturnValue *PullCredential return localVarReturnValue, nil } - return (*a.CreateFunctionRevisionExecuteMock)(r) + return (*a.CreatePullCredentialExecuteMock)(r) } -func (a DefaultAPIServiceMock) CreatePullCredential(ctx context.Context, projectId string) ApiCreatePullCredentialRequest { - return ApiCreatePullCredentialRequest{ +func (a DefaultAPIServiceMock) CreateRevision(ctx context.Context, projectId string, functionId string) ApiCreateRevisionRequest { + return ApiCreateRevisionRequest{ ApiService: a, ctx: ctx, projectId: projectId, + functionId: functionId, } } -// CreatePullCredentialExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreatePullCredentialExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) CreatePullCredentialExecute(r ApiCreatePullCredentialRequest) (*PullCredential, error) { - if a.CreatePullCredentialExecuteMock == nil { - var localVarReturnValue *PullCredential +// CreateRevisionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateRevisionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateRevisionExecute(r ApiCreateRevisionRequest) (*Revision, error) { + if a.CreateRevisionExecuteMock == nil { + var localVarReturnValue *Revision return localVarReturnValue, nil } - return (*a.CreatePullCredentialExecuteMock)(r) + return (*a.CreateRevisionExecuteMock)(r) } func (a DefaultAPIServiceMock) DeleteFunction(ctx context.Context, projectId string, functionId string) ApiDeleteFunctionRequest { diff --git a/services/functions/v1alphaapi/model_create_function_revision_payload_state.go b/services/functions/v1alphaapi/model_create_function_revision_payload_state.go deleted file mode 100644 index 17a0fc6b59..0000000000 --- a/services/functions/v1alphaapi/model_create_function_revision_payload_state.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -STACKIT Functions Core API - -This API provides endpoints for managing STACKIT Functions. - -API version: 1alpha -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1alphaapi - -import ( - "encoding/json" - "fmt" -) - -// CreateFunctionRevisionPayloadState Status of this revision. -type CreateFunctionRevisionPayloadState string - -// List of createFunctionRevisionPayload_state -const ( - CREATEFUNCTIONREVISIONPAYLOADSTATE_CANCELLED CreateFunctionRevisionPayloadState = "CANCELLED" - CREATEFUNCTIONREVISIONPAYLOADSTATE_CREATING CreateFunctionRevisionPayloadState = "CREATING" - CREATEFUNCTIONREVISIONPAYLOADSTATE_ACTIVE CreateFunctionRevisionPayloadState = "ACTIVE" - CREATEFUNCTIONREVISIONPAYLOADSTATE_FAILED CreateFunctionRevisionPayloadState = "FAILED" - CREATEFUNCTIONREVISIONPAYLOADSTATE_UNKNOWN_DEFAULT_OPEN_API CreateFunctionRevisionPayloadState = "unknown_default_open_api" -) - -// All allowed values of CreateFunctionRevisionPayloadState enum -var AllowedCreateFunctionRevisionPayloadStateEnumValues = []CreateFunctionRevisionPayloadState{ - "CANCELLED", - "CREATING", - "ACTIVE", - "FAILED", - "unknown_default_open_api", -} - -func (v *CreateFunctionRevisionPayloadState) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := CreateFunctionRevisionPayloadState(value) - for _, existing := range AllowedCreateFunctionRevisionPayloadStateEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - *v = CREATEFUNCTIONREVISIONPAYLOADSTATE_UNKNOWN_DEFAULT_OPEN_API - return nil -} - -// NewCreateFunctionRevisionPayloadStateFromValue returns a pointer to a valid CreateFunctionRevisionPayloadState -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCreateFunctionRevisionPayloadStateFromValue(v string) (*CreateFunctionRevisionPayloadState, error) { - ev := CreateFunctionRevisionPayloadState(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CreateFunctionRevisionPayloadState: valid values are %v", v, AllowedCreateFunctionRevisionPayloadStateEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CreateFunctionRevisionPayloadState) IsValid() bool { - for _, existing := range AllowedCreateFunctionRevisionPayloadStateEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to createFunctionRevisionPayload_state value -func (v CreateFunctionRevisionPayloadState) Ptr() *CreateFunctionRevisionPayloadState { - return &v -} - -type NullableCreateFunctionRevisionPayloadState struct { - value *CreateFunctionRevisionPayloadState - isSet bool -} - -func (v NullableCreateFunctionRevisionPayloadState) Get() *CreateFunctionRevisionPayloadState { - return v.value -} - -func (v *NullableCreateFunctionRevisionPayloadState) Set(val *CreateFunctionRevisionPayloadState) { - v.value = val - v.isSet = true -} - -func (v NullableCreateFunctionRevisionPayloadState) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateFunctionRevisionPayloadState) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateFunctionRevisionPayloadState(val *CreateFunctionRevisionPayloadState) *NullableCreateFunctionRevisionPayloadState { - return &NullableCreateFunctionRevisionPayloadState{value: val, isSet: true} -} - -func (v NullableCreateFunctionRevisionPayloadState) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateFunctionRevisionPayloadState) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/functions/v1alphaapi/model_create_function_revision_payload.go b/services/functions/v1alphaapi/model_create_revision_payload.go similarity index 68% rename from services/functions/v1alphaapi/model_create_function_revision_payload.go rename to services/functions/v1alphaapi/model_create_revision_payload.go index b8d8b9f68e..73caf40be1 100644 --- a/services/functions/v1alphaapi/model_create_function_revision_payload.go +++ b/services/functions/v1alphaapi/model_create_revision_payload.go @@ -16,11 +16,11 @@ import ( "time" ) -// checks if the CreateFunctionRevisionPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateFunctionRevisionPayload{} +// checks if the CreateRevisionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRevisionPayload{} -// CreateFunctionRevisionPayload The function revision -type CreateFunctionRevisionPayload struct { +// CreateRevisionPayload The function revision +type CreateRevisionPayload struct { // Time the function was created. CreatedAt *time.Time `json:"created_at,omitempty"` // A hashed fingerprint of the revision artifact. @@ -38,8 +38,8 @@ type CreateFunctionRevisionPayload struct { // OCI Registry pull credential to use for pulling the revision's image. OciPullCredentialId *string `json:"oci_pull_credential_id,omitempty"` // OCI reference for the revision. - OciReference string `json:"oci_reference" validate:"regexp=(:[vV]?\\d+\\.\\d+\\.\\d+(@sha256:[a-fA-F0-9]{64})?)$|((:latest)?@sha256:[a-fA-F0-9]{64})$"` - State *CreateFunctionRevisionPayloadState `json:"state,omitempty"` + OciReference string `json:"oci_reference" validate:"regexp=(:[vV]?\\d+\\.\\d+\\.\\d+(@sha256:[a-fA-F0-9]{64})?)$|((:latest)?@sha256:[a-fA-F0-9]{64})$"` + State *CreateRevisionPayloadState `json:"state,omitempty"` // Error message related to this revision. StateError *string `json:"state_error,omitempty"` // Time the function was last updated. @@ -51,29 +51,29 @@ type CreateFunctionRevisionPayload struct { AdditionalProperties map[string]interface{} } -type _CreateFunctionRevisionPayload CreateFunctionRevisionPayload +type _CreateRevisionPayload CreateRevisionPayload -// NewCreateFunctionRevisionPayload instantiates a new CreateFunctionRevisionPayload object +// NewCreateRevisionPayload instantiates a new CreateRevisionPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCreateFunctionRevisionPayload(limits ResourceLimits, ociReference string) *CreateFunctionRevisionPayload { - this := CreateFunctionRevisionPayload{} +func NewCreateRevisionPayload(limits ResourceLimits, ociReference string) *CreateRevisionPayload { + this := CreateRevisionPayload{} this.Limits = limits this.OciReference = ociReference return &this } -// NewCreateFunctionRevisionPayloadWithDefaults instantiates a new CreateFunctionRevisionPayload object +// NewCreateRevisionPayloadWithDefaults instantiates a new CreateRevisionPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewCreateFunctionRevisionPayloadWithDefaults() *CreateFunctionRevisionPayload { - this := CreateFunctionRevisionPayload{} +func NewCreateRevisionPayloadWithDefaults() *CreateRevisionPayload { + this := CreateRevisionPayload{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetCreatedAt() time.Time { +func (o *CreateRevisionPayload) GetCreatedAt() time.Time { if o == nil || IsNil(o.CreatedAt) { var ret time.Time return ret @@ -83,7 +83,7 @@ func (o *CreateFunctionRevisionPayload) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetCreatedAtOk() (*time.Time, bool) { +func (o *CreateRevisionPayload) GetCreatedAtOk() (*time.Time, bool) { if o == nil || IsNil(o.CreatedAt) { return nil, false } @@ -91,7 +91,7 @@ func (o *CreateFunctionRevisionPayload) GetCreatedAtOk() (*time.Time, bool) { } // HasCreatedAt returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasCreatedAt() bool { +func (o *CreateRevisionPayload) HasCreatedAt() bool { if o != nil && !IsNil(o.CreatedAt) { return true } @@ -100,12 +100,12 @@ func (o *CreateFunctionRevisionPayload) HasCreatedAt() bool { } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateFunctionRevisionPayload) SetCreatedAt(v time.Time) { +func (o *CreateRevisionPayload) SetCreatedAt(v time.Time) { o.CreatedAt = &v } // GetDigest returns the Digest field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetDigest() string { +func (o *CreateRevisionPayload) GetDigest() string { if o == nil || IsNil(o.Digest) { var ret string return ret @@ -115,7 +115,7 @@ func (o *CreateFunctionRevisionPayload) GetDigest() string { // GetDigestOk returns a tuple with the Digest field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetDigestOk() (*string, bool) { +func (o *CreateRevisionPayload) GetDigestOk() (*string, bool) { if o == nil || IsNil(o.Digest) { return nil, false } @@ -123,7 +123,7 @@ func (o *CreateFunctionRevisionPayload) GetDigestOk() (*string, bool) { } // HasDigest returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasDigest() bool { +func (o *CreateRevisionPayload) HasDigest() bool { if o != nil && !IsNil(o.Digest) { return true } @@ -132,12 +132,12 @@ func (o *CreateFunctionRevisionPayload) HasDigest() bool { } // SetDigest gets a reference to the given string and assigns it to the Digest field. -func (o *CreateFunctionRevisionPayload) SetDigest(v string) { +func (o *CreateRevisionPayload) SetDigest(v string) { o.Digest = &v } // GetFunctionId returns the FunctionId field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetFunctionId() string { +func (o *CreateRevisionPayload) GetFunctionId() string { if o == nil || IsNil(o.FunctionId) { var ret string return ret @@ -147,7 +147,7 @@ func (o *CreateFunctionRevisionPayload) GetFunctionId() string { // GetFunctionIdOk returns a tuple with the FunctionId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetFunctionIdOk() (*string, bool) { +func (o *CreateRevisionPayload) GetFunctionIdOk() (*string, bool) { if o == nil || IsNil(o.FunctionId) { return nil, false } @@ -155,7 +155,7 @@ func (o *CreateFunctionRevisionPayload) GetFunctionIdOk() (*string, bool) { } // HasFunctionId returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasFunctionId() bool { +func (o *CreateRevisionPayload) HasFunctionId() bool { if o != nil && !IsNil(o.FunctionId) { return true } @@ -164,12 +164,12 @@ func (o *CreateFunctionRevisionPayload) HasFunctionId() bool { } // SetFunctionId gets a reference to the given string and assigns it to the FunctionId field. -func (o *CreateFunctionRevisionPayload) SetFunctionId(v string) { +func (o *CreateRevisionPayload) SetFunctionId(v string) { o.FunctionId = &v } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetId() string { +func (o *CreateRevisionPayload) GetId() string { if o == nil || IsNil(o.Id) { var ret string return ret @@ -179,7 +179,7 @@ func (o *CreateFunctionRevisionPayload) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetIdOk() (*string, bool) { +func (o *CreateRevisionPayload) GetIdOk() (*string, bool) { if o == nil || IsNil(o.Id) { return nil, false } @@ -187,7 +187,7 @@ func (o *CreateFunctionRevisionPayload) GetIdOk() (*string, bool) { } // HasId returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasId() bool { +func (o *CreateRevisionPayload) HasId() bool { if o != nil && !IsNil(o.Id) { return true } @@ -196,12 +196,12 @@ func (o *CreateFunctionRevisionPayload) HasId() bool { } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateFunctionRevisionPayload) SetId(v string) { +func (o *CreateRevisionPayload) SetId(v string) { o.Id = &v } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetLabels() map[string]string { +func (o *CreateRevisionPayload) GetLabels() map[string]string { if o == nil || IsNil(o.Labels) { var ret map[string]string return ret @@ -211,7 +211,7 @@ func (o *CreateFunctionRevisionPayload) GetLabels() map[string]string { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetLabelsOk() (*map[string]string, bool) { +func (o *CreateRevisionPayload) GetLabelsOk() (*map[string]string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -219,7 +219,7 @@ func (o *CreateFunctionRevisionPayload) GetLabelsOk() (*map[string]string, bool) } // HasLabels returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasLabels() bool { +func (o *CreateRevisionPayload) HasLabels() bool { if o != nil && !IsNil(o.Labels) { return true } @@ -228,12 +228,12 @@ func (o *CreateFunctionRevisionPayload) HasLabels() bool { } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *CreateFunctionRevisionPayload) SetLabels(v map[string]string) { +func (o *CreateRevisionPayload) SetLabels(v map[string]string) { o.Labels = &v } // GetLimits returns the Limits field value -func (o *CreateFunctionRevisionPayload) GetLimits() ResourceLimits { +func (o *CreateRevisionPayload) GetLimits() ResourceLimits { if o == nil { var ret ResourceLimits return ret @@ -244,7 +244,7 @@ func (o *CreateFunctionRevisionPayload) GetLimits() ResourceLimits { // GetLimitsOk returns a tuple with the Limits field value // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetLimitsOk() (*ResourceLimits, bool) { +func (o *CreateRevisionPayload) GetLimitsOk() (*ResourceLimits, bool) { if o == nil { return nil, false } @@ -252,12 +252,12 @@ func (o *CreateFunctionRevisionPayload) GetLimitsOk() (*ResourceLimits, bool) { } // SetLimits sets field value -func (o *CreateFunctionRevisionPayload) SetLimits(v ResourceLimits) { +func (o *CreateRevisionPayload) SetLimits(v ResourceLimits) { o.Limits = v } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetMessage() string { +func (o *CreateRevisionPayload) GetMessage() string { if o == nil || IsNil(o.Message) { var ret string return ret @@ -267,7 +267,7 @@ func (o *CreateFunctionRevisionPayload) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetMessageOk() (*string, bool) { +func (o *CreateRevisionPayload) GetMessageOk() (*string, bool) { if o == nil || IsNil(o.Message) { return nil, false } @@ -275,7 +275,7 @@ func (o *CreateFunctionRevisionPayload) GetMessageOk() (*string, bool) { } // HasMessage returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasMessage() bool { +func (o *CreateRevisionPayload) HasMessage() bool { if o != nil && !IsNil(o.Message) { return true } @@ -284,12 +284,12 @@ func (o *CreateFunctionRevisionPayload) HasMessage() bool { } // SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *CreateFunctionRevisionPayload) SetMessage(v string) { +func (o *CreateRevisionPayload) SetMessage(v string) { o.Message = &v } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetName() string { +func (o *CreateRevisionPayload) GetName() string { if o == nil || IsNil(o.Name) { var ret string return ret @@ -299,7 +299,7 @@ func (o *CreateFunctionRevisionPayload) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetNameOk() (*string, bool) { +func (o *CreateRevisionPayload) GetNameOk() (*string, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -307,7 +307,7 @@ func (o *CreateFunctionRevisionPayload) GetNameOk() (*string, bool) { } // HasName returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasName() bool { +func (o *CreateRevisionPayload) HasName() bool { if o != nil && !IsNil(o.Name) { return true } @@ -316,12 +316,12 @@ func (o *CreateFunctionRevisionPayload) HasName() bool { } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateFunctionRevisionPayload) SetName(v string) { +func (o *CreateRevisionPayload) SetName(v string) { o.Name = &v } // GetOciPullCredentialId returns the OciPullCredentialId field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetOciPullCredentialId() string { +func (o *CreateRevisionPayload) GetOciPullCredentialId() string { if o == nil || IsNil(o.OciPullCredentialId) { var ret string return ret @@ -331,7 +331,7 @@ func (o *CreateFunctionRevisionPayload) GetOciPullCredentialId() string { // GetOciPullCredentialIdOk returns a tuple with the OciPullCredentialId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetOciPullCredentialIdOk() (*string, bool) { +func (o *CreateRevisionPayload) GetOciPullCredentialIdOk() (*string, bool) { if o == nil || IsNil(o.OciPullCredentialId) { return nil, false } @@ -339,7 +339,7 @@ func (o *CreateFunctionRevisionPayload) GetOciPullCredentialIdOk() (*string, boo } // HasOciPullCredentialId returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasOciPullCredentialId() bool { +func (o *CreateRevisionPayload) HasOciPullCredentialId() bool { if o != nil && !IsNil(o.OciPullCredentialId) { return true } @@ -348,12 +348,12 @@ func (o *CreateFunctionRevisionPayload) HasOciPullCredentialId() bool { } // SetOciPullCredentialId gets a reference to the given string and assigns it to the OciPullCredentialId field. -func (o *CreateFunctionRevisionPayload) SetOciPullCredentialId(v string) { +func (o *CreateRevisionPayload) SetOciPullCredentialId(v string) { o.OciPullCredentialId = &v } // GetOciReference returns the OciReference field value -func (o *CreateFunctionRevisionPayload) GetOciReference() string { +func (o *CreateRevisionPayload) GetOciReference() string { if o == nil { var ret string return ret @@ -364,7 +364,7 @@ func (o *CreateFunctionRevisionPayload) GetOciReference() string { // GetOciReferenceOk returns a tuple with the OciReference field value // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetOciReferenceOk() (*string, bool) { +func (o *CreateRevisionPayload) GetOciReferenceOk() (*string, bool) { if o == nil { return nil, false } @@ -372,14 +372,14 @@ func (o *CreateFunctionRevisionPayload) GetOciReferenceOk() (*string, bool) { } // SetOciReference sets field value -func (o *CreateFunctionRevisionPayload) SetOciReference(v string) { +func (o *CreateRevisionPayload) SetOciReference(v string) { o.OciReference = v } // GetState returns the State field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetState() CreateFunctionRevisionPayloadState { +func (o *CreateRevisionPayload) GetState() CreateRevisionPayloadState { if o == nil || IsNil(o.State) { - var ret CreateFunctionRevisionPayloadState + var ret CreateRevisionPayloadState return ret } return *o.State @@ -387,7 +387,7 @@ func (o *CreateFunctionRevisionPayload) GetState() CreateFunctionRevisionPayload // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetStateOk() (*CreateFunctionRevisionPayloadState, bool) { +func (o *CreateRevisionPayload) GetStateOk() (*CreateRevisionPayloadState, bool) { if o == nil || IsNil(o.State) { return nil, false } @@ -395,7 +395,7 @@ func (o *CreateFunctionRevisionPayload) GetStateOk() (*CreateFunctionRevisionPay } // HasState returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasState() bool { +func (o *CreateRevisionPayload) HasState() bool { if o != nil && !IsNil(o.State) { return true } @@ -403,13 +403,13 @@ func (o *CreateFunctionRevisionPayload) HasState() bool { return false } -// SetState gets a reference to the given CreateFunctionRevisionPayloadState and assigns it to the State field. -func (o *CreateFunctionRevisionPayload) SetState(v CreateFunctionRevisionPayloadState) { +// SetState gets a reference to the given CreateRevisionPayloadState and assigns it to the State field. +func (o *CreateRevisionPayload) SetState(v CreateRevisionPayloadState) { o.State = &v } // GetStateError returns the StateError field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetStateError() string { +func (o *CreateRevisionPayload) GetStateError() string { if o == nil || IsNil(o.StateError) { var ret string return ret @@ -419,7 +419,7 @@ func (o *CreateFunctionRevisionPayload) GetStateError() string { // GetStateErrorOk returns a tuple with the StateError field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetStateErrorOk() (*string, bool) { +func (o *CreateRevisionPayload) GetStateErrorOk() (*string, bool) { if o == nil || IsNil(o.StateError) { return nil, false } @@ -427,7 +427,7 @@ func (o *CreateFunctionRevisionPayload) GetStateErrorOk() (*string, bool) { } // HasStateError returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasStateError() bool { +func (o *CreateRevisionPayload) HasStateError() bool { if o != nil && !IsNil(o.StateError) { return true } @@ -436,12 +436,12 @@ func (o *CreateFunctionRevisionPayload) HasStateError() bool { } // SetStateError gets a reference to the given string and assigns it to the StateError field. -func (o *CreateFunctionRevisionPayload) SetStateError(v string) { +func (o *CreateRevisionPayload) SetStateError(v string) { o.StateError = &v } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetUpdatedAt() time.Time { +func (o *CreateRevisionPayload) GetUpdatedAt() time.Time { if o == nil || IsNil(o.UpdatedAt) { var ret time.Time return ret @@ -451,7 +451,7 @@ func (o *CreateFunctionRevisionPayload) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetUpdatedAtOk() (*time.Time, bool) { +func (o *CreateRevisionPayload) GetUpdatedAtOk() (*time.Time, bool) { if o == nil || IsNil(o.UpdatedAt) { return nil, false } @@ -459,7 +459,7 @@ func (o *CreateFunctionRevisionPayload) GetUpdatedAtOk() (*time.Time, bool) { } // HasUpdatedAt returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasUpdatedAt() bool { +func (o *CreateRevisionPayload) HasUpdatedAt() bool { if o != nil && !IsNil(o.UpdatedAt) { return true } @@ -468,12 +468,12 @@ func (o *CreateFunctionRevisionPayload) HasUpdatedAt() bool { } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateFunctionRevisionPayload) SetUpdatedAt(v time.Time) { +func (o *CreateRevisionPayload) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } // GetVariables returns the Variables field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetVariables() []RevisionVariable { +func (o *CreateRevisionPayload) GetVariables() []RevisionVariable { if o == nil || IsNil(o.Variables) { var ret []RevisionVariable return ret @@ -483,7 +483,7 @@ func (o *CreateFunctionRevisionPayload) GetVariables() []RevisionVariable { // GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetVariablesOk() ([]RevisionVariable, bool) { +func (o *CreateRevisionPayload) GetVariablesOk() ([]RevisionVariable, bool) { if o == nil || IsNil(o.Variables) { return nil, false } @@ -491,7 +491,7 @@ func (o *CreateFunctionRevisionPayload) GetVariablesOk() ([]RevisionVariable, bo } // HasVariables returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasVariables() bool { +func (o *CreateRevisionPayload) HasVariables() bool { if o != nil && !IsNil(o.Variables) { return true } @@ -500,12 +500,12 @@ func (o *CreateFunctionRevisionPayload) HasVariables() bool { } // SetVariables gets a reference to the given []RevisionVariable and assigns it to the Variables field. -func (o *CreateFunctionRevisionPayload) SetVariables(v []RevisionVariable) { +func (o *CreateRevisionPayload) SetVariables(v []RevisionVariable) { o.Variables = v } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *CreateFunctionRevisionPayload) GetVersion() int64 { +func (o *CreateRevisionPayload) GetVersion() int64 { if o == nil || IsNil(o.Version) { var ret int64 return ret @@ -515,7 +515,7 @@ func (o *CreateFunctionRevisionPayload) GetVersion() int64 { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateFunctionRevisionPayload) GetVersionOk() (*int64, bool) { +func (o *CreateRevisionPayload) GetVersionOk() (*int64, bool) { if o == nil || IsNil(o.Version) { return nil, false } @@ -523,7 +523,7 @@ func (o *CreateFunctionRevisionPayload) GetVersionOk() (*int64, bool) { } // HasVersion returns a boolean if a field has been set. -func (o *CreateFunctionRevisionPayload) HasVersion() bool { +func (o *CreateRevisionPayload) HasVersion() bool { if o != nil && !IsNil(o.Version) { return true } @@ -532,11 +532,11 @@ func (o *CreateFunctionRevisionPayload) HasVersion() bool { } // SetVersion gets a reference to the given int64 and assigns it to the Version field. -func (o *CreateFunctionRevisionPayload) SetVersion(v int64) { +func (o *CreateRevisionPayload) SetVersion(v int64) { o.Version = &v } -func (o CreateFunctionRevisionPayload) MarshalJSON() ([]byte, error) { +func (o CreateRevisionPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -544,7 +544,7 @@ func (o CreateFunctionRevisionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o CreateFunctionRevisionPayload) ToMap() (map[string]interface{}, error) { +func (o CreateRevisionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.CreatedAt) { toSerialize["created_at"] = o.CreatedAt @@ -595,7 +595,7 @@ func (o CreateFunctionRevisionPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *CreateFunctionRevisionPayload) UnmarshalJSON(data []byte) (err error) { +func (o *CreateRevisionPayload) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -618,15 +618,15 @@ func (o *CreateFunctionRevisionPayload) UnmarshalJSON(data []byte) (err error) { } } - varCreateFunctionRevisionPayload := _CreateFunctionRevisionPayload{} + varCreateRevisionPayload := _CreateRevisionPayload{} - err = json.Unmarshal(data, &varCreateFunctionRevisionPayload) + err = json.Unmarshal(data, &varCreateRevisionPayload) if err != nil { return err } - *o = CreateFunctionRevisionPayload(varCreateFunctionRevisionPayload) + *o = CreateRevisionPayload(varCreateRevisionPayload) additionalProperties := make(map[string]interface{}) @@ -652,38 +652,38 @@ func (o *CreateFunctionRevisionPayload) UnmarshalJSON(data []byte) (err error) { return err } -type NullableCreateFunctionRevisionPayload struct { - value *CreateFunctionRevisionPayload +type NullableCreateRevisionPayload struct { + value *CreateRevisionPayload isSet bool } -func (v NullableCreateFunctionRevisionPayload) Get() *CreateFunctionRevisionPayload { +func (v NullableCreateRevisionPayload) Get() *CreateRevisionPayload { return v.value } -func (v *NullableCreateFunctionRevisionPayload) Set(val *CreateFunctionRevisionPayload) { +func (v *NullableCreateRevisionPayload) Set(val *CreateRevisionPayload) { v.value = val v.isSet = true } -func (v NullableCreateFunctionRevisionPayload) IsSet() bool { +func (v NullableCreateRevisionPayload) IsSet() bool { return v.isSet } -func (v *NullableCreateFunctionRevisionPayload) Unset() { +func (v *NullableCreateRevisionPayload) Unset() { v.value = nil v.isSet = false } -func NewNullableCreateFunctionRevisionPayload(val *CreateFunctionRevisionPayload) *NullableCreateFunctionRevisionPayload { - return &NullableCreateFunctionRevisionPayload{value: val, isSet: true} +func NewNullableCreateRevisionPayload(val *CreateRevisionPayload) *NullableCreateRevisionPayload { + return &NullableCreateRevisionPayload{value: val, isSet: true} } -func (v NullableCreateFunctionRevisionPayload) MarshalJSON() ([]byte, error) { +func (v NullableCreateRevisionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableCreateFunctionRevisionPayload) UnmarshalJSON(src []byte) error { +func (v *NullableCreateRevisionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/functions/v1alphaapi/model_create_revision_payload_state.go b/services/functions/v1alphaapi/model_create_revision_payload_state.go new file mode 100644 index 0000000000..a1775f714f --- /dev/null +++ b/services/functions/v1alphaapi/model_create_revision_payload_state.go @@ -0,0 +1,117 @@ +/* +STACKIT Functions Core API + +This API provides endpoints for managing STACKIT Functions. + +API version: 1alpha +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alphaapi + +import ( + "encoding/json" + "fmt" +) + +// CreateRevisionPayloadState Status of this revision. +type CreateRevisionPayloadState string + +// List of CreateRevisionPayload_state +const ( + CREATEREVISIONPAYLOADSTATE_CANCELLED CreateRevisionPayloadState = "CANCELLED" + CREATEREVISIONPAYLOADSTATE_CREATING CreateRevisionPayloadState = "CREATING" + CREATEREVISIONPAYLOADSTATE_ACTIVE CreateRevisionPayloadState = "ACTIVE" + CREATEREVISIONPAYLOADSTATE_FAILED CreateRevisionPayloadState = "FAILED" + CREATEREVISIONPAYLOADSTATE_UNKNOWN_DEFAULT_OPEN_API CreateRevisionPayloadState = "unknown_default_open_api" +) + +// All allowed values of CreateRevisionPayloadState enum +var AllowedCreateRevisionPayloadStateEnumValues = []CreateRevisionPayloadState{ + "CANCELLED", + "CREATING", + "ACTIVE", + "FAILED", + "unknown_default_open_api", +} + +func (v *CreateRevisionPayloadState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateRevisionPayloadState(value) + for _, existing := range AllowedCreateRevisionPayloadStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CREATEREVISIONPAYLOADSTATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewCreateRevisionPayloadStateFromValue returns a pointer to a valid CreateRevisionPayloadState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateRevisionPayloadStateFromValue(v string) (*CreateRevisionPayloadState, error) { + ev := CreateRevisionPayloadState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateRevisionPayloadState: valid values are %v", v, AllowedCreateRevisionPayloadStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateRevisionPayloadState) IsValid() bool { + for _, existing := range AllowedCreateRevisionPayloadStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateRevisionPayload_state value +func (v CreateRevisionPayloadState) Ptr() *CreateRevisionPayloadState { + return &v +} + +type NullableCreateRevisionPayloadState struct { + value *CreateRevisionPayloadState + isSet bool +} + +func (v NullableCreateRevisionPayloadState) Get() *CreateRevisionPayloadState { + return v.value +} + +func (v *NullableCreateRevisionPayloadState) Set(val *CreateRevisionPayloadState) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRevisionPayloadState) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRevisionPayloadState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRevisionPayloadState(val *CreateRevisionPayloadState) *NullableCreateRevisionPayloadState { + return &NullableCreateRevisionPayloadState{value: val, isSet: true} +} + +func (v NullableCreateRevisionPayloadState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRevisionPayloadState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/functions/v1alphaapi/model_resource_limits.go b/services/functions/v1alphaapi/model_resource_limits.go index daa323ad0f..1614ce9ae6 100644 --- a/services/functions/v1alphaapi/model_resource_limits.go +++ b/services/functions/v1alphaapi/model_resource_limits.go @@ -20,7 +20,10 @@ var _ MappedNullable = &ResourceLimits{} // ResourceLimits Resource utilization limitations type ResourceLimits struct { - Concurrency int32 `json:"concurrency"` + // Maximum number of in-flight requests to a single instance + Concurrency int32 `json:"concurrency"` + // Maximum number of running instances + MaxScale *int32 `json:"max_scale,omitempty"` Plan string `json:"plan"` AdditionalProperties map[string]interface{} } @@ -70,6 +73,38 @@ func (o *ResourceLimits) SetConcurrency(v int32) { o.Concurrency = v } +// GetMaxScale returns the MaxScale field value if set, zero value otherwise. +func (o *ResourceLimits) GetMaxScale() int32 { + if o == nil || IsNil(o.MaxScale) { + var ret int32 + return ret + } + return *o.MaxScale +} + +// GetMaxScaleOk returns a tuple with the MaxScale field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceLimits) GetMaxScaleOk() (*int32, bool) { + if o == nil || IsNil(o.MaxScale) { + return nil, false + } + return o.MaxScale, true +} + +// HasMaxScale returns a boolean if a field has been set. +func (o *ResourceLimits) HasMaxScale() bool { + if o != nil && !IsNil(o.MaxScale) { + return true + } + + return false +} + +// SetMaxScale gets a reference to the given int32 and assigns it to the MaxScale field. +func (o *ResourceLimits) SetMaxScale(v int32) { + o.MaxScale = &v +} + // GetPlan returns the Plan field value func (o *ResourceLimits) GetPlan() string { if o == nil { @@ -105,6 +140,9 @@ func (o ResourceLimits) MarshalJSON() ([]byte, error) { func (o ResourceLimits) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["concurrency"] = o.Concurrency + if !IsNil(o.MaxScale) { + toSerialize["max_scale"] = o.MaxScale + } toSerialize["plan"] = o.Plan for key, value := range o.AdditionalProperties { @@ -151,6 +189,7 @@ func (o *ResourceLimits) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "concurrency") + delete(additionalProperties, "max_scale") delete(additionalProperties, "plan") o.AdditionalProperties = additionalProperties }