From 31c7e99e44d5a17d4c9765131d3cfa19175f8d60 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 7 Jul 2026 08:27:39 +0000 Subject: [PATCH] Generate cdn --- services/cdn/model_bucket_backend.go | 137 ++++++++++++++++- services/cdn/model_bucket_backend_create.go | 137 ++++++++++++++++- .../cdn/model_bucket_backend_create_test.go | 40 +++++ services/cdn/model_bucket_backend_patch.go | 139 ++++++++++++++++-- .../cdn/model_bucket_backend_patch_test.go | 40 +++++ services/cdn/model_bucket_backend_test.go | 40 +++++ services/cdn/model_http_backend.go | 135 ++++++++++++++++- services/cdn/model_http_backend_create.go | 135 ++++++++++++++++- .../cdn/model_http_backend_create_test.go | 40 +++++ services/cdn/model_http_backend_patch.go | 139 ++++++++++++++++-- services/cdn/model_http_backend_patch_test.go | 40 +++++ services/cdn/model_http_backend_test.go | 40 +++++ services/cdn/model_loki_log_sink.go | 136 ++++++++++++++++- services/cdn/model_loki_log_sink_create.go | 136 ++++++++++++++++- .../cdn/model_loki_log_sink_create_test.go | 40 +++++ .../cdn/model_loki_log_sink_credentials.go | 4 +- services/cdn/model_loki_log_sink_patch.go | 138 +++++++++++++++-- .../cdn/model_loki_log_sink_patch_test.go | 40 +++++ services/cdn/model_loki_log_sink_test.go | 40 +++++ services/cdn/oas_commit | 2 +- services/cdn/v1api/model_bucket_backend.go | 18 ++- .../cdn/v1api/model_bucket_backend_create.go | 20 +-- .../v1api/model_bucket_backend_create_type.go | 111 ++++++++++++++ .../cdn/v1api/model_bucket_backend_patch.go | 20 +-- .../v1api/model_bucket_backend_patch_type.go | 111 ++++++++++++++ .../cdn/v1api/model_bucket_backend_type.go | 111 ++++++++++++++ services/cdn/v1api/model_http_backend.go | 14 +- .../cdn/v1api/model_http_backend_create.go | 14 +- .../v1api/model_http_backend_create_type.go | 111 ++++++++++++++ .../cdn/v1api/model_http_backend_patch.go | 16 +- .../v1api/model_http_backend_patch_type.go | 111 ++++++++++++++ services/cdn/v1api/model_http_backend_type.go | 111 ++++++++++++++ services/cdn/v1api/model_loki_log_sink.go | 15 +- .../cdn/v1api/model_loki_log_sink_create.go | 17 ++- .../v1api/model_loki_log_sink_create_type.go | 111 ++++++++++++++ .../v1api/model_loki_log_sink_credentials.go | 6 +- .../cdn/v1api/model_loki_log_sink_patch.go | 17 ++- .../v1api/model_loki_log_sink_patch_type.go | 111 ++++++++++++++ .../cdn/v1api/model_loki_log_sink_type.go | 111 ++++++++++++++ 39 files changed, 2603 insertions(+), 151 deletions(-) create mode 100644 services/cdn/v1api/model_bucket_backend_create_type.go create mode 100644 services/cdn/v1api/model_bucket_backend_patch_type.go create mode 100644 services/cdn/v1api/model_bucket_backend_type.go create mode 100644 services/cdn/v1api/model_http_backend_create_type.go create mode 100644 services/cdn/v1api/model_http_backend_patch_type.go create mode 100644 services/cdn/v1api/model_http_backend_type.go create mode 100644 services/cdn/v1api/model_loki_log_sink_create_type.go create mode 100644 services/cdn/v1api/model_loki_log_sink_patch_type.go create mode 100644 services/cdn/v1api/model_loki_log_sink_type.go diff --git a/services/cdn/model_bucket_backend.go b/services/cdn/model_bucket_backend.go index f7c91f9a1..0bdf9c8ae 100644 --- a/services/cdn/model_bucket_backend.go +++ b/services/cdn/model_bucket_backend.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the BucketBackend type satisfies the MappedNullable interface at compile time @@ -76,9 +77,132 @@ type BucketBackendGetRegionRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// BucketBackendTypes Defines the type of content origin. For this schema, it must be set to `bucket`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BUCKETBACKENDTYPE_BUCKET BucketBackendTypes = "bucket" +) + +// All allowed values of BucketBackend enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedBucketBackendTypesEnumValues = []BucketBackendTypes{ + "bucket", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendGetTypeAttributeType = *string +func (v *BucketBackendTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson BucketBackendTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := BucketBackendTypes(value) + for _, existing := range AllowedBucketBackendTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BucketBackend", value) +} + +// NewBucketBackendTypesFromValue returns a pointer to a valid BucketBackendTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewBucketBackendTypesFromValue(v BucketBackendTypes) (*BucketBackendTypes, error) { + ev := BucketBackendTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BucketBackendTypes: valid values are %v", v, AllowedBucketBackendTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BucketBackendTypes) IsValid() bool { + for _, existing := range AllowedBucketBackendTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BucketBackendTypes) Ptr() *BucketBackendTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableBucketBackendTypes struct { + value *BucketBackendTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendTypes) Get() *BucketBackendTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendTypes) Set(val *BucketBackendTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableBucketBackendTypes(val *BucketBackendTypes) *NullableBucketBackendTypes { + return &NullableBucketBackendTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendGetTypeAttributeType = *BucketBackendTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendGetTypeArgType = BucketBackendTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendGetTypeRetType = BucketBackendTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendGetTypeAttributeTypeOk(arg BucketBackendGetTypeAttributeType) (ret BucketBackendGetTypeRetType, ok bool) { @@ -93,19 +217,16 @@ func setBucketBackendGetTypeAttributeType(arg *BucketBackendGetTypeAttributeType *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendGetTypeRetType = string - // BucketBackend struct for BucketBackend // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackend struct { + // The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`). // REQUIRED BucketUrl BucketBackendGetBucketUrlAttributeType `json:"bucketUrl" required:"true"` + // The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT). // REQUIRED Region BucketBackendGetRegionAttributeType `json:"region" required:"true"` + // Defines the type of content origin. For this schema, it must be set to `bucket`. // REQUIRED Type BucketBackendGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_bucket_backend_create.go b/services/cdn/model_bucket_backend_create.go index 845ad4034..293e4de94 100644 --- a/services/cdn/model_bucket_backend_create.go +++ b/services/cdn/model_bucket_backend_create.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the BucketBackendCreate type satisfies the MappedNullable interface at compile time @@ -103,9 +104,132 @@ type BucketBackendCreateGetRegionRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// BucketBackendCreateTypes Defines the type of content origin. For this schema, it must be set to `bucket`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendCreateTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BUCKETBACKENDCREATETYPE_BUCKET BucketBackendCreateTypes = "bucket" +) + +// All allowed values of BucketBackendCreate enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedBucketBackendCreateTypesEnumValues = []BucketBackendCreateTypes{ + "bucket", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendCreateGetTypeAttributeType = *string +func (v *BucketBackendCreateTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson BucketBackendCreateTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := BucketBackendCreateTypes(value) + for _, existing := range AllowedBucketBackendCreateTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BucketBackendCreate", value) +} + +// NewBucketBackendCreateTypesFromValue returns a pointer to a valid BucketBackendCreateTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewBucketBackendCreateTypesFromValue(v BucketBackendCreateTypes) (*BucketBackendCreateTypes, error) { + ev := BucketBackendCreateTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BucketBackendCreateTypes: valid values are %v", v, AllowedBucketBackendCreateTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BucketBackendCreateTypes) IsValid() bool { + for _, existing := range AllowedBucketBackendCreateTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BucketBackendCreateTypes) Ptr() *BucketBackendCreateTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableBucketBackendCreateTypes struct { + value *BucketBackendCreateTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendCreateTypes) Get() *BucketBackendCreateTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendCreateTypes) Set(val *BucketBackendCreateTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendCreateTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendCreateTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableBucketBackendCreateTypes(val *BucketBackendCreateTypes) *NullableBucketBackendCreateTypes { + return &NullableBucketBackendCreateTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendCreateTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendCreateTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendCreateGetTypeAttributeType = *BucketBackendCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendCreateGetTypeArgType = BucketBackendCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendCreateGetTypeRetType = BucketBackendCreateTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendCreateGetTypeAttributeTypeOk(arg BucketBackendCreateGetTypeAttributeType) (ret BucketBackendCreateGetTypeRetType, ok bool) { @@ -120,21 +244,18 @@ func setBucketBackendCreateGetTypeAttributeType(arg *BucketBackendCreateGetTypeA *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendCreateGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendCreateGetTypeRetType = string - // BucketBackendCreate struct for BucketBackendCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreate struct { + // The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`). // REQUIRED BucketUrl BucketBackendCreateGetBucketUrlAttributeType `json:"bucketUrl" required:"true"` // REQUIRED Credentials BucketBackendCreateGetCredentialsAttributeType `json:"credentials" required:"true"` + // The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT). // REQUIRED Region BucketBackendCreateGetRegionAttributeType `json:"region" required:"true"` + // Defines the type of content origin. For this schema, it must be set to `bucket`. // REQUIRED Type BucketBackendCreateGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_bucket_backend_create_test.go b/services/cdn/model_bucket_backend_create_test.go index 424823139..5fdf8550b 100644 --- a/services/cdn/model_bucket_backend_create_test.go +++ b/services/cdn/model_bucket_backend_create_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestBucketBackendCreateTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"bucket"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := BucketBackendCreateTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_bucket_backend_patch.go b/services/cdn/model_bucket_backend_patch.go index 5ff895972..a3391ccdd 100644 --- a/services/cdn/model_bucket_backend_patch.go +++ b/services/cdn/model_bucket_backend_patch.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the BucketBackendPatch type satisfies the MappedNullable interface at compile time @@ -103,9 +104,132 @@ type BucketBackendPatchGetRegionRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// BucketBackendPatchTypes Defines the type of content origin. For this schema, it must be set to `bucket`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendPatchTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BUCKETBACKENDPATCHTYPE_BUCKET BucketBackendPatchTypes = "bucket" +) + +// All allowed values of BucketBackendPatch enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedBucketBackendPatchTypesEnumValues = []BucketBackendPatchTypes{ + "bucket", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendPatchGetTypeAttributeType = *string +func (v *BucketBackendPatchTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson BucketBackendPatchTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := BucketBackendPatchTypes(value) + for _, existing := range AllowedBucketBackendPatchTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BucketBackendPatch", value) +} + +// NewBucketBackendPatchTypesFromValue returns a pointer to a valid BucketBackendPatchTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewBucketBackendPatchTypesFromValue(v BucketBackendPatchTypes) (*BucketBackendPatchTypes, error) { + ev := BucketBackendPatchTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BucketBackendPatchTypes: valid values are %v", v, AllowedBucketBackendPatchTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BucketBackendPatchTypes) IsValid() bool { + for _, existing := range AllowedBucketBackendPatchTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BucketBackendPatchTypes) Ptr() *BucketBackendPatchTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableBucketBackendPatchTypes struct { + value *BucketBackendPatchTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendPatchTypes) Get() *BucketBackendPatchTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendPatchTypes) Set(val *BucketBackendPatchTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendPatchTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendPatchTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableBucketBackendPatchTypes(val *BucketBackendPatchTypes) *NullableBucketBackendPatchTypes { + return &NullableBucketBackendPatchTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBucketBackendPatchTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBucketBackendPatchTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendPatchGetTypeAttributeType = *BucketBackendPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendPatchGetTypeArgType = BucketBackendPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BucketBackendPatchGetTypeRetType = BucketBackendPatchTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendPatchGetTypeAttributeTypeOk(arg BucketBackendPatchGetTypeAttributeType) (ret BucketBackendPatchGetTypeRetType, ok bool) { @@ -120,18 +244,15 @@ func setBucketBackendPatchGetTypeAttributeType(arg *BucketBackendPatchGetTypeAtt *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendPatchGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BucketBackendPatchGetTypeRetType = string - // BucketBackendPatch struct for BucketBackendPatch // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatch struct { + // The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`). BucketUrl BucketBackendPatchGetBucketUrlAttributeType `json:"bucketUrl,omitempty"` Credentials BucketBackendPatchGetCredentialsAttributeType `json:"credentials,omitempty"` - Region BucketBackendPatchGetRegionAttributeType `json:"region,omitempty"` + // The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT). + Region BucketBackendPatchGetRegionAttributeType `json:"region,omitempty"` + // Defines the type of content origin. For this schema, it must be set to `bucket`. // REQUIRED Type BucketBackendPatchGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_bucket_backend_patch_test.go b/services/cdn/model_bucket_backend_patch_test.go index 424823139..961bbcaac 100644 --- a/services/cdn/model_bucket_backend_patch_test.go +++ b/services/cdn/model_bucket_backend_patch_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestBucketBackendPatchTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"bucket"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := BucketBackendPatchTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_bucket_backend_test.go b/services/cdn/model_bucket_backend_test.go index 424823139..cc0f55377 100644 --- a/services/cdn/model_bucket_backend_test.go +++ b/services/cdn/model_bucket_backend_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestBucketBackendTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"bucket"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := BucketBackendTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_http_backend.go b/services/cdn/model_http_backend.go index 8719af723..beeabce11 100644 --- a/services/cdn/model_http_backend.go +++ b/services/cdn/model_http_backend.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the HttpBackend type satisfies the MappedNullable interface at compile time @@ -103,9 +104,132 @@ type HttpBackendGetOriginUrlRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// HttpBackendTypes Defines the type of content origin. For this schema, it must be set to `http`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + HTTPBACKENDTYPE_HTTP HttpBackendTypes = "http" +) + +// All allowed values of HttpBackend enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedHttpBackendTypesEnumValues = []HttpBackendTypes{ + "http", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendGetTypeAttributeType = *string +func (v *HttpBackendTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson HttpBackendTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := HttpBackendTypes(value) + for _, existing := range AllowedHttpBackendTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HttpBackend", value) +} + +// NewHttpBackendTypesFromValue returns a pointer to a valid HttpBackendTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewHttpBackendTypesFromValue(v HttpBackendTypes) (*HttpBackendTypes, error) { + ev := HttpBackendTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpBackendTypes: valid values are %v", v, AllowedHttpBackendTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v HttpBackendTypes) IsValid() bool { + for _, existing := range AllowedHttpBackendTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v HttpBackendTypes) Ptr() *HttpBackendTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableHttpBackendTypes struct { + value *HttpBackendTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendTypes) Get() *HttpBackendTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendTypes) Set(val *HttpBackendTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableHttpBackendTypes(val *HttpBackendTypes) *NullableHttpBackendTypes { + return &NullableHttpBackendTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendGetTypeAttributeType = *HttpBackendTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendGetTypeArgType = HttpBackendTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendGetTypeRetType = HttpBackendTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendGetTypeAttributeTypeOk(arg HttpBackendGetTypeAttributeType) (ret HttpBackendGetTypeRetType, ok bool) { @@ -120,12 +244,6 @@ func setHttpBackendGetTypeAttributeType(arg *HttpBackendGetTypeAttributeType, va *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendGetTypeRetType = string - // HttpBackend struct for HttpBackend // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackend struct { @@ -138,6 +256,7 @@ type HttpBackend struct { // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` // REQUIRED OriginUrl HttpBackendGetOriginUrlAttributeType `json:"originUrl" required:"true"` + // Defines the type of content origin. For this schema, it must be set to `http`. // REQUIRED Type HttpBackendGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_http_backend_create.go b/services/cdn/model_http_backend_create.go index e4fb86b2e..7b8d19839 100644 --- a/services/cdn/model_http_backend_create.go +++ b/services/cdn/model_http_backend_create.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the HttpBackendCreate type satisfies the MappedNullable interface at compile time @@ -103,9 +104,132 @@ type HttpBackendCreateGetOriginUrlRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// HttpBackendCreateTypes Defines the type of content origin. For this schema, it must be set to `http`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendCreateTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + HTTPBACKENDCREATETYPE_HTTP HttpBackendCreateTypes = "http" +) + +// All allowed values of HttpBackendCreate enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedHttpBackendCreateTypesEnumValues = []HttpBackendCreateTypes{ + "http", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendCreateGetTypeAttributeType = *string +func (v *HttpBackendCreateTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson HttpBackendCreateTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := HttpBackendCreateTypes(value) + for _, existing := range AllowedHttpBackendCreateTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HttpBackendCreate", value) +} + +// NewHttpBackendCreateTypesFromValue returns a pointer to a valid HttpBackendCreateTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewHttpBackendCreateTypesFromValue(v HttpBackendCreateTypes) (*HttpBackendCreateTypes, error) { + ev := HttpBackendCreateTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpBackendCreateTypes: valid values are %v", v, AllowedHttpBackendCreateTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v HttpBackendCreateTypes) IsValid() bool { + for _, existing := range AllowedHttpBackendCreateTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v HttpBackendCreateTypes) Ptr() *HttpBackendCreateTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableHttpBackendCreateTypes struct { + value *HttpBackendCreateTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendCreateTypes) Get() *HttpBackendCreateTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendCreateTypes) Set(val *HttpBackendCreateTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendCreateTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendCreateTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableHttpBackendCreateTypes(val *HttpBackendCreateTypes) *NullableHttpBackendCreateTypes { + return &NullableHttpBackendCreateTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendCreateTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendCreateTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendCreateGetTypeAttributeType = *HttpBackendCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendCreateGetTypeArgType = HttpBackendCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendCreateGetTypeRetType = HttpBackendCreateTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendCreateGetTypeAttributeTypeOk(arg HttpBackendCreateGetTypeAttributeType) (ret HttpBackendCreateGetTypeRetType, ok bool) { @@ -120,12 +244,6 @@ func setHttpBackendCreateGetTypeAttributeType(arg *HttpBackendCreateGetTypeAttri *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendCreateGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendCreateGetTypeRetType = string - // HttpBackendCreate struct for HttpBackendCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreate struct { @@ -136,6 +254,7 @@ type HttpBackendCreate struct { // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` // REQUIRED OriginUrl HttpBackendCreateGetOriginUrlAttributeType `json:"originUrl" required:"true"` + // Defines the type of content origin. For this schema, it must be set to `http`. // REQUIRED Type HttpBackendCreateGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_http_backend_create_test.go b/services/cdn/model_http_backend_create_test.go index 424823139..39bd56617 100644 --- a/services/cdn/model_http_backend_create_test.go +++ b/services/cdn/model_http_backend_create_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestHttpBackendCreateTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"http"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := HttpBackendCreateTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_http_backend_patch.go b/services/cdn/model_http_backend_patch.go index 279c31ac9..1fceac6eb 100644 --- a/services/cdn/model_http_backend_patch.go +++ b/services/cdn/model_http_backend_patch.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time @@ -103,9 +104,132 @@ type HttpBackendPatchGetOriginUrlRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// HttpBackendPatchTypes Defines the type of content origin. For this schema, it must be set to `http`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendPatchTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + HTTPBACKENDPATCHTYPE_HTTP HttpBackendPatchTypes = "http" +) + +// All allowed values of HttpBackendPatch enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedHttpBackendPatchTypesEnumValues = []HttpBackendPatchTypes{ + "http", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendPatchGetTypeAttributeType = *string +func (v *HttpBackendPatchTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson HttpBackendPatchTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := HttpBackendPatchTypes(value) + for _, existing := range AllowedHttpBackendPatchTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HttpBackendPatch", value) +} + +// NewHttpBackendPatchTypesFromValue returns a pointer to a valid HttpBackendPatchTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewHttpBackendPatchTypesFromValue(v HttpBackendPatchTypes) (*HttpBackendPatchTypes, error) { + ev := HttpBackendPatchTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpBackendPatchTypes: valid values are %v", v, AllowedHttpBackendPatchTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v HttpBackendPatchTypes) IsValid() bool { + for _, existing := range AllowedHttpBackendPatchTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v HttpBackendPatchTypes) Ptr() *HttpBackendPatchTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableHttpBackendPatchTypes struct { + value *HttpBackendPatchTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendPatchTypes) Get() *HttpBackendPatchTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendPatchTypes) Set(val *HttpBackendPatchTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendPatchTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendPatchTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableHttpBackendPatchTypes(val *HttpBackendPatchTypes) *NullableHttpBackendPatchTypes { + return &NullableHttpBackendPatchTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableHttpBackendPatchTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableHttpBackendPatchTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendPatchGetTypeAttributeType = *HttpBackendPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendPatchGetTypeArgType = HttpBackendPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type HttpBackendPatchGetTypeRetType = HttpBackendPatchTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendPatchGetTypeAttributeTypeOk(arg HttpBackendPatchGetTypeAttributeType) (ret HttpBackendPatchGetTypeRetType, ok bool) { @@ -120,12 +244,6 @@ func setHttpBackendPatchGetTypeAttributeType(arg *HttpBackendPatchGetTypeAttribu *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendPatchGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type HttpBackendPatchGetTypeRetType = string - // HttpBackendPatch A partial HTTP Backend // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatch struct { @@ -133,8 +251,9 @@ type HttpBackendPatch struct { Geofencing HttpBackendPatchGetGeofencingAttributeType `json:"geofencing,omitempty"` // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. OriginRequestHeaders HttpBackendPatchGetOriginRequestHeadersAttributeType `json:"originRequestHeaders,omitempty"` - OriginUrl HttpBackendPatchGetOriginUrlAttributeType `json:"originUrl,omitempty"` - // This property is required to determine the used backend type. + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl HttpBackendPatchGetOriginUrlAttributeType `json:"originUrl,omitempty"` + // Defines the type of content origin. For this schema, it must be set to `http`. // REQUIRED Type HttpBackendPatchGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_http_backend_patch_test.go b/services/cdn/model_http_backend_patch_test.go index 424823139..996af145b 100644 --- a/services/cdn/model_http_backend_patch_test.go +++ b/services/cdn/model_http_backend_patch_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestHttpBackendPatchTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"http"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := HttpBackendPatchTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_http_backend_test.go b/services/cdn/model_http_backend_test.go index 424823139..f48efbb95 100644 --- a/services/cdn/model_http_backend_test.go +++ b/services/cdn/model_http_backend_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestHttpBackendTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"http"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := HttpBackendTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_loki_log_sink.go b/services/cdn/model_loki_log_sink.go index 21ba413fd..29e99dd86 100644 --- a/services/cdn/model_loki_log_sink.go +++ b/services/cdn/model_loki_log_sink.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the LokiLogSink type satisfies the MappedNullable interface at compile time @@ -49,9 +50,132 @@ type LokiLogSinkGetPushUrlRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// LokiLogSinkTypes Defines the type of the log sink. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + LOKILOGSINKTYPE_LOKI LokiLogSinkTypes = "loki" +) + +// All allowed values of LokiLogSink enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedLokiLogSinkTypesEnumValues = []LokiLogSinkTypes{ + "loki", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkGetTypeAttributeType = *string +func (v *LokiLogSinkTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson LokiLogSinkTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := LokiLogSinkTypes(value) + for _, existing := range AllowedLokiLogSinkTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LokiLogSink", value) +} + +// NewLokiLogSinkTypesFromValue returns a pointer to a valid LokiLogSinkTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewLokiLogSinkTypesFromValue(v LokiLogSinkTypes) (*LokiLogSinkTypes, error) { + ev := LokiLogSinkTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LokiLogSinkTypes: valid values are %v", v, AllowedLokiLogSinkTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v LokiLogSinkTypes) IsValid() bool { + for _, existing := range AllowedLokiLogSinkTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v LokiLogSinkTypes) Ptr() *LokiLogSinkTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableLokiLogSinkTypes struct { + value *LokiLogSinkTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkTypes) Get() *LokiLogSinkTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkTypes) Set(val *LokiLogSinkTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableLokiLogSinkTypes(val *LokiLogSinkTypes) *NullableLokiLogSinkTypes { + return &NullableLokiLogSinkTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkGetTypeAttributeType = *LokiLogSinkTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkGetTypeArgType = LokiLogSinkTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkGetTypeRetType = LokiLogSinkTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkGetTypeAttributeTypeOk(arg LokiLogSinkGetTypeAttributeType) (ret LokiLogSinkGetTypeRetType, ok bool) { @@ -66,17 +190,13 @@ func setLokiLogSinkGetTypeAttributeType(arg *LokiLogSinkGetTypeAttributeType, va *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkGetTypeRetType = string - // LokiLogSink struct for LokiLogSink // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSink struct { + // The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`). // REQUIRED PushUrl LokiLogSinkGetPushUrlAttributeType `json:"pushUrl" required:"true"` + // Defines the type of the log sink. // REQUIRED Type LokiLogSinkGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_loki_log_sink_create.go b/services/cdn/model_loki_log_sink_create.go index c5886588e..79f755ecd 100644 --- a/services/cdn/model_loki_log_sink_create.go +++ b/services/cdn/model_loki_log_sink_create.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the LokiLogSinkCreate type satisfies the MappedNullable interface at compile time @@ -76,9 +77,132 @@ type LokiLogSinkCreateGetPushUrlRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// LokiLogSinkCreateTypes Defines the type of the log sink. For Grafana Loki, this must be set to `loki`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkCreateTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + LOKILOGSINKCREATETYPE_LOKI LokiLogSinkCreateTypes = "loki" +) + +// All allowed values of LokiLogSinkCreate enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedLokiLogSinkCreateTypesEnumValues = []LokiLogSinkCreateTypes{ + "loki", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkCreateGetTypeAttributeType = *string +func (v *LokiLogSinkCreateTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson LokiLogSinkCreateTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := LokiLogSinkCreateTypes(value) + for _, existing := range AllowedLokiLogSinkCreateTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LokiLogSinkCreate", value) +} + +// NewLokiLogSinkCreateTypesFromValue returns a pointer to a valid LokiLogSinkCreateTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewLokiLogSinkCreateTypesFromValue(v LokiLogSinkCreateTypes) (*LokiLogSinkCreateTypes, error) { + ev := LokiLogSinkCreateTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LokiLogSinkCreateTypes: valid values are %v", v, AllowedLokiLogSinkCreateTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v LokiLogSinkCreateTypes) IsValid() bool { + for _, existing := range AllowedLokiLogSinkCreateTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v LokiLogSinkCreateTypes) Ptr() *LokiLogSinkCreateTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableLokiLogSinkCreateTypes struct { + value *LokiLogSinkCreateTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkCreateTypes) Get() *LokiLogSinkCreateTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkCreateTypes) Set(val *LokiLogSinkCreateTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkCreateTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkCreateTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableLokiLogSinkCreateTypes(val *LokiLogSinkCreateTypes) *NullableLokiLogSinkCreateTypes { + return &NullableLokiLogSinkCreateTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkCreateTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkCreateTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkCreateGetTypeAttributeType = *LokiLogSinkCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkCreateGetTypeArgType = LokiLogSinkCreateTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkCreateGetTypeRetType = LokiLogSinkCreateTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkCreateGetTypeAttributeTypeOk(arg LokiLogSinkCreateGetTypeAttributeType) (ret LokiLogSinkCreateGetTypeRetType, ok bool) { @@ -93,19 +217,15 @@ func setLokiLogSinkCreateGetTypeAttributeType(arg *LokiLogSinkCreateGetTypeAttri *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkCreateGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkCreateGetTypeRetType = string - // LokiLogSinkCreate struct for LokiLogSinkCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreate struct { // REQUIRED Credentials LokiLogSinkCreateGetCredentialsAttributeType `json:"credentials" required:"true"` + // The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`). // REQUIRED PushUrl LokiLogSinkCreateGetPushUrlAttributeType `json:"pushUrl" required:"true"` + // Defines the type of the log sink. For Grafana Loki, this must be set to `loki`. // REQUIRED Type LokiLogSinkCreateGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_loki_log_sink_create_test.go b/services/cdn/model_loki_log_sink_create_test.go index 424823139..e286f9a85 100644 --- a/services/cdn/model_loki_log_sink_create_test.go +++ b/services/cdn/model_loki_log_sink_create_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestLokiLogSinkCreateTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"loki"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := LokiLogSinkCreateTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_loki_log_sink_credentials.go b/services/cdn/model_loki_log_sink_credentials.go index 96c142de4..8fffce13e 100644 --- a/services/cdn/model_loki_log_sink_credentials.go +++ b/services/cdn/model_loki_log_sink_credentials.go @@ -72,11 +72,13 @@ type LokiLogSinkCredentialsGetUsernameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetUsernameRetType = string -// LokiLogSinkCredentials struct for LokiLogSinkCredentials +// LokiLogSinkCredentials The authentication credentials required for the CDN to push logs to your Loki instance. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentials struct { + // The password corresponding to your username. // REQUIRED Password LokiLogSinkCredentialsGetPasswordAttributeType `json:"password" required:"true"` + // The username used to authenticate against your Loki instance. // REQUIRED Username LokiLogSinkCredentialsGetUsernameAttributeType `json:"username" required:"true"` } diff --git a/services/cdn/model_loki_log_sink_patch.go b/services/cdn/model_loki_log_sink_patch.go index 65b88f4f2..9366792e7 100644 --- a/services/cdn/model_loki_log_sink_patch.go +++ b/services/cdn/model_loki_log_sink_patch.go @@ -13,6 +13,7 @@ package cdn import ( "encoding/json" + "fmt" ) // checks if the LokiLogSinkPatch type satisfies the MappedNullable interface at compile time @@ -76,9 +77,132 @@ type LokiLogSinkPatchGetPushUrlRetType = string types and functions for type */ -// isNotNullableString +// isEnum + +// LokiLogSinkPatchTypes Defines the type of the log sink. For Grafana Loki, this must be set to `loki`. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkPatchTypes string + +// List of Type +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + LOKILOGSINKPATCHTYPE_LOKI LokiLogSinkPatchTypes = "loki" +) + +// All allowed values of LokiLogSinkPatch enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedLokiLogSinkPatchTypesEnumValues = []LokiLogSinkPatchTypes{ + "loki", +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkPatchGetTypeAttributeType = *string +func (v *LokiLogSinkPatchTypes) UnmarshalJSON(src []byte) error { + // use a type alias to prevent infinite recursion during unmarshal, + // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers + type TmpJson LokiLogSinkPatchTypes + var value TmpJson + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue TmpJson + if value == zeroValue { + return nil + } + enumTypeValue := LokiLogSinkPatchTypes(value) + for _, existing := range AllowedLokiLogSinkPatchTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LokiLogSinkPatch", value) +} + +// NewLokiLogSinkPatchTypesFromValue returns a pointer to a valid LokiLogSinkPatchTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewLokiLogSinkPatchTypesFromValue(v LokiLogSinkPatchTypes) (*LokiLogSinkPatchTypes, error) { + ev := LokiLogSinkPatchTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LokiLogSinkPatchTypes: valid values are %v", v, AllowedLokiLogSinkPatchTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v LokiLogSinkPatchTypes) IsValid() bool { + for _, existing := range AllowedLokiLogSinkPatchTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v LokiLogSinkPatchTypes) Ptr() *LokiLogSinkPatchTypes { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableLokiLogSinkPatchTypes struct { + value *LokiLogSinkPatchTypes + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkPatchTypes) Get() *LokiLogSinkPatchTypes { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkPatchTypes) Set(val *LokiLogSinkPatchTypes) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkPatchTypes) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkPatchTypes) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableLokiLogSinkPatchTypes(val *LokiLogSinkPatchTypes) *NullableLokiLogSinkPatchTypes { + return &NullableLokiLogSinkPatchTypes{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableLokiLogSinkPatchTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableLokiLogSinkPatchTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkPatchGetTypeAttributeType = *LokiLogSinkPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkPatchGetTypeArgType = LokiLogSinkPatchTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type LokiLogSinkPatchGetTypeRetType = LokiLogSinkPatchTypes // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkPatchGetTypeAttributeTypeOk(arg LokiLogSinkPatchGetTypeAttributeType) (ret LokiLogSinkPatchGetTypeRetType, ok bool) { @@ -93,17 +217,13 @@ func setLokiLogSinkPatchGetTypeAttributeType(arg *LokiLogSinkPatchGetTypeAttribu *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkPatchGetTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LokiLogSinkPatchGetTypeRetType = string - // LokiLogSinkPatch struct for LokiLogSinkPatch // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatch struct { Credentials LokiLogSinkPatchGetCredentialsAttributeType `json:"credentials,omitempty"` - PushUrl LokiLogSinkPatchGetPushUrlAttributeType `json:"pushUrl,omitempty"` + // The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`). + PushUrl LokiLogSinkPatchGetPushUrlAttributeType `json:"pushUrl,omitempty"` + // Defines the type of the log sink. For Grafana Loki, this must be set to `loki`. // REQUIRED Type LokiLogSinkPatchGetTypeAttributeType `json:"type" required:"true"` } diff --git a/services/cdn/model_loki_log_sink_patch_test.go b/services/cdn/model_loki_log_sink_patch_test.go index 424823139..e0c80e0dd 100644 --- a/services/cdn/model_loki_log_sink_patch_test.go +++ b/services/cdn/model_loki_log_sink_patch_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestLokiLogSinkPatchTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"loki"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := LokiLogSinkPatchTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/model_loki_log_sink_test.go b/services/cdn/model_loki_log_sink_test.go index 424823139..3c65f3e29 100644 --- a/services/cdn/model_loki_log_sink_test.go +++ b/services/cdn/model_loki_log_sink_test.go @@ -9,3 +9,43 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package cdn + +import ( + "testing" +) + +// isEnum + +func TestLokiLogSinkTypes_UnmarshalJSON(t *testing.T) { + type args struct { + src []byte + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: `success - possible enum value no. 1`, + args: args{ + src: []byte(`"loki"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := LokiLogSinkTypes("") + if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/services/cdn/oas_commit b/services/cdn/oas_commit index ffaaf3db1..d454462b0 100644 --- a/services/cdn/oas_commit +++ b/services/cdn/oas_commit @@ -1 +1 @@ -18e00f0b26b2cd1f3403bbf0c2e64e7fe333b4d1 +a39a8b7c097d5f7f28b3cfc2392c2036edf374f0 diff --git a/services/cdn/v1api/model_bucket_backend.go b/services/cdn/v1api/model_bucket_backend.go index e63b85c2d..74fdb9037 100644 --- a/services/cdn/v1api/model_bucket_backend.go +++ b/services/cdn/v1api/model_bucket_backend.go @@ -20,9 +20,11 @@ var _ MappedNullable = &BucketBackend{} // BucketBackend struct for BucketBackend type BucketBackend struct { - BucketUrl string `json:"bucketUrl"` - Region string `json:"region"` - Type string `json:"type"` + // The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`). + BucketUrl string `json:"bucketUrl"` + // The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT). + Region string `json:"region"` + Type BucketBackendType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +34,7 @@ type _BucketBackend BucketBackend // 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 NewBucketBackend(bucketUrl string, region string, types string) *BucketBackend { +func NewBucketBackend(bucketUrl string, region string, types BucketBackendType) *BucketBackend { this := BucketBackend{} this.BucketUrl = bucketUrl this.Region = region @@ -97,9 +99,9 @@ func (o *BucketBackend) SetRegion(v string) { } // GetType returns the Type field value -func (o *BucketBackend) GetType() string { +func (o *BucketBackend) GetType() BucketBackendType { if o == nil { - var ret string + var ret BucketBackendType return ret } @@ -108,7 +110,7 @@ func (o *BucketBackend) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *BucketBackend) GetTypeOk() (*string, bool) { +func (o *BucketBackend) GetTypeOk() (*BucketBackendType, bool) { if o == nil { return nil, false } @@ -116,7 +118,7 @@ func (o *BucketBackend) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *BucketBackend) SetType(v string) { +func (o *BucketBackend) SetType(v BucketBackendType) { o.Type = v } diff --git a/services/cdn/v1api/model_bucket_backend_create.go b/services/cdn/v1api/model_bucket_backend_create.go index 67331da7f..52063ccd3 100644 --- a/services/cdn/v1api/model_bucket_backend_create.go +++ b/services/cdn/v1api/model_bucket_backend_create.go @@ -20,10 +20,12 @@ var _ MappedNullable = &BucketBackendCreate{} // BucketBackendCreate struct for BucketBackendCreate type BucketBackendCreate struct { - BucketUrl string `json:"bucketUrl"` - Credentials BucketCredentials `json:"credentials"` - Region string `json:"region"` - Type string `json:"type"` + // The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`). + BucketUrl string `json:"bucketUrl"` + Credentials BucketCredentials `json:"credentials"` + // The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT). + Region string `json:"region"` + Type BucketBackendCreateType `json:"type"` AdditionalProperties map[string]interface{} } @@ -33,7 +35,7 @@ type _BucketBackendCreate BucketBackendCreate // 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 NewBucketBackendCreate(bucketUrl string, credentials BucketCredentials, region string, types string) *BucketBackendCreate { +func NewBucketBackendCreate(bucketUrl string, credentials BucketCredentials, region string, types BucketBackendCreateType) *BucketBackendCreate { this := BucketBackendCreate{} this.BucketUrl = bucketUrl this.Credentials = credentials @@ -123,9 +125,9 @@ func (o *BucketBackendCreate) SetRegion(v string) { } // GetType returns the Type field value -func (o *BucketBackendCreate) GetType() string { +func (o *BucketBackendCreate) GetType() BucketBackendCreateType { if o == nil { - var ret string + var ret BucketBackendCreateType return ret } @@ -134,7 +136,7 @@ func (o *BucketBackendCreate) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *BucketBackendCreate) GetTypeOk() (*string, bool) { +func (o *BucketBackendCreate) GetTypeOk() (*BucketBackendCreateType, bool) { if o == nil { return nil, false } @@ -142,7 +144,7 @@ func (o *BucketBackendCreate) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *BucketBackendCreate) SetType(v string) { +func (o *BucketBackendCreate) SetType(v BucketBackendCreateType) { o.Type = v } diff --git a/services/cdn/v1api/model_bucket_backend_create_type.go b/services/cdn/v1api/model_bucket_backend_create_type.go new file mode 100644 index 000000000..0be953ce8 --- /dev/null +++ b/services/cdn/v1api/model_bucket_backend_create_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// BucketBackendCreateType Defines the type of content origin. For this schema, it must be set to `bucket`. +type BucketBackendCreateType string + +// List of BucketBackendCreate_type +const ( + BUCKETBACKENDCREATETYPE_BUCKET BucketBackendCreateType = "bucket" + BUCKETBACKENDCREATETYPE_UNKNOWN_DEFAULT_OPEN_API BucketBackendCreateType = "unknown_default_open_api" +) + +// All allowed values of BucketBackendCreateType enum +var AllowedBucketBackendCreateTypeEnumValues = []BucketBackendCreateType{ + "bucket", + "unknown_default_open_api", +} + +func (v *BucketBackendCreateType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BucketBackendCreateType(value) + for _, existing := range AllowedBucketBackendCreateTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BUCKETBACKENDCREATETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBucketBackendCreateTypeFromValue returns a pointer to a valid BucketBackendCreateType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBucketBackendCreateTypeFromValue(v string) (*BucketBackendCreateType, error) { + ev := BucketBackendCreateType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BucketBackendCreateType: valid values are %v", v, AllowedBucketBackendCreateTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BucketBackendCreateType) IsValid() bool { + for _, existing := range AllowedBucketBackendCreateTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BucketBackendCreate_type value +func (v BucketBackendCreateType) Ptr() *BucketBackendCreateType { + return &v +} + +type NullableBucketBackendCreateType struct { + value *BucketBackendCreateType + isSet bool +} + +func (v NullableBucketBackendCreateType) Get() *BucketBackendCreateType { + return v.value +} + +func (v *NullableBucketBackendCreateType) Set(val *BucketBackendCreateType) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendCreateType) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendCreateType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendCreateType(val *BucketBackendCreateType) *NullableBucketBackendCreateType { + return &NullableBucketBackendCreateType{value: val, isSet: true} +} + +func (v NullableBucketBackendCreateType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendCreateType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_bucket_backend_patch.go b/services/cdn/v1api/model_bucket_backend_patch.go index 55312728d..f9ded6ea6 100644 --- a/services/cdn/v1api/model_bucket_backend_patch.go +++ b/services/cdn/v1api/model_bucket_backend_patch.go @@ -20,10 +20,12 @@ var _ MappedNullable = &BucketBackendPatch{} // BucketBackendPatch struct for BucketBackendPatch type BucketBackendPatch struct { - BucketUrl *string `json:"bucketUrl,omitempty"` - Credentials *BucketCredentials `json:"credentials,omitempty"` - Region *string `json:"region,omitempty"` - Type string `json:"type"` + // The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`). + BucketUrl *string `json:"bucketUrl,omitempty"` + Credentials *BucketCredentials `json:"credentials,omitempty"` + // The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT). + Region *string `json:"region,omitempty"` + Type BucketBackendPatchType `json:"type"` AdditionalProperties map[string]interface{} } @@ -33,7 +35,7 @@ type _BucketBackendPatch BucketBackendPatch // 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 NewBucketBackendPatch(types string) *BucketBackendPatch { +func NewBucketBackendPatch(types BucketBackendPatchType) *BucketBackendPatch { this := BucketBackendPatch{} this.Type = types return &this @@ -144,9 +146,9 @@ func (o *BucketBackendPatch) SetRegion(v string) { } // GetType returns the Type field value -func (o *BucketBackendPatch) GetType() string { +func (o *BucketBackendPatch) GetType() BucketBackendPatchType { if o == nil { - var ret string + var ret BucketBackendPatchType return ret } @@ -155,7 +157,7 @@ func (o *BucketBackendPatch) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *BucketBackendPatch) GetTypeOk() (*string, bool) { +func (o *BucketBackendPatch) GetTypeOk() (*BucketBackendPatchType, bool) { if o == nil { return nil, false } @@ -163,7 +165,7 @@ func (o *BucketBackendPatch) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *BucketBackendPatch) SetType(v string) { +func (o *BucketBackendPatch) SetType(v BucketBackendPatchType) { o.Type = v } diff --git a/services/cdn/v1api/model_bucket_backend_patch_type.go b/services/cdn/v1api/model_bucket_backend_patch_type.go new file mode 100644 index 000000000..41f888c3f --- /dev/null +++ b/services/cdn/v1api/model_bucket_backend_patch_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// BucketBackendPatchType Defines the type of content origin. For this schema, it must be set to `bucket`. +type BucketBackendPatchType string + +// List of BucketBackendPatch_type +const ( + BUCKETBACKENDPATCHTYPE_BUCKET BucketBackendPatchType = "bucket" + BUCKETBACKENDPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API BucketBackendPatchType = "unknown_default_open_api" +) + +// All allowed values of BucketBackendPatchType enum +var AllowedBucketBackendPatchTypeEnumValues = []BucketBackendPatchType{ + "bucket", + "unknown_default_open_api", +} + +func (v *BucketBackendPatchType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BucketBackendPatchType(value) + for _, existing := range AllowedBucketBackendPatchTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BUCKETBACKENDPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBucketBackendPatchTypeFromValue returns a pointer to a valid BucketBackendPatchType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBucketBackendPatchTypeFromValue(v string) (*BucketBackendPatchType, error) { + ev := BucketBackendPatchType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BucketBackendPatchType: valid values are %v", v, AllowedBucketBackendPatchTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BucketBackendPatchType) IsValid() bool { + for _, existing := range AllowedBucketBackendPatchTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BucketBackendPatch_type value +func (v BucketBackendPatchType) Ptr() *BucketBackendPatchType { + return &v +} + +type NullableBucketBackendPatchType struct { + value *BucketBackendPatchType + isSet bool +} + +func (v NullableBucketBackendPatchType) Get() *BucketBackendPatchType { + return v.value +} + +func (v *NullableBucketBackendPatchType) Set(val *BucketBackendPatchType) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendPatchType) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendPatchType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendPatchType(val *BucketBackendPatchType) *NullableBucketBackendPatchType { + return &NullableBucketBackendPatchType{value: val, isSet: true} +} + +func (v NullableBucketBackendPatchType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendPatchType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_bucket_backend_type.go b/services/cdn/v1api/model_bucket_backend_type.go new file mode 100644 index 000000000..9d611e3dd --- /dev/null +++ b/services/cdn/v1api/model_bucket_backend_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// BucketBackendType Defines the type of content origin. For this schema, it must be set to `bucket`. +type BucketBackendType string + +// List of BucketBackend_type +const ( + BUCKETBACKENDTYPE_BUCKET BucketBackendType = "bucket" + BUCKETBACKENDTYPE_UNKNOWN_DEFAULT_OPEN_API BucketBackendType = "unknown_default_open_api" +) + +// All allowed values of BucketBackendType enum +var AllowedBucketBackendTypeEnumValues = []BucketBackendType{ + "bucket", + "unknown_default_open_api", +} + +func (v *BucketBackendType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BucketBackendType(value) + for _, existing := range AllowedBucketBackendTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BUCKETBACKENDTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBucketBackendTypeFromValue returns a pointer to a valid BucketBackendType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBucketBackendTypeFromValue(v string) (*BucketBackendType, error) { + ev := BucketBackendType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BucketBackendType: valid values are %v", v, AllowedBucketBackendTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BucketBackendType) IsValid() bool { + for _, existing := range AllowedBucketBackendTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BucketBackend_type value +func (v BucketBackendType) Ptr() *BucketBackendType { + return &v +} + +type NullableBucketBackendType struct { + value *BucketBackendType + isSet bool +} + +func (v NullableBucketBackendType) Get() *BucketBackendType { + return v.value +} + +func (v *NullableBucketBackendType) Set(val *BucketBackendType) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendType) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendType(val *BucketBackendType) *NullableBucketBackendType { + return &NullableBucketBackendType{value: val, isSet: true} +} + +func (v NullableBucketBackendType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_http_backend.go b/services/cdn/v1api/model_http_backend.go index 8f961ad45..8c4e80557 100644 --- a/services/cdn/v1api/model_http_backend.go +++ b/services/cdn/v1api/model_http_backend.go @@ -25,8 +25,8 @@ type HttpBackend struct { // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. OriginRequestHeaders map[string]string `json:"originRequestHeaders"` // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` - OriginUrl string `json:"originUrl"` - Type string `json:"type"` + OriginUrl string `json:"originUrl"` + Type HttpBackendType `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _HttpBackend HttpBackend // 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 NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types string) *HttpBackend { +func NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types HttpBackendType) *HttpBackend { this := HttpBackend{} this.Geofencing = geofencing this.OriginRequestHeaders = originRequestHeaders @@ -126,9 +126,9 @@ func (o *HttpBackend) SetOriginUrl(v string) { } // GetType returns the Type field value -func (o *HttpBackend) GetType() string { +func (o *HttpBackend) GetType() HttpBackendType { if o == nil { - var ret string + var ret HttpBackendType return ret } @@ -137,7 +137,7 @@ func (o *HttpBackend) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *HttpBackend) GetTypeOk() (*string, bool) { +func (o *HttpBackend) GetTypeOk() (*HttpBackendType, bool) { if o == nil { return nil, false } @@ -145,7 +145,7 @@ func (o *HttpBackend) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *HttpBackend) SetType(v string) { +func (o *HttpBackend) SetType(v HttpBackendType) { o.Type = v } diff --git a/services/cdn/v1api/model_http_backend_create.go b/services/cdn/v1api/model_http_backend_create.go index ad732ef2c..ba315db00 100644 --- a/services/cdn/v1api/model_http_backend_create.go +++ b/services/cdn/v1api/model_http_backend_create.go @@ -25,8 +25,8 @@ type HttpBackendCreate struct { // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` - OriginUrl string `json:"originUrl"` - Type string `json:"type"` + OriginUrl string `json:"originUrl"` + Type HttpBackendCreateType `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _HttpBackendCreate HttpBackendCreate // 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 NewHttpBackendCreate(originUrl string, types string) *HttpBackendCreate { +func NewHttpBackendCreate(originUrl string, types HttpBackendCreateType) *HttpBackendCreate { this := HttpBackendCreate{} this.OriginUrl = originUrl this.Type = types @@ -140,9 +140,9 @@ func (o *HttpBackendCreate) SetOriginUrl(v string) { } // GetType returns the Type field value -func (o *HttpBackendCreate) GetType() string { +func (o *HttpBackendCreate) GetType() HttpBackendCreateType { if o == nil { - var ret string + var ret HttpBackendCreateType return ret } @@ -151,7 +151,7 @@ func (o *HttpBackendCreate) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *HttpBackendCreate) GetTypeOk() (*string, bool) { +func (o *HttpBackendCreate) GetTypeOk() (*HttpBackendCreateType, bool) { if o == nil { return nil, false } @@ -159,7 +159,7 @@ func (o *HttpBackendCreate) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *HttpBackendCreate) SetType(v string) { +func (o *HttpBackendCreate) SetType(v HttpBackendCreateType) { o.Type = v } diff --git a/services/cdn/v1api/model_http_backend_create_type.go b/services/cdn/v1api/model_http_backend_create_type.go new file mode 100644 index 000000000..fa76d5a24 --- /dev/null +++ b/services/cdn/v1api/model_http_backend_create_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// HttpBackendCreateType Defines the type of content origin. For this schema, it must be set to `http`. +type HttpBackendCreateType string + +// List of HttpBackendCreate_type +const ( + HTTPBACKENDCREATETYPE_HTTP HttpBackendCreateType = "http" + HTTPBACKENDCREATETYPE_UNKNOWN_DEFAULT_OPEN_API HttpBackendCreateType = "unknown_default_open_api" +) + +// All allowed values of HttpBackendCreateType enum +var AllowedHttpBackendCreateTypeEnumValues = []HttpBackendCreateType{ + "http", + "unknown_default_open_api", +} + +func (v *HttpBackendCreateType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HttpBackendCreateType(value) + for _, existing := range AllowedHttpBackendCreateTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = HTTPBACKENDCREATETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewHttpBackendCreateTypeFromValue returns a pointer to a valid HttpBackendCreateType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHttpBackendCreateTypeFromValue(v string) (*HttpBackendCreateType, error) { + ev := HttpBackendCreateType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpBackendCreateType: valid values are %v", v, AllowedHttpBackendCreateTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HttpBackendCreateType) IsValid() bool { + for _, existing := range AllowedHttpBackendCreateTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HttpBackendCreate_type value +func (v HttpBackendCreateType) Ptr() *HttpBackendCreateType { + return &v +} + +type NullableHttpBackendCreateType struct { + value *HttpBackendCreateType + isSet bool +} + +func (v NullableHttpBackendCreateType) Get() *HttpBackendCreateType { + return v.value +} + +func (v *NullableHttpBackendCreateType) Set(val *HttpBackendCreateType) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendCreateType) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendCreateType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendCreateType(val *HttpBackendCreateType) *NullableHttpBackendCreateType { + return &NullableHttpBackendCreateType{value: val, isSet: true} +} + +func (v NullableHttpBackendCreateType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendCreateType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_http_backend_patch.go b/services/cdn/v1api/model_http_backend_patch.go index abd2c7c39..86116750e 100644 --- a/services/cdn/v1api/model_http_backend_patch.go +++ b/services/cdn/v1api/model_http_backend_patch.go @@ -24,9 +24,9 @@ type HttpBackendPatch struct { Geofencing *map[string][]string `json:"geofencing,omitempty"` // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` - OriginUrl *string `json:"originUrl,omitempty"` - // This property is required to determine the used backend type. - Type string `json:"type"` + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl *string `json:"originUrl,omitempty"` + Type HttpBackendPatchType `json:"type"` AdditionalProperties map[string]interface{} } @@ -36,7 +36,7 @@ type _HttpBackendPatch HttpBackendPatch // 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 NewHttpBackendPatch(types string) *HttpBackendPatch { +func NewHttpBackendPatch(types HttpBackendPatchType) *HttpBackendPatch { this := HttpBackendPatch{} this.Type = types return &this @@ -147,9 +147,9 @@ func (o *HttpBackendPatch) SetOriginUrl(v string) { } // GetType returns the Type field value -func (o *HttpBackendPatch) GetType() string { +func (o *HttpBackendPatch) GetType() HttpBackendPatchType { if o == nil { - var ret string + var ret HttpBackendPatchType return ret } @@ -158,7 +158,7 @@ func (o *HttpBackendPatch) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *HttpBackendPatch) GetTypeOk() (*string, bool) { +func (o *HttpBackendPatch) GetTypeOk() (*HttpBackendPatchType, bool) { if o == nil { return nil, false } @@ -166,7 +166,7 @@ func (o *HttpBackendPatch) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *HttpBackendPatch) SetType(v string) { +func (o *HttpBackendPatch) SetType(v HttpBackendPatchType) { o.Type = v } diff --git a/services/cdn/v1api/model_http_backend_patch_type.go b/services/cdn/v1api/model_http_backend_patch_type.go new file mode 100644 index 000000000..cad5f26d2 --- /dev/null +++ b/services/cdn/v1api/model_http_backend_patch_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// HttpBackendPatchType Defines the type of content origin. For this schema, it must be set to `http`. +type HttpBackendPatchType string + +// List of HttpBackendPatch_type +const ( + HTTPBACKENDPATCHTYPE_HTTP HttpBackendPatchType = "http" + HTTPBACKENDPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API HttpBackendPatchType = "unknown_default_open_api" +) + +// All allowed values of HttpBackendPatchType enum +var AllowedHttpBackendPatchTypeEnumValues = []HttpBackendPatchType{ + "http", + "unknown_default_open_api", +} + +func (v *HttpBackendPatchType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HttpBackendPatchType(value) + for _, existing := range AllowedHttpBackendPatchTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = HTTPBACKENDPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewHttpBackendPatchTypeFromValue returns a pointer to a valid HttpBackendPatchType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHttpBackendPatchTypeFromValue(v string) (*HttpBackendPatchType, error) { + ev := HttpBackendPatchType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpBackendPatchType: valid values are %v", v, AllowedHttpBackendPatchTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HttpBackendPatchType) IsValid() bool { + for _, existing := range AllowedHttpBackendPatchTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HttpBackendPatch_type value +func (v HttpBackendPatchType) Ptr() *HttpBackendPatchType { + return &v +} + +type NullableHttpBackendPatchType struct { + value *HttpBackendPatchType + isSet bool +} + +func (v NullableHttpBackendPatchType) Get() *HttpBackendPatchType { + return v.value +} + +func (v *NullableHttpBackendPatchType) Set(val *HttpBackendPatchType) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendPatchType) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendPatchType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendPatchType(val *HttpBackendPatchType) *NullableHttpBackendPatchType { + return &NullableHttpBackendPatchType{value: val, isSet: true} +} + +func (v NullableHttpBackendPatchType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendPatchType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_http_backend_type.go b/services/cdn/v1api/model_http_backend_type.go new file mode 100644 index 000000000..5334ec020 --- /dev/null +++ b/services/cdn/v1api/model_http_backend_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// HttpBackendType Defines the type of content origin. For this schema, it must be set to `http`. +type HttpBackendType string + +// List of HttpBackend_type +const ( + HTTPBACKENDTYPE_HTTP HttpBackendType = "http" + HTTPBACKENDTYPE_UNKNOWN_DEFAULT_OPEN_API HttpBackendType = "unknown_default_open_api" +) + +// All allowed values of HttpBackendType enum +var AllowedHttpBackendTypeEnumValues = []HttpBackendType{ + "http", + "unknown_default_open_api", +} + +func (v *HttpBackendType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HttpBackendType(value) + for _, existing := range AllowedHttpBackendTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = HTTPBACKENDTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewHttpBackendTypeFromValue returns a pointer to a valid HttpBackendType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHttpBackendTypeFromValue(v string) (*HttpBackendType, error) { + ev := HttpBackendType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HttpBackendType: valid values are %v", v, AllowedHttpBackendTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HttpBackendType) IsValid() bool { + for _, existing := range AllowedHttpBackendTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HttpBackend_type value +func (v HttpBackendType) Ptr() *HttpBackendType { + return &v +} + +type NullableHttpBackendType struct { + value *HttpBackendType + isSet bool +} + +func (v NullableHttpBackendType) Get() *HttpBackendType { + return v.value +} + +func (v *NullableHttpBackendType) Set(val *HttpBackendType) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendType) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendType(val *HttpBackendType) *NullableHttpBackendType { + return &NullableHttpBackendType{value: val, isSet: true} +} + +func (v NullableHttpBackendType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink.go b/services/cdn/v1api/model_loki_log_sink.go index d380c1e06..be758fd4a 100644 --- a/services/cdn/v1api/model_loki_log_sink.go +++ b/services/cdn/v1api/model_loki_log_sink.go @@ -20,8 +20,9 @@ var _ MappedNullable = &LokiLogSink{} // LokiLogSink struct for LokiLogSink type LokiLogSink struct { - PushUrl string `json:"pushUrl"` - Type string `json:"type"` + // The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`). + PushUrl string `json:"pushUrl"` + Type LokiLogSinkType `json:"type"` AdditionalProperties map[string]interface{} } @@ -31,7 +32,7 @@ type _LokiLogSink LokiLogSink // 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 NewLokiLogSink(pushUrl string, types string) *LokiLogSink { +func NewLokiLogSink(pushUrl string, types LokiLogSinkType) *LokiLogSink { this := LokiLogSink{} this.PushUrl = pushUrl this.Type = types @@ -71,9 +72,9 @@ func (o *LokiLogSink) SetPushUrl(v string) { } // GetType returns the Type field value -func (o *LokiLogSink) GetType() string { +func (o *LokiLogSink) GetType() LokiLogSinkType { if o == nil { - var ret string + var ret LokiLogSinkType return ret } @@ -82,7 +83,7 @@ func (o *LokiLogSink) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *LokiLogSink) GetTypeOk() (*string, bool) { +func (o *LokiLogSink) GetTypeOk() (*LokiLogSinkType, bool) { if o == nil { return nil, false } @@ -90,7 +91,7 @@ func (o *LokiLogSink) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *LokiLogSink) SetType(v string) { +func (o *LokiLogSink) SetType(v LokiLogSinkType) { o.Type = v } diff --git a/services/cdn/v1api/model_loki_log_sink_create.go b/services/cdn/v1api/model_loki_log_sink_create.go index 1081230ef..61ac33374 100644 --- a/services/cdn/v1api/model_loki_log_sink_create.go +++ b/services/cdn/v1api/model_loki_log_sink_create.go @@ -20,9 +20,10 @@ var _ MappedNullable = &LokiLogSinkCreate{} // LokiLogSinkCreate struct for LokiLogSinkCreate type LokiLogSinkCreate struct { - Credentials LokiLogSinkCredentials `json:"credentials"` - PushUrl string `json:"pushUrl"` - Type string `json:"type"` + Credentials LokiLogSinkCredentials `json:"credentials"` + // The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`). + PushUrl string `json:"pushUrl"` + Type LokiLogSinkCreateType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +33,7 @@ type _LokiLogSinkCreate LokiLogSinkCreate // 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 NewLokiLogSinkCreate(credentials LokiLogSinkCredentials, pushUrl string, types string) *LokiLogSinkCreate { +func NewLokiLogSinkCreate(credentials LokiLogSinkCredentials, pushUrl string, types LokiLogSinkCreateType) *LokiLogSinkCreate { this := LokiLogSinkCreate{} this.Credentials = credentials this.PushUrl = pushUrl @@ -97,9 +98,9 @@ func (o *LokiLogSinkCreate) SetPushUrl(v string) { } // GetType returns the Type field value -func (o *LokiLogSinkCreate) GetType() string { +func (o *LokiLogSinkCreate) GetType() LokiLogSinkCreateType { if o == nil { - var ret string + var ret LokiLogSinkCreateType return ret } @@ -108,7 +109,7 @@ func (o *LokiLogSinkCreate) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *LokiLogSinkCreate) GetTypeOk() (*string, bool) { +func (o *LokiLogSinkCreate) GetTypeOk() (*LokiLogSinkCreateType, bool) { if o == nil { return nil, false } @@ -116,7 +117,7 @@ func (o *LokiLogSinkCreate) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *LokiLogSinkCreate) SetType(v string) { +func (o *LokiLogSinkCreate) SetType(v LokiLogSinkCreateType) { o.Type = v } diff --git a/services/cdn/v1api/model_loki_log_sink_create_type.go b/services/cdn/v1api/model_loki_log_sink_create_type.go new file mode 100644 index 000000000..c02586060 --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink_create_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LokiLogSinkCreateType Defines the type of the log sink. For Grafana Loki, this must be set to `loki`. +type LokiLogSinkCreateType string + +// List of LokiLogSinkCreate_type +const ( + LOKILOGSINKCREATETYPE_LOKI LokiLogSinkCreateType = "loki" + LOKILOGSINKCREATETYPE_UNKNOWN_DEFAULT_OPEN_API LokiLogSinkCreateType = "unknown_default_open_api" +) + +// All allowed values of LokiLogSinkCreateType enum +var AllowedLokiLogSinkCreateTypeEnumValues = []LokiLogSinkCreateType{ + "loki", + "unknown_default_open_api", +} + +func (v *LokiLogSinkCreateType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LokiLogSinkCreateType(value) + for _, existing := range AllowedLokiLogSinkCreateTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOKILOGSINKCREATETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLokiLogSinkCreateTypeFromValue returns a pointer to a valid LokiLogSinkCreateType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLokiLogSinkCreateTypeFromValue(v string) (*LokiLogSinkCreateType, error) { + ev := LokiLogSinkCreateType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LokiLogSinkCreateType: valid values are %v", v, AllowedLokiLogSinkCreateTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LokiLogSinkCreateType) IsValid() bool { + for _, existing := range AllowedLokiLogSinkCreateTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LokiLogSinkCreate_type value +func (v LokiLogSinkCreateType) Ptr() *LokiLogSinkCreateType { + return &v +} + +type NullableLokiLogSinkCreateType struct { + value *LokiLogSinkCreateType + isSet bool +} + +func (v NullableLokiLogSinkCreateType) Get() *LokiLogSinkCreateType { + return v.value +} + +func (v *NullableLokiLogSinkCreateType) Set(val *LokiLogSinkCreateType) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkCreateType) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkCreateType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkCreateType(val *LokiLogSinkCreateType) *NullableLokiLogSinkCreateType { + return &NullableLokiLogSinkCreateType{value: val, isSet: true} +} + +func (v NullableLokiLogSinkCreateType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkCreateType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink_credentials.go b/services/cdn/v1api/model_loki_log_sink_credentials.go index 5b246d570..931ab8e05 100644 --- a/services/cdn/v1api/model_loki_log_sink_credentials.go +++ b/services/cdn/v1api/model_loki_log_sink_credentials.go @@ -18,9 +18,11 @@ import ( // checks if the LokiLogSinkCredentials type satisfies the MappedNullable interface at compile time var _ MappedNullable = &LokiLogSinkCredentials{} -// LokiLogSinkCredentials struct for LokiLogSinkCredentials +// LokiLogSinkCredentials The authentication credentials required for the CDN to push logs to your Loki instance. type LokiLogSinkCredentials struct { - Password string `json:"password"` + // The password corresponding to your username. + Password string `json:"password"` + // The username used to authenticate against your Loki instance. Username string `json:"username"` AdditionalProperties map[string]interface{} } diff --git a/services/cdn/v1api/model_loki_log_sink_patch.go b/services/cdn/v1api/model_loki_log_sink_patch.go index c2f49e913..3f38f1821 100644 --- a/services/cdn/v1api/model_loki_log_sink_patch.go +++ b/services/cdn/v1api/model_loki_log_sink_patch.go @@ -20,9 +20,10 @@ var _ MappedNullable = &LokiLogSinkPatch{} // LokiLogSinkPatch struct for LokiLogSinkPatch type LokiLogSinkPatch struct { - Credentials *LokiLogSinkCredentials `json:"credentials,omitempty"` - PushUrl *string `json:"pushUrl,omitempty"` - Type string `json:"type"` + Credentials *LokiLogSinkCredentials `json:"credentials,omitempty"` + // The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`). + PushUrl *string `json:"pushUrl,omitempty"` + Type LokiLogSinkPatchType `json:"type"` AdditionalProperties map[string]interface{} } @@ -32,7 +33,7 @@ type _LokiLogSinkPatch LokiLogSinkPatch // 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 NewLokiLogSinkPatch(types string) *LokiLogSinkPatch { +func NewLokiLogSinkPatch(types LokiLogSinkPatchType) *LokiLogSinkPatch { this := LokiLogSinkPatch{} this.Type = types return &this @@ -111,9 +112,9 @@ func (o *LokiLogSinkPatch) SetPushUrl(v string) { } // GetType returns the Type field value -func (o *LokiLogSinkPatch) GetType() string { +func (o *LokiLogSinkPatch) GetType() LokiLogSinkPatchType { if o == nil { - var ret string + var ret LokiLogSinkPatchType return ret } @@ -122,7 +123,7 @@ func (o *LokiLogSinkPatch) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *LokiLogSinkPatch) GetTypeOk() (*string, bool) { +func (o *LokiLogSinkPatch) GetTypeOk() (*LokiLogSinkPatchType, bool) { if o == nil { return nil, false } @@ -130,7 +131,7 @@ func (o *LokiLogSinkPatch) GetTypeOk() (*string, bool) { } // SetType sets field value -func (o *LokiLogSinkPatch) SetType(v string) { +func (o *LokiLogSinkPatch) SetType(v LokiLogSinkPatchType) { o.Type = v } diff --git a/services/cdn/v1api/model_loki_log_sink_patch_type.go b/services/cdn/v1api/model_loki_log_sink_patch_type.go new file mode 100644 index 000000000..a1f319f4f --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink_patch_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LokiLogSinkPatchType Defines the type of the log sink. For Grafana Loki, this must be set to `loki`. +type LokiLogSinkPatchType string + +// List of LokiLogSinkPatch_type +const ( + LOKILOGSINKPATCHTYPE_LOKI LokiLogSinkPatchType = "loki" + LOKILOGSINKPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API LokiLogSinkPatchType = "unknown_default_open_api" +) + +// All allowed values of LokiLogSinkPatchType enum +var AllowedLokiLogSinkPatchTypeEnumValues = []LokiLogSinkPatchType{ + "loki", + "unknown_default_open_api", +} + +func (v *LokiLogSinkPatchType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LokiLogSinkPatchType(value) + for _, existing := range AllowedLokiLogSinkPatchTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOKILOGSINKPATCHTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLokiLogSinkPatchTypeFromValue returns a pointer to a valid LokiLogSinkPatchType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLokiLogSinkPatchTypeFromValue(v string) (*LokiLogSinkPatchType, error) { + ev := LokiLogSinkPatchType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LokiLogSinkPatchType: valid values are %v", v, AllowedLokiLogSinkPatchTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LokiLogSinkPatchType) IsValid() bool { + for _, existing := range AllowedLokiLogSinkPatchTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LokiLogSinkPatch_type value +func (v LokiLogSinkPatchType) Ptr() *LokiLogSinkPatchType { + return &v +} + +type NullableLokiLogSinkPatchType struct { + value *LokiLogSinkPatchType + isSet bool +} + +func (v NullableLokiLogSinkPatchType) Get() *LokiLogSinkPatchType { + return v.value +} + +func (v *NullableLokiLogSinkPatchType) Set(val *LokiLogSinkPatchType) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkPatchType) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkPatchType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkPatchType(val *LokiLogSinkPatchType) *NullableLokiLogSinkPatchType { + return &NullableLokiLogSinkPatchType{value: val, isSet: true} +} + +func (v NullableLokiLogSinkPatchType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkPatchType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink_type.go b/services/cdn/v1api/model_loki_log_sink_type.go new file mode 100644 index 000000000..4af5c97bf --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink_type.go @@ -0,0 +1,111 @@ +/* +STACKIT CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LokiLogSinkType Defines the type of the log sink. +type LokiLogSinkType string + +// List of LokiLogSink_type +const ( + LOKILOGSINKTYPE_LOKI LokiLogSinkType = "loki" + LOKILOGSINKTYPE_UNKNOWN_DEFAULT_OPEN_API LokiLogSinkType = "unknown_default_open_api" +) + +// All allowed values of LokiLogSinkType enum +var AllowedLokiLogSinkTypeEnumValues = []LokiLogSinkType{ + "loki", + "unknown_default_open_api", +} + +func (v *LokiLogSinkType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LokiLogSinkType(value) + for _, existing := range AllowedLokiLogSinkTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOKILOGSINKTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLokiLogSinkTypeFromValue returns a pointer to a valid LokiLogSinkType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLokiLogSinkTypeFromValue(v string) (*LokiLogSinkType, error) { + ev := LokiLogSinkType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LokiLogSinkType: valid values are %v", v, AllowedLokiLogSinkTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LokiLogSinkType) IsValid() bool { + for _, existing := range AllowedLokiLogSinkTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LokiLogSink_type value +func (v LokiLogSinkType) Ptr() *LokiLogSinkType { + return &v +} + +type NullableLokiLogSinkType struct { + value *LokiLogSinkType + isSet bool +} + +func (v NullableLokiLogSinkType) Get() *LokiLogSinkType { + return v.value +} + +func (v *NullableLokiLogSinkType) Set(val *LokiLogSinkType) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkType) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkType(val *LokiLogSinkType) *NullableLokiLogSinkType { + return &NullableLokiLogSinkType{value: val, isSet: true} +} + +func (v NullableLokiLogSinkType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}