diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a052c7f1..5d098c747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,62 +1,69 @@ +## Release (2025-XX-XX) + +- `stackitmarketplace`: [v0.3.0](services/stackitmarketplace/CHANGELOG.md#v030-2025-02-25) + - **Feature:** Add method to create inquiries: `InquiriesCreateInquiry` + - **Feature:** Add `sort` property to `ApiListCatalogProductsRequest` + - **Feature:** Add payload `ApproveSubscriptionPayload` for `ApiApproveSubscriptionRequest` + ## Release (2025-02-21) > [!WARNING] > > **The lowest supported go version is now 1.21. In the future, only the two most recent versions will be supported.** -- `core`: [0.16.0](core/CHANGELOG.md#v0160-2025-02-21) +- `core`: [v0.16.0](core/CHANGELOG.md#v0160-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `archiving`: [0.2.0](services/archiving/CHANGELOG.md#v020-2025-02-21) +- `archiving`: [v0.2.0](services/archiving/CHANGELOG.md#v020-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `authorization`: [0.6.0](services/authorization/CHANGELOG.md#v060-2025-02-21) +- `authorization`: [v0.6.0](services/authorization/CHANGELOG.md#v060-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `certificates`: [0.2.0](services/certificates/CHANGELOG.md#v020-2025-02-21) +- `certificates`: [v0.2.0](services/certificates/CHANGELOG.md#v020-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `dns`: [0.13.0](services/dns/CHANGELOG.md#v0130-2025-02-21) +- `dns`: [v0.13.0](services/dns/CHANGELOG.md#v0130-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `iaas`: [0.20.0](services/iaas/CHANGELOG.md#v0200-2025-02-21) +- `iaas`: [v0.20.0](services/iaas/CHANGELOG.md#v0200-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `lbapplication`: [0.3.0](services/lbapplication/CHANGELOG.md#v030-2025-02-21) +- `lbapplication`: [v0.3.0](services/lbapplication/CHANGELOG.md#v030-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `loadbalancer`: [0.18.0](services/loadbalancer/CHANGELOG.md#v0180-2025-02-21) +- `loadbalancer`: [v0.18.0](services/loadbalancer/CHANGELOG.md#v0180-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `logme`: [0.21.0](services/logme/CHANGELOG.md#v0210-2025-02-21) +- `logme`: [v0.21.0](services/logme/CHANGELOG.md#v0210-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `mariadb`: [0.21.0](services/mariadb/CHANGELOG.md#v0210-2025-02-21) +- `mariadb`: [v0.21.0](services/mariadb/CHANGELOG.md#v0210-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `mongodbflex`: [0.18.0](services/mongodbflex/CHANGELOG.md#v0180-2025-02-21) +- `mongodbflex`: [v0.18.0](services/mongodbflex/CHANGELOG.md#v0180-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `objectstorage`: [1.1.0](services/objectstorage/CHANGELOG.md#v110-2025-02-21) +- `objectstorage`: [v1.1.0](services/objectstorage/CHANGELOG.md#v110-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `observability`: [0.14.0](services/observability/CHANGELOG.md#v0140-2025-02-21) +- `observability`: [v0.3.0](services/observability/CHANGELOG.md#v030-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `opensearch`: [0.20.0](services/opensearch/CHANGELOG.md#v0200-2025-02-21) +- `opensearch`: [v0.20.0](services/opensearch/CHANGELOG.md#v0200-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `postgresflex`: [0.18.0](services/postgresflex/CHANGELOG.md#v0180-2025-02-21) +- `postgresflex`: [v0.18.0](services/postgresflex/CHANGELOG.md#v0180-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `rabbitmq`: [0.21.0](services/rabbitmq/CHANGELOG.md#v0210-2025-02-21) +- `rabbitmq`: [v0.21.0](services/rabbitmq/CHANGELOG.md#v0210-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `redis`: [0.21.0](services/redis/CHANGELOG.md#v0210-2025-02-21) +- `redis`: [v0.21.0](services/redis/CHANGELOG.md#v0210-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `resourcemanager`: [0.13.0](services/resourcemanager/CHANGELOG.md#v0130-2025-02-21) +- `resourcemanager`: [v0.13.0](services/resourcemanager/CHANGELOG.md#v0130-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `runcommand`: [0.3.0](services/runcommand/CHANGELOG.md#v030-2025-02-21) +- `runcommand`: [v0.3.0](services/runcommand/CHANGELOG.md#v030-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `secretsmanager`: [0.11.0](services/secretsmanager/CHANGELOG.md#v0110-2025-02-21) +- `secretsmanager`: [v0.11.0](services/secretsmanager/CHANGELOG.md#v0110-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `serverbackup`: [0.6.0](services/serverbackup/CHANGELOG.md#v060-2025-02-21) +- `serverbackup`: [v0.6.0](services/serverbackup/CHANGELOG.md#v060-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `serverupdate`: [0.5.0](services/serverupdate/CHANGELOG.md#v050-2025-02-21) +- `serverupdate`: [v0.5.0](services/serverupdate/CHANGELOG.md#v050-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `serviceaccount`: [0.6.0](services/serviceaccount/CHANGELOG.md#v060-2025-02-21) +- `serviceaccount`: [v0.6.0](services/serviceaccount/CHANGELOG.md#v060-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `serviceenablement`: [0.5.0](services/serviceenablement/CHANGELOG.md#v050-2025-02-21) +- `serviceenablement`: [v0.5.0](services/serviceenablement/CHANGELOG.md#v050-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `ske`: [0.22.0](services/ske/CHANGELOG.md#v0220-2025-02-21) +- `ske`: [v0.22.0](services/ske/CHANGELOG.md#v0220-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `sqlserverflex`: [0.10.0](services/sqlserverflex/CHANGELOG.md#v0100-2025-02-21) +- `sqlserverflex`: [v0.10.0](services/sqlserverflex/CHANGELOG.md#v0100-2025-02-21) - **New**: Minimal go version is now Go 1.21 -- `stackitmarketplace`: [0.2.0](services/stackitmarketplace/CHANGELOG.md#v020-2025-02-21) +- `stackitmarketplace`: [v0.2.0](services/stackitmarketplace/CHANGELOG.md#v020-2025-02-21) - **New**: Minimal go version is now Go 1.21 diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md index 4d43949c2..9cb6f8f17 100644 --- a/services/stackitmarketplace/CHANGELOG.md +++ b/services/stackitmarketplace/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.3.0 (2025-02-25) +- **Feature:** Add method to create inquiries: `InquiriesCreateInquiry` +- **Feature:** Add `sort` property to `ApiListCatalogProductsRequest` +- **Feature:** Add payload `ApproveSubscriptionPayload` for `ApiApproveSubscriptionRequest` + ## v0.2.0 (2025-02-21) - **New:** Minimal go version is now Go 1.21 diff --git a/services/stackitmarketplace/api_default.go b/services/stackitmarketplace/api_default.go index 36df22382..51aa79b3f 100644 --- a/services/stackitmarketplace/api_default.go +++ b/services/stackitmarketplace/api_default.go @@ -27,10 +27,16 @@ import ( type DefaultApiService service type ApiApproveSubscriptionRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - subscriptionId string + ctx context.Context + apiService *DefaultApiService + projectId string + subscriptionId string + approveSubscriptionPayload *ApproveSubscriptionPayload +} + +func (r ApiApproveSubscriptionRequest) ApproveSubscriptionPayload(approveSubscriptionPayload ApproveSubscriptionPayload) ApiApproveSubscriptionRequest { + r.approveSubscriptionPayload = &approveSubscriptionPayload + return r } func (r ApiApproveSubscriptionRequest) Execute() error { @@ -54,7 +60,7 @@ func (r ApiApproveSubscriptionRequest) Execute() error { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -70,6 +76,8 @@ func (r ApiApproveSubscriptionRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.approveSubscriptionPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -516,6 +524,161 @@ func (a *APIClient) GetVendorSubscriptionExecute(ctx context.Context, projectId return r.Execute() } +type ApiInquiriesCreateInquiryRequest struct { + ctx context.Context + apiService *DefaultApiService + inquiriesCreateInquiryPayload *InquiriesCreateInquiryPayload +} + +func (r ApiInquiriesCreateInquiryRequest) InquiriesCreateInquiryPayload(inquiriesCreateInquiryPayload InquiriesCreateInquiryPayload) ApiInquiriesCreateInquiryRequest { + r.inquiriesCreateInquiryPayload = &inquiriesCreateInquiryPayload + return r +} + +func (r ApiInquiriesCreateInquiryRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InquiriesCreateInquiry") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/inquiries" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.inquiriesCreateInquiryPayload == nil { + return fmt.Errorf("inquiriesCreateInquiryPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.inquiriesCreateInquiryPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +InquiriesCreateInquiry: Create inquiry + +Create an inquiry to contact sales, become a vendor, or suggest a product. Requests are limited to 10 per 5 minutes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInquiriesCreateInquiryRequest +*/ +func (a *APIClient) InquiriesCreateInquiry(ctx context.Context) ApiInquiriesCreateInquiryRequest { + return ApiInquiriesCreateInquiryRequest{ + apiService: a.defaultApi, + ctx: ctx, + } +} + +func (a *APIClient) InquiriesCreateInquiryExecute(ctx context.Context) error { + r := ApiInquiriesCreateInquiryRequest{ + apiService: a.defaultApi, + ctx: ctx, + } + return r.Execute() +} + type ApiListCatalogProductsRequest struct { ctx context.Context apiService *DefaultApiService @@ -523,6 +686,7 @@ type ApiListCatalogProductsRequest struct { limit *float32 locale *string filter *string + sort *string } // A pagination cursor that represents a position in the dataset. If given, results will be returned from the item after the cursor. If not given, results will be returned from the beginning. @@ -553,6 +717,13 @@ func (r ApiListCatalogProductsRequest) Filter(filter string) ApiListCatalogProdu return r } +// Sort the products based on attributes and order (if specified). E.g `name:asc`. The supported attributes are `name`, `price`, and `deliveryMethod`. To set the sort order, append `asc` (ascending) or `desc` (descending) to the attribute, e.g. `name:asc`. To sort by multiple attributes, separate them with a comma. E.g `name,price:desc`. The order can be ommited to sort by the default order. E.g `name`. + +func (r ApiListCatalogProductsRequest) Sort(sort string) ApiListCatalogProductsRequest { + r.sort = &sort + return r +} + func (r ApiListCatalogProductsRequest) Execute() (*ListCatalogProductsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -584,6 +755,9 @@ func (r ApiListCatalogProductsRequest) Execute() (*ListCatalogProductsResponse, if r.filter != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "") } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/services/stackitmarketplace/api_default_test.go b/services/stackitmarketplace/api_default_test.go index d9d948744..46a84f773 100644 --- a/services/stackitmarketplace/api_default_test.go +++ b/services/stackitmarketplace/api_default_test.go @@ -179,6 +179,50 @@ func Test_stackitmarketplace_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService InquiriesCreateInquiry", func(t *testing.T) { + path := "/v1/inquiries" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for stackitmarketplace_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + inquiriesCreateInquiryPayload := InquiriesCreateInquiryPayload{} + + reqErr := apiClient.InquiriesCreateInquiry(context.Background()).InquiriesCreateInquiryPayload(inquiriesCreateInquiryPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + t.Run("Test DefaultApiService ListCatalogProducts", func(t *testing.T) { path := "/v1/catalog/products" diff --git a/services/stackitmarketplace/model_approve_subscription_payload.go b/services/stackitmarketplace/model_approve_subscription_payload.go new file mode 100644 index 000000000..128fcb4bc --- /dev/null +++ b/services/stackitmarketplace/model_approve_subscription_payload.go @@ -0,0 +1,117 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the ApproveSubscriptionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApproveSubscriptionPayload{} + +// ApproveSubscriptionPayload struct for ApproveSubscriptionPayload +type ApproveSubscriptionPayload struct { + // The target URL of the user instance, used to redirect the user to the instance after the subscription is active. + InstanceTarget *string `json:"instanceTarget,omitempty"` +} + +// NewApproveSubscriptionPayload instantiates a new ApproveSubscriptionPayload 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 NewApproveSubscriptionPayload() *ApproveSubscriptionPayload { + this := ApproveSubscriptionPayload{} + return &this +} + +// NewApproveSubscriptionPayloadWithDefaults instantiates a new ApproveSubscriptionPayload 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 NewApproveSubscriptionPayloadWithDefaults() *ApproveSubscriptionPayload { + this := ApproveSubscriptionPayload{} + return &this +} + +// GetInstanceTarget returns the InstanceTarget field value if set, zero value otherwise. +func (o *ApproveSubscriptionPayload) GetInstanceTarget() *string { + if o == nil || IsNil(o.InstanceTarget) { + var ret *string + return ret + } + return o.InstanceTarget +} + +// GetInstanceTargetOk returns a tuple with the InstanceTarget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApproveSubscriptionPayload) GetInstanceTargetOk() (*string, bool) { + if o == nil || IsNil(o.InstanceTarget) { + return nil, false + } + return o.InstanceTarget, true +} + +// HasInstanceTarget returns a boolean if a field has been set. +func (o *ApproveSubscriptionPayload) HasInstanceTarget() bool { + if o != nil && !IsNil(o.InstanceTarget) { + return true + } + + return false +} + +// SetInstanceTarget gets a reference to the given string and assigns it to the InstanceTarget field. +func (o *ApproveSubscriptionPayload) SetInstanceTarget(v *string) { + o.InstanceTarget = v +} + +func (o ApproveSubscriptionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceTarget) { + toSerialize["instanceTarget"] = o.InstanceTarget + } + return toSerialize, nil +} + +type NullableApproveSubscriptionPayload struct { + value *ApproveSubscriptionPayload + isSet bool +} + +func (v NullableApproveSubscriptionPayload) Get() *ApproveSubscriptionPayload { + return v.value +} + +func (v *NullableApproveSubscriptionPayload) Set(val *ApproveSubscriptionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableApproveSubscriptionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableApproveSubscriptionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApproveSubscriptionPayload(val *ApproveSubscriptionPayload) *NullableApproveSubscriptionPayload { + return &NullableApproveSubscriptionPayload{value: val, isSet: true} +} + +func (v NullableApproveSubscriptionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApproveSubscriptionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_become_vendor.go b/services/stackitmarketplace/model_become_vendor.go new file mode 100644 index 000000000..900946f92 --- /dev/null +++ b/services/stackitmarketplace/model_become_vendor.go @@ -0,0 +1,139 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the BecomeVendor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BecomeVendor{} + +// BecomeVendor Become a vendor. +type BecomeVendor struct { + // REQUIRED + BecomeVendor *BecomeVendorBecomeVendor `json:"becomeVendor"` + // The form type. + // REQUIRED + Type *string `json:"type"` +} + +type _BecomeVendor BecomeVendor + +// NewBecomeVendor instantiates a new BecomeVendor 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 NewBecomeVendor(becomeVendor *BecomeVendorBecomeVendor, type_ *string) *BecomeVendor { + this := BecomeVendor{} + this.BecomeVendor = becomeVendor + this.Type = type_ + return &this +} + +// NewBecomeVendorWithDefaults instantiates a new BecomeVendor 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 NewBecomeVendorWithDefaults() *BecomeVendor { + this := BecomeVendor{} + return &this +} + +// GetBecomeVendor returns the BecomeVendor field value +func (o *BecomeVendor) GetBecomeVendor() *BecomeVendorBecomeVendor { + if o == nil || IsNil(o.BecomeVendor) { + var ret *BecomeVendorBecomeVendor + return ret + } + + return o.BecomeVendor +} + +// GetBecomeVendorOk returns a tuple with the BecomeVendor field value +// and a boolean to check if the value has been set. +func (o *BecomeVendor) GetBecomeVendorOk() (*BecomeVendorBecomeVendor, bool) { + if o == nil { + return nil, false + } + return o.BecomeVendor, true +} + +// SetBecomeVendor sets field value +func (o *BecomeVendor) SetBecomeVendor(v *BecomeVendorBecomeVendor) { + o.BecomeVendor = v +} + +// GetType returns the Type field value +func (o *BecomeVendor) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BecomeVendor) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type, true +} + +// SetType sets field value +func (o *BecomeVendor) SetType(v *string) { + o.Type = v +} + +func (o BecomeVendor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["becomeVendor"] = o.BecomeVendor + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBecomeVendor struct { + value *BecomeVendor + isSet bool +} + +func (v NullableBecomeVendor) Get() *BecomeVendor { + return v.value +} + +func (v *NullableBecomeVendor) Set(val *BecomeVendor) { + v.value = val + v.isSet = true +} + +func (v NullableBecomeVendor) IsSet() bool { + return v.isSet +} + +func (v *NullableBecomeVendor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBecomeVendor(val *BecomeVendor) *NullableBecomeVendor { + return &NullableBecomeVendor{value: val, isSet: true} +} + +func (v NullableBecomeVendor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBecomeVendor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_become_vendor_become_vendor.go b/services/stackitmarketplace/model_become_vendor_become_vendor.go new file mode 100644 index 000000000..24798ab01 --- /dev/null +++ b/services/stackitmarketplace/model_become_vendor_become_vendor.go @@ -0,0 +1,140 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the BecomeVendorBecomeVendor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BecomeVendorBecomeVendor{} + +// BecomeVendorBecomeVendor struct for BecomeVendorBecomeVendor +type BecomeVendorBecomeVendor struct { + // The contact e-mail address. + // REQUIRED + ContactEmail *string `json:"contactEmail"` + // The message content. + // REQUIRED + Message *string `json:"message"` +} + +type _BecomeVendorBecomeVendor BecomeVendorBecomeVendor + +// NewBecomeVendorBecomeVendor instantiates a new BecomeVendorBecomeVendor 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 NewBecomeVendorBecomeVendor(contactEmail *string, message *string) *BecomeVendorBecomeVendor { + this := BecomeVendorBecomeVendor{} + this.ContactEmail = contactEmail + this.Message = message + return &this +} + +// NewBecomeVendorBecomeVendorWithDefaults instantiates a new BecomeVendorBecomeVendor 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 NewBecomeVendorBecomeVendorWithDefaults() *BecomeVendorBecomeVendor { + this := BecomeVendorBecomeVendor{} + return &this +} + +// GetContactEmail returns the ContactEmail field value +func (o *BecomeVendorBecomeVendor) GetContactEmail() *string { + if o == nil || IsNil(o.ContactEmail) { + var ret *string + return ret + } + + return o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value +// and a boolean to check if the value has been set. +func (o *BecomeVendorBecomeVendor) GetContactEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContactEmail, true +} + +// SetContactEmail sets field value +func (o *BecomeVendorBecomeVendor) SetContactEmail(v *string) { + o.ContactEmail = v +} + +// GetMessage returns the Message field value +func (o *BecomeVendorBecomeVendor) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *BecomeVendorBecomeVendor) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message, true +} + +// SetMessage sets field value +func (o *BecomeVendorBecomeVendor) SetMessage(v *string) { + o.Message = v +} + +func (o BecomeVendorBecomeVendor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contactEmail"] = o.ContactEmail + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableBecomeVendorBecomeVendor struct { + value *BecomeVendorBecomeVendor + isSet bool +} + +func (v NullableBecomeVendorBecomeVendor) Get() *BecomeVendorBecomeVendor { + return v.value +} + +func (v *NullableBecomeVendorBecomeVendor) Set(val *BecomeVendorBecomeVendor) { + v.value = val + v.isSet = true +} + +func (v NullableBecomeVendorBecomeVendor) IsSet() bool { + return v.isSet +} + +func (v *NullableBecomeVendorBecomeVendor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBecomeVendorBecomeVendor(val *BecomeVendorBecomeVendor) *NullableBecomeVendorBecomeVendor { + return &NullableBecomeVendorBecomeVendor{value: val, isSet: true} +} + +func (v NullableBecomeVendorBecomeVendor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBecomeVendorBecomeVendor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_contact_sales.go b/services/stackitmarketplace/model_contact_sales.go new file mode 100644 index 000000000..78be1ff66 --- /dev/null +++ b/services/stackitmarketplace/model_contact_sales.go @@ -0,0 +1,139 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the ContactSales type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactSales{} + +// ContactSales Contact sales. +type ContactSales struct { + // REQUIRED + ContactSales *ContactSalesContactSales `json:"contactSales"` + // The form type. + // REQUIRED + Type *string `json:"type"` +} + +type _ContactSales ContactSales + +// NewContactSales instantiates a new ContactSales 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 NewContactSales(contactSales *ContactSalesContactSales, type_ *string) *ContactSales { + this := ContactSales{} + this.ContactSales = contactSales + this.Type = type_ + return &this +} + +// NewContactSalesWithDefaults instantiates a new ContactSales 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 NewContactSalesWithDefaults() *ContactSales { + this := ContactSales{} + return &this +} + +// GetContactSales returns the ContactSales field value +func (o *ContactSales) GetContactSales() *ContactSalesContactSales { + if o == nil || IsNil(o.ContactSales) { + var ret *ContactSalesContactSales + return ret + } + + return o.ContactSales +} + +// GetContactSalesOk returns a tuple with the ContactSales field value +// and a boolean to check if the value has been set. +func (o *ContactSales) GetContactSalesOk() (*ContactSalesContactSales, bool) { + if o == nil { + return nil, false + } + return o.ContactSales, true +} + +// SetContactSales sets field value +func (o *ContactSales) SetContactSales(v *ContactSalesContactSales) { + o.ContactSales = v +} + +// GetType returns the Type field value +func (o *ContactSales) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ContactSales) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type, true +} + +// SetType sets field value +func (o *ContactSales) SetType(v *string) { + o.Type = v +} + +func (o ContactSales) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contactSales"] = o.ContactSales + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableContactSales struct { + value *ContactSales + isSet bool +} + +func (v NullableContactSales) Get() *ContactSales { + return v.value +} + +func (v *NullableContactSales) Set(val *ContactSales) { + v.value = val + v.isSet = true +} + +func (v NullableContactSales) IsSet() bool { + return v.isSet +} + +func (v *NullableContactSales) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactSales(val *ContactSales) *NullableContactSales { + return &NullableContactSales{value: val, isSet: true} +} + +func (v NullableContactSales) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactSales) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_contact_sales_contact_sales.go b/services/stackitmarketplace/model_contact_sales_contact_sales.go new file mode 100644 index 000000000..90cf7e87c --- /dev/null +++ b/services/stackitmarketplace/model_contact_sales_contact_sales.go @@ -0,0 +1,227 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the ContactSalesContactSales type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContactSalesContactSales{} + +// ContactSalesContactSales struct for ContactSalesContactSales +type ContactSalesContactSales struct { + // The company name. + // REQUIRED + CompanyName *string `json:"companyName"` + // The contact e-mail address. + // REQUIRED + ContactEmail *string `json:"contactEmail"` + // The full name of the contact person. + // REQUIRED + FullName *string `json:"fullName"` + // The message content. + // REQUIRED + Message *string `json:"message"` + // The product ID. + // REQUIRED + ProductId *string `json:"productId"` +} + +type _ContactSalesContactSales ContactSalesContactSales + +// NewContactSalesContactSales instantiates a new ContactSalesContactSales 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 NewContactSalesContactSales(companyName *string, contactEmail *string, fullName *string, message *string, productId *string) *ContactSalesContactSales { + this := ContactSalesContactSales{} + this.CompanyName = companyName + this.ContactEmail = contactEmail + this.FullName = fullName + this.Message = message + this.ProductId = productId + return &this +} + +// NewContactSalesContactSalesWithDefaults instantiates a new ContactSalesContactSales 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 NewContactSalesContactSalesWithDefaults() *ContactSalesContactSales { + this := ContactSalesContactSales{} + return &this +} + +// GetCompanyName returns the CompanyName field value +func (o *ContactSalesContactSales) GetCompanyName() *string { + if o == nil || IsNil(o.CompanyName) { + var ret *string + return ret + } + + return o.CompanyName +} + +// GetCompanyNameOk returns a tuple with the CompanyName field value +// and a boolean to check if the value has been set. +func (o *ContactSalesContactSales) GetCompanyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CompanyName, true +} + +// SetCompanyName sets field value +func (o *ContactSalesContactSales) SetCompanyName(v *string) { + o.CompanyName = v +} + +// GetContactEmail returns the ContactEmail field value +func (o *ContactSalesContactSales) GetContactEmail() *string { + if o == nil || IsNil(o.ContactEmail) { + var ret *string + return ret + } + + return o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value +// and a boolean to check if the value has been set. +func (o *ContactSalesContactSales) GetContactEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContactEmail, true +} + +// SetContactEmail sets field value +func (o *ContactSalesContactSales) SetContactEmail(v *string) { + o.ContactEmail = v +} + +// GetFullName returns the FullName field value +func (o *ContactSalesContactSales) GetFullName() *string { + if o == nil || IsNil(o.FullName) { + var ret *string + return ret + } + + return o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value +// and a boolean to check if the value has been set. +func (o *ContactSalesContactSales) GetFullNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FullName, true +} + +// SetFullName sets field value +func (o *ContactSalesContactSales) SetFullName(v *string) { + o.FullName = v +} + +// GetMessage returns the Message field value +func (o *ContactSalesContactSales) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ContactSalesContactSales) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message, true +} + +// SetMessage sets field value +func (o *ContactSalesContactSales) SetMessage(v *string) { + o.Message = v +} + +// GetProductId returns the ProductId field value +func (o *ContactSalesContactSales) GetProductId() *string { + if o == nil || IsNil(o.ProductId) { + var ret *string + return ret + } + + return o.ProductId +} + +// GetProductIdOk returns a tuple with the ProductId field value +// and a boolean to check if the value has been set. +func (o *ContactSalesContactSales) GetProductIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProductId, true +} + +// SetProductId sets field value +func (o *ContactSalesContactSales) SetProductId(v *string) { + o.ProductId = v +} + +func (o ContactSalesContactSales) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["companyName"] = o.CompanyName + toSerialize["contactEmail"] = o.ContactEmail + toSerialize["fullName"] = o.FullName + toSerialize["message"] = o.Message + toSerialize["productId"] = o.ProductId + return toSerialize, nil +} + +type NullableContactSalesContactSales struct { + value *ContactSalesContactSales + isSet bool +} + +func (v NullableContactSalesContactSales) Get() *ContactSalesContactSales { + return v.value +} + +func (v *NullableContactSalesContactSales) Set(val *ContactSalesContactSales) { + v.value = val + v.isSet = true +} + +func (v NullableContactSalesContactSales) IsSet() bool { + return v.isSet +} + +func (v *NullableContactSalesContactSales) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContactSalesContactSales(val *ContactSalesContactSales) *NullableContactSalesContactSales { + return &NullableContactSalesContactSales{value: val, isSet: true} +} + +func (v NullableContactSalesContactSales) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContactSalesContactSales) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_inquiries_create_inquiry_payload.go b/services/stackitmarketplace/model_inquiries_create_inquiry_payload.go new file mode 100644 index 000000000..bf69852ab --- /dev/null +++ b/services/stackitmarketplace/model_inquiries_create_inquiry_payload.go @@ -0,0 +1,205 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" + "fmt" +) + +// InquiriesCreateInquiryPayload - struct for InquiriesCreateInquiryPayload +type InquiriesCreateInquiryPayload struct { + BecomeVendor *BecomeVendor + ContactSales *ContactSales + RegisterTesting *RegisterTesting + SuggestProduct *SuggestProduct +} + +// BecomeVendorAsInquiriesCreateInquiryPayload is a convenience function that returns BecomeVendor wrapped in InquiriesCreateInquiryPayload +func BecomeVendorAsInquiriesCreateInquiryPayload(v *BecomeVendor) InquiriesCreateInquiryPayload { + return InquiriesCreateInquiryPayload{ + BecomeVendor: v, + } +} + +// ContactSalesAsInquiriesCreateInquiryPayload is a convenience function that returns ContactSales wrapped in InquiriesCreateInquiryPayload +func ContactSalesAsInquiriesCreateInquiryPayload(v *ContactSales) InquiriesCreateInquiryPayload { + return InquiriesCreateInquiryPayload{ + ContactSales: v, + } +} + +// RegisterTestingAsInquiriesCreateInquiryPayload is a convenience function that returns RegisterTesting wrapped in InquiriesCreateInquiryPayload +func RegisterTestingAsInquiriesCreateInquiryPayload(v *RegisterTesting) InquiriesCreateInquiryPayload { + return InquiriesCreateInquiryPayload{ + RegisterTesting: v, + } +} + +// SuggestProductAsInquiriesCreateInquiryPayload is a convenience function that returns SuggestProduct wrapped in InquiriesCreateInquiryPayload +func SuggestProductAsInquiriesCreateInquiryPayload(v *SuggestProduct) InquiriesCreateInquiryPayload { + return InquiriesCreateInquiryPayload{ + SuggestProduct: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *InquiriesCreateInquiryPayload) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into BecomeVendor + err = newStrictDecoder(data).Decode(&dst.BecomeVendor) + if err == nil { + jsonBecomeVendor, _ := json.Marshal(dst.BecomeVendor) + if string(jsonBecomeVendor) == "{}" { // empty struct + dst.BecomeVendor = nil + } else { + match++ + } + } else { + dst.BecomeVendor = nil + } + + // try to unmarshal data into ContactSales + err = newStrictDecoder(data).Decode(&dst.ContactSales) + if err == nil { + jsonContactSales, _ := json.Marshal(dst.ContactSales) + if string(jsonContactSales) == "{}" { // empty struct + dst.ContactSales = nil + } else { + match++ + } + } else { + dst.ContactSales = nil + } + + // try to unmarshal data into RegisterTesting + err = newStrictDecoder(data).Decode(&dst.RegisterTesting) + if err == nil { + jsonRegisterTesting, _ := json.Marshal(dst.RegisterTesting) + if string(jsonRegisterTesting) == "{}" { // empty struct + dst.RegisterTesting = nil + } else { + match++ + } + } else { + dst.RegisterTesting = nil + } + + // try to unmarshal data into SuggestProduct + err = newStrictDecoder(data).Decode(&dst.SuggestProduct) + if err == nil { + jsonSuggestProduct, _ := json.Marshal(dst.SuggestProduct) + if string(jsonSuggestProduct) == "{}" { // empty struct + dst.SuggestProduct = nil + } else { + match++ + } + } else { + dst.SuggestProduct = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.BecomeVendor = nil + dst.ContactSales = nil + dst.RegisterTesting = nil + dst.SuggestProduct = nil + + return fmt.Errorf("data matches more than one schema in oneOf(InquiriesCreateInquiryPayload)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(InquiriesCreateInquiryPayload)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src InquiriesCreateInquiryPayload) MarshalJSON() ([]byte, error) { + if src.BecomeVendor != nil { + return json.Marshal(&src.BecomeVendor) + } + + if src.ContactSales != nil { + return json.Marshal(&src.ContactSales) + } + + if src.RegisterTesting != nil { + return json.Marshal(&src.RegisterTesting) + } + + if src.SuggestProduct != nil { + return json.Marshal(&src.SuggestProduct) + } + + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object +} + +// Get the actual instance +func (obj *InquiriesCreateInquiryPayload) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BecomeVendor != nil { + return obj.BecomeVendor + } + + if obj.ContactSales != nil { + return obj.ContactSales + } + + if obj.RegisterTesting != nil { + return obj.RegisterTesting + } + + if obj.SuggestProduct != nil { + return obj.SuggestProduct + } + + // all schemas are nil + return nil +} + +type NullableInquiriesCreateInquiryPayload struct { + value *InquiriesCreateInquiryPayload + isSet bool +} + +func (v NullableInquiriesCreateInquiryPayload) Get() *InquiriesCreateInquiryPayload { + return v.value +} + +func (v *NullableInquiriesCreateInquiryPayload) Set(val *InquiriesCreateInquiryPayload) { + v.value = val + v.isSet = true +} + +func (v NullableInquiriesCreateInquiryPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableInquiriesCreateInquiryPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInquiriesCreateInquiryPayload(val *InquiriesCreateInquiryPayload) *NullableInquiriesCreateInquiryPayload { + return &NullableInquiriesCreateInquiryPayload{value: val, isSet: true} +} + +func (v NullableInquiriesCreateInquiryPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInquiriesCreateInquiryPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_register_testing.go b/services/stackitmarketplace/model_register_testing.go new file mode 100644 index 000000000..8875d5f1a --- /dev/null +++ b/services/stackitmarketplace/model_register_testing.go @@ -0,0 +1,139 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the RegisterTesting type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegisterTesting{} + +// RegisterTesting Register for testing. +type RegisterTesting struct { + // REQUIRED + RegisterTesting *RegisterTestingRegisterTesting `json:"registerTesting"` + // The form type. + // REQUIRED + Type *string `json:"type"` +} + +type _RegisterTesting RegisterTesting + +// NewRegisterTesting instantiates a new RegisterTesting 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 NewRegisterTesting(registerTesting *RegisterTestingRegisterTesting, type_ *string) *RegisterTesting { + this := RegisterTesting{} + this.RegisterTesting = registerTesting + this.Type = type_ + return &this +} + +// NewRegisterTestingWithDefaults instantiates a new RegisterTesting 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 NewRegisterTestingWithDefaults() *RegisterTesting { + this := RegisterTesting{} + return &this +} + +// GetRegisterTesting returns the RegisterTesting field value +func (o *RegisterTesting) GetRegisterTesting() *RegisterTestingRegisterTesting { + if o == nil || IsNil(o.RegisterTesting) { + var ret *RegisterTestingRegisterTesting + return ret + } + + return o.RegisterTesting +} + +// GetRegisterTestingOk returns a tuple with the RegisterTesting field value +// and a boolean to check if the value has been set. +func (o *RegisterTesting) GetRegisterTestingOk() (*RegisterTestingRegisterTesting, bool) { + if o == nil { + return nil, false + } + return o.RegisterTesting, true +} + +// SetRegisterTesting sets field value +func (o *RegisterTesting) SetRegisterTesting(v *RegisterTestingRegisterTesting) { + o.RegisterTesting = v +} + +// GetType returns the Type field value +func (o *RegisterTesting) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RegisterTesting) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type, true +} + +// SetType sets field value +func (o *RegisterTesting) SetType(v *string) { + o.Type = v +} + +func (o RegisterTesting) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["registerTesting"] = o.RegisterTesting + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableRegisterTesting struct { + value *RegisterTesting + isSet bool +} + +func (v NullableRegisterTesting) Get() *RegisterTesting { + return v.value +} + +func (v *NullableRegisterTesting) Set(val *RegisterTesting) { + v.value = val + v.isSet = true +} + +func (v NullableRegisterTesting) IsSet() bool { + return v.isSet +} + +func (v *NullableRegisterTesting) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegisterTesting(val *RegisterTesting) *NullableRegisterTesting { + return &NullableRegisterTesting{value: val, isSet: true} +} + +func (v NullableRegisterTesting) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegisterTesting) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_register_testing_register_testing.go b/services/stackitmarketplace/model_register_testing_register_testing.go new file mode 100644 index 000000000..06491effd --- /dev/null +++ b/services/stackitmarketplace/model_register_testing_register_testing.go @@ -0,0 +1,169 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the RegisterTestingRegisterTesting type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegisterTestingRegisterTesting{} + +// RegisterTestingRegisterTesting struct for RegisterTestingRegisterTesting +type RegisterTestingRegisterTesting struct { + // The contact e-mail address. + // REQUIRED + ContactEmail *string `json:"contactEmail"` + // The full name of the contact person. + // REQUIRED + FullName *string `json:"fullName"` + // The message content. + // REQUIRED + Message *string `json:"message"` +} + +type _RegisterTestingRegisterTesting RegisterTestingRegisterTesting + +// NewRegisterTestingRegisterTesting instantiates a new RegisterTestingRegisterTesting 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 NewRegisterTestingRegisterTesting(contactEmail *string, fullName *string, message *string) *RegisterTestingRegisterTesting { + this := RegisterTestingRegisterTesting{} + this.ContactEmail = contactEmail + this.FullName = fullName + this.Message = message + return &this +} + +// NewRegisterTestingRegisterTestingWithDefaults instantiates a new RegisterTestingRegisterTesting 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 NewRegisterTestingRegisterTestingWithDefaults() *RegisterTestingRegisterTesting { + this := RegisterTestingRegisterTesting{} + return &this +} + +// GetContactEmail returns the ContactEmail field value +func (o *RegisterTestingRegisterTesting) GetContactEmail() *string { + if o == nil || IsNil(o.ContactEmail) { + var ret *string + return ret + } + + return o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value +// and a boolean to check if the value has been set. +func (o *RegisterTestingRegisterTesting) GetContactEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContactEmail, true +} + +// SetContactEmail sets field value +func (o *RegisterTestingRegisterTesting) SetContactEmail(v *string) { + o.ContactEmail = v +} + +// GetFullName returns the FullName field value +func (o *RegisterTestingRegisterTesting) GetFullName() *string { + if o == nil || IsNil(o.FullName) { + var ret *string + return ret + } + + return o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value +// and a boolean to check if the value has been set. +func (o *RegisterTestingRegisterTesting) GetFullNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FullName, true +} + +// SetFullName sets field value +func (o *RegisterTestingRegisterTesting) SetFullName(v *string) { + o.FullName = v +} + +// GetMessage returns the Message field value +func (o *RegisterTestingRegisterTesting) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *RegisterTestingRegisterTesting) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message, true +} + +// SetMessage sets field value +func (o *RegisterTestingRegisterTesting) SetMessage(v *string) { + o.Message = v +} + +func (o RegisterTestingRegisterTesting) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contactEmail"] = o.ContactEmail + toSerialize["fullName"] = o.FullName + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableRegisterTestingRegisterTesting struct { + value *RegisterTestingRegisterTesting + isSet bool +} + +func (v NullableRegisterTestingRegisterTesting) Get() *RegisterTestingRegisterTesting { + return v.value +} + +func (v *NullableRegisterTestingRegisterTesting) Set(val *RegisterTestingRegisterTesting) { + v.value = val + v.isSet = true +} + +func (v NullableRegisterTestingRegisterTesting) IsSet() bool { + return v.isSet +} + +func (v *NullableRegisterTestingRegisterTesting) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegisterTestingRegisterTesting(val *RegisterTestingRegisterTesting) *NullableRegisterTestingRegisterTesting { + return &NullableRegisterTestingRegisterTesting{value: val, isSet: true} +} + +func (v NullableRegisterTestingRegisterTesting) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegisterTestingRegisterTesting) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_suggest_product.go b/services/stackitmarketplace/model_suggest_product.go new file mode 100644 index 000000000..446d6470e --- /dev/null +++ b/services/stackitmarketplace/model_suggest_product.go @@ -0,0 +1,139 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the SuggestProduct type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SuggestProduct{} + +// SuggestProduct Suggest a product. +type SuggestProduct struct { + // REQUIRED + SuggestProduct *SuggestProductSuggestProduct `json:"suggestProduct"` + // The form type. + // REQUIRED + Type *string `json:"type"` +} + +type _SuggestProduct SuggestProduct + +// NewSuggestProduct instantiates a new SuggestProduct 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 NewSuggestProduct(suggestProduct *SuggestProductSuggestProduct, type_ *string) *SuggestProduct { + this := SuggestProduct{} + this.SuggestProduct = suggestProduct + this.Type = type_ + return &this +} + +// NewSuggestProductWithDefaults instantiates a new SuggestProduct 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 NewSuggestProductWithDefaults() *SuggestProduct { + this := SuggestProduct{} + return &this +} + +// GetSuggestProduct returns the SuggestProduct field value +func (o *SuggestProduct) GetSuggestProduct() *SuggestProductSuggestProduct { + if o == nil || IsNil(o.SuggestProduct) { + var ret *SuggestProductSuggestProduct + return ret + } + + return o.SuggestProduct +} + +// GetSuggestProductOk returns a tuple with the SuggestProduct field value +// and a boolean to check if the value has been set. +func (o *SuggestProduct) GetSuggestProductOk() (*SuggestProductSuggestProduct, bool) { + if o == nil { + return nil, false + } + return o.SuggestProduct, true +} + +// SetSuggestProduct sets field value +func (o *SuggestProduct) SetSuggestProduct(v *SuggestProductSuggestProduct) { + o.SuggestProduct = v +} + +// GetType returns the Type field value +func (o *SuggestProduct) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *SuggestProduct) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type, true +} + +// SetType sets field value +func (o *SuggestProduct) SetType(v *string) { + o.Type = v +} + +func (o SuggestProduct) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["suggestProduct"] = o.SuggestProduct + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableSuggestProduct struct { + value *SuggestProduct + isSet bool +} + +func (v NullableSuggestProduct) Get() *SuggestProduct { + return v.value +} + +func (v *NullableSuggestProduct) Set(val *SuggestProduct) { + v.value = val + v.isSet = true +} + +func (v NullableSuggestProduct) IsSet() bool { + return v.isSet +} + +func (v *NullableSuggestProduct) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSuggestProduct(val *SuggestProduct) *NullableSuggestProduct { + return &NullableSuggestProduct{value: val, isSet: true} +} + +func (v NullableSuggestProduct) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSuggestProduct) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/stackitmarketplace/model_suggest_product_suggest_product.go b/services/stackitmarketplace/model_suggest_product_suggest_product.go new file mode 100644 index 000000000..919ae69ec --- /dev/null +++ b/services/stackitmarketplace/model_suggest_product_suggest_product.go @@ -0,0 +1,206 @@ +/* +STACKIT Marketplace API + +API to manage STACKIT Marketplace. + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackitmarketplace + +import ( + "encoding/json" +) + +// checks if the SuggestProductSuggestProduct type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SuggestProductSuggestProduct{} + +// SuggestProductSuggestProduct struct for SuggestProductSuggestProduct +type SuggestProductSuggestProduct struct { + // The suggested product's company name. + // REQUIRED + CompanyName *string `json:"companyName"` + // An additional message. + Message *string `json:"message,omitempty"` + // The suggested product name. + // REQUIRED + Name *string `json:"name"` + // The suggested product's website URL. + // REQUIRED + Url *string `json:"url"` +} + +type _SuggestProductSuggestProduct SuggestProductSuggestProduct + +// NewSuggestProductSuggestProduct instantiates a new SuggestProductSuggestProduct 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 NewSuggestProductSuggestProduct(companyName *string, name *string, url *string) *SuggestProductSuggestProduct { + this := SuggestProductSuggestProduct{} + this.CompanyName = companyName + this.Name = name + this.Url = url + return &this +} + +// NewSuggestProductSuggestProductWithDefaults instantiates a new SuggestProductSuggestProduct 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 NewSuggestProductSuggestProductWithDefaults() *SuggestProductSuggestProduct { + this := SuggestProductSuggestProduct{} + return &this +} + +// GetCompanyName returns the CompanyName field value +func (o *SuggestProductSuggestProduct) GetCompanyName() *string { + if o == nil || IsNil(o.CompanyName) { + var ret *string + return ret + } + + return o.CompanyName +} + +// GetCompanyNameOk returns a tuple with the CompanyName field value +// and a boolean to check if the value has been set. +func (o *SuggestProductSuggestProduct) GetCompanyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CompanyName, true +} + +// SetCompanyName sets field value +func (o *SuggestProductSuggestProduct) SetCompanyName(v *string) { + o.CompanyName = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SuggestProductSuggestProduct) GetMessage() *string { + if o == nil || IsNil(o.Message) { + var ret *string + return ret + } + return o.Message +} + +// 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 *SuggestProductSuggestProduct) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SuggestProductSuggestProduct) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *SuggestProductSuggestProduct) SetMessage(v *string) { + o.Message = v +} + +// GetName returns the Name field value +func (o *SuggestProductSuggestProduct) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SuggestProductSuggestProduct) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *SuggestProductSuggestProduct) SetName(v *string) { + o.Name = v +} + +// GetUrl returns the Url field value +func (o *SuggestProductSuggestProduct) GetUrl() *string { + if o == nil || IsNil(o.Url) { + var ret *string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *SuggestProductSuggestProduct) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url, true +} + +// SetUrl sets field value +func (o *SuggestProductSuggestProduct) SetUrl(v *string) { + o.Url = v +} + +func (o SuggestProductSuggestProduct) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["companyName"] = o.CompanyName + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + toSerialize["name"] = o.Name + toSerialize["url"] = o.Url + return toSerialize, nil +} + +type NullableSuggestProductSuggestProduct struct { + value *SuggestProductSuggestProduct + isSet bool +} + +func (v NullableSuggestProductSuggestProduct) Get() *SuggestProductSuggestProduct { + return v.value +} + +func (v *NullableSuggestProductSuggestProduct) Set(val *SuggestProductSuggestProduct) { + v.value = val + v.isSet = true +} + +func (v NullableSuggestProductSuggestProduct) IsSet() bool { + return v.isSet +} + +func (v *NullableSuggestProductSuggestProduct) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSuggestProductSuggestProduct(val *SuggestProductSuggestProduct) *NullableSuggestProductSuggestProduct { + return &NullableSuggestProductSuggestProduct{value: val, isSet: true} +} + +func (v NullableSuggestProductSuggestProduct) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSuggestProductSuggestProduct) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}