From a41bd8e74ce846656db206d01f5e2172302417be Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 4 Nov 2026 12:51:35 +0000 Subject: [PATCH] Generate dns --- services/dns/oas_commit | 2 +- services/dns/v1api/api_default.go | 338 ++++++++++++++++++ services/dns/v1api/api_default_mock.go | 38 ++ .../dns/v1api/model_flush_domain_payload.go | 204 +++++++++++ .../v1api/model_flush_domain_payload_type.go | 156 ++++++++ .../dns/v1api/model_flush_domain_response.go | 154 ++++++++ .../dns/v1api/model_lookup_domain_payload.go | 317 ++++++++++++++++ ...model_lookup_domain_payload_record_type.go | 162 +++++++++ .../v1api/model_lookup_domain_payload_type.go | 114 ++++++ .../dns/v1api/model_lookup_domain_response.go | 191 ++++++++++ services/dns/v1api/model_lookup_record.go | 268 ++++++++++++++ .../dns/v1api/model_lookup_record_type.go | 160 +++++++++ services/dns/v1api/model_lookup_result.go | 231 ++++++++++++ 13 files changed, 2334 insertions(+), 1 deletion(-) create mode 100644 services/dns/v1api/model_flush_domain_payload.go create mode 100644 services/dns/v1api/model_flush_domain_payload_type.go create mode 100644 services/dns/v1api/model_flush_domain_response.go create mode 100644 services/dns/v1api/model_lookup_domain_payload.go create mode 100644 services/dns/v1api/model_lookup_domain_payload_record_type.go create mode 100644 services/dns/v1api/model_lookup_domain_payload_type.go create mode 100644 services/dns/v1api/model_lookup_domain_response.go create mode 100644 services/dns/v1api/model_lookup_record.go create mode 100644 services/dns/v1api/model_lookup_record_type.go create mode 100644 services/dns/v1api/model_lookup_result.go diff --git a/services/dns/oas_commit b/services/dns/oas_commit index 71a76821d4..69b3e8f5b2 100644 --- a/services/dns/oas_commit +++ b/services/dns/oas_commit @@ -1 +1 @@ -0afa5e4924e6bf230fdade5cb294ecfd97dd63e5 +d8fe94d013fb154cf096819b92704f723c8c07de diff --git a/services/dns/v1api/api_default.go b/services/dns/v1api/api_default.go index 46d65f282b..1537d2c463 100644 --- a/services/dns/v1api/api_default.go +++ b/services/dns/v1api/api_default.go @@ -191,6 +191,20 @@ type DefaultAPI interface { // @return ZoneDataExchange ExportRecordSetsExecute(r ApiExportRecordSetsRequest) (*ZoneDataExchange, error) + /* + FlushDomain Flush Route + + allows the user to flush the cache for a domain on the STACKIT DNS Resolvers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlushDomainRequest + */ + FlushDomain(ctx context.Context) ApiFlushDomainRequest + + // FlushDomainExecute executes the request + // @return FlushDomainResponse + FlushDomainExecute(r ApiFlushDomainRequest) (*FlushDomainResponse, error) + /* GetRecordSet Get a single rrset @@ -290,6 +304,20 @@ type DefaultAPI interface { // @return ListZonesResponse ListZonesExecute(r ApiListZonesRequest) (*ListZonesResponse, error) + /* + LookupDomain DNS Lookup Route + + allows the user to lookup a domain on the STACKIT DNS Resolvers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLookupDomainRequest + */ + LookupDomain(ctx context.Context) ApiLookupDomainRequest + + // LookupDomainExecute executes the request + // @return LookupDomainResponse + LookupDomainExecute(r ApiLookupDomainRequest) (*LookupDomainResponse, error) + /* MoveZone move zone from one project to another @@ -2158,6 +2186,161 @@ func (a *DefaultAPIService) ExportRecordSetsExecute(r ApiExportRecordSetsRequest return localVarReturnValue, nil } +type ApiFlushDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + flushDomainPayload *FlushDomainPayload +} + +// domain to flush +func (r ApiFlushDomainRequest) FlushDomainPayload(flushDomainPayload FlushDomainPayload) ApiFlushDomainRequest { + r.flushDomainPayload = &flushDomainPayload + return r +} + +func (r ApiFlushDomainRequest) Execute() (*FlushDomainResponse, error) { + return r.ApiService.FlushDomainExecute(r) +} + +/* +FlushDomain Flush Route + +allows the user to flush the cache for a domain on the STACKIT DNS Resolvers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlushDomainRequest +*/ +func (a *DefaultAPIService) FlushDomain(ctx context.Context) ApiFlushDomainRequest { + return ApiFlushDomainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FlushDomainResponse +func (a *DefaultAPIService) FlushDomainExecute(r ApiFlushDomainRequest) (*FlushDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlushDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.FlushDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/resolver/flush" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.flushDomainPayload == nil { + return localVarReturnValue, reportError("flushDomainPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flushDomainPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Message + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 502 { + var v Message + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + type ApiGetRecordSetRequest struct { ctx context.Context ApiService DefaultAPI @@ -3961,6 +4144,161 @@ func (a *DefaultAPIService) ListZonesExecute(r ApiListZonesRequest) (*ListZonesR return localVarReturnValue, nil } +type ApiLookupDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + lookupDomainPayload *LookupDomainPayload +} + +// records to lookup +func (r ApiLookupDomainRequest) LookupDomainPayload(lookupDomainPayload LookupDomainPayload) ApiLookupDomainRequest { + r.lookupDomainPayload = &lookupDomainPayload + return r +} + +func (r ApiLookupDomainRequest) Execute() (*LookupDomainResponse, error) { + return r.ApiService.LookupDomainExecute(r) +} + +/* +LookupDomain DNS Lookup Route + +allows the user to lookup a domain on the STACKIT DNS Resolvers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLookupDomainRequest +*/ +func (a *DefaultAPIService) LookupDomain(ctx context.Context) ApiLookupDomainRequest { + return ApiLookupDomainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LookupDomainResponse +func (a *DefaultAPIService) LookupDomainExecute(r ApiLookupDomainRequest) (*LookupDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LookupDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.LookupDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/dnslookup" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lookupDomainPayload == nil { + return localVarReturnValue, reportError("lookupDomainPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lookupDomainPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Message + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorMessage + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 502 { + var v Message + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + type ApiMoveZoneRequest struct { ctx context.Context ApiService DefaultAPI diff --git a/services/dns/v1api/api_default_mock.go b/services/dns/v1api/api_default_mock.go index 6f3bcf76a0..9bfff50763 100644 --- a/services/dns/v1api/api_default_mock.go +++ b/services/dns/v1api/api_default_mock.go @@ -41,6 +41,8 @@ type DefaultAPIServiceMock struct { DeleteZoneExecuteMock *func(r ApiDeleteZoneRequest) (*Message, error) // ExportRecordSetsExecuteMock can be populated to implement the behavior of the ExportRecordSetsExecute function of this mock ExportRecordSetsExecuteMock *func(r ApiExportRecordSetsRequest) (*ZoneDataExchange, error) + // FlushDomainExecuteMock can be populated to implement the behavior of the FlushDomainExecute function of this mock + FlushDomainExecuteMock *func(r ApiFlushDomainRequest) (*FlushDomainResponse, error) // GetRecordSetExecuteMock can be populated to implement the behavior of the GetRecordSetExecute function of this mock GetRecordSetExecuteMock *func(r ApiGetRecordSetRequest) (*RecordSetResponse, error) // GetZoneExecuteMock can be populated to implement the behavior of the GetZoneExecute function of this mock @@ -53,6 +55,8 @@ type DefaultAPIServiceMock struct { ListRecordSetsExecuteMock *func(r ApiListRecordSetsRequest) (*ListRecordSetsResponse, error) // ListZonesExecuteMock can be populated to implement the behavior of the ListZonesExecute function of this mock ListZonesExecuteMock *func(r ApiListZonesRequest) (*ListZonesResponse, error) + // LookupDomainExecuteMock can be populated to implement the behavior of the LookupDomainExecute function of this mock + LookupDomainExecuteMock *func(r ApiLookupDomainRequest) (*LookupDomainResponse, error) // MoveZoneExecuteMock can be populated to implement the behavior of the MoveZoneExecute function of this mock MoveZoneExecuteMock *func(r ApiMoveZoneRequest) (*Message, error) // PartialUpdateRecordExecuteMock can be populated to implement the behavior of the PartialUpdateRecordExecute function of this mock @@ -264,6 +268,23 @@ func (a DefaultAPIServiceMock) ExportRecordSetsExecute(r ApiExportRecordSetsRequ return (*a.ExportRecordSetsExecuteMock)(r) } +func (a DefaultAPIServiceMock) FlushDomain(ctx context.Context) ApiFlushDomainRequest { + return ApiFlushDomainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// FlushDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the FlushDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) FlushDomainExecute(r ApiFlushDomainRequest) (*FlushDomainResponse, error) { + if a.FlushDomainExecuteMock == nil { + var localVarReturnValue *FlushDomainResponse + return localVarReturnValue, nil + } + + return (*a.FlushDomainExecuteMock)(r) +} + func (a DefaultAPIServiceMock) GetRecordSet(ctx context.Context, projectId string, zoneId string, rrSetId string) ApiGetRecordSetRequest { return ApiGetRecordSetRequest{ ApiService: a, @@ -379,6 +400,23 @@ func (a DefaultAPIServiceMock) ListZonesExecute(r ApiListZonesRequest) (*ListZon return (*a.ListZonesExecuteMock)(r) } +func (a DefaultAPIServiceMock) LookupDomain(ctx context.Context) ApiLookupDomainRequest { + return ApiLookupDomainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// LookupDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the LookupDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) LookupDomainExecute(r ApiLookupDomainRequest) (*LookupDomainResponse, error) { + if a.LookupDomainExecuteMock == nil { + var localVarReturnValue *LookupDomainResponse + return localVarReturnValue, nil + } + + return (*a.LookupDomainExecuteMock)(r) +} + func (a DefaultAPIServiceMock) MoveZone(ctx context.Context, projectId string) ApiMoveZoneRequest { return ApiMoveZoneRequest{ ApiService: a, diff --git a/services/dns/v1api/model_flush_domain_payload.go b/services/dns/v1api/model_flush_domain_payload.go new file mode 100644 index 0000000000..f41af7df8c --- /dev/null +++ b/services/dns/v1api/model_flush_domain_payload.go @@ -0,0 +1,204 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlushDomainPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlushDomainPayload{} + +// FlushDomainPayload struct for FlushDomainPayload +type FlushDomainPayload struct { + Domain string `json:"domain"` + Type *FlushDomainPayloadType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlushDomainPayload FlushDomainPayload + +// NewFlushDomainPayload instantiates a new FlushDomainPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlushDomainPayload(domain string) *FlushDomainPayload { + this := FlushDomainPayload{} + this.Domain = domain + return &this +} + +// NewFlushDomainPayloadWithDefaults instantiates a new FlushDomainPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlushDomainPayloadWithDefaults() *FlushDomainPayload { + this := FlushDomainPayload{} + return &this +} + +// GetDomain returns the Domain field value +func (o *FlushDomainPayload) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *FlushDomainPayload) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +func (o *FlushDomainPayload) SetDomain(v string) { + o.Domain = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FlushDomainPayload) GetType() FlushDomainPayloadType { + if o == nil || IsNil(o.Type) { + var ret FlushDomainPayloadType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlushDomainPayload) GetTypeOk() (*FlushDomainPayloadType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FlushDomainPayload) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FlushDomainPayloadType and assigns it to the Type field. +func (o *FlushDomainPayload) SetType(v FlushDomainPayloadType) { + o.Type = &v +} + +func (o FlushDomainPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlushDomainPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["domain"] = o.Domain + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlushDomainPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlushDomainPayload := _FlushDomainPayload{} + + err = json.Unmarshal(data, &varFlushDomainPayload) + + if err != nil { + return err + } + + *o = FlushDomainPayload(varFlushDomainPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "domain") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlushDomainPayload struct { + value *FlushDomainPayload + isSet bool +} + +func (v NullableFlushDomainPayload) Get() *FlushDomainPayload { + return v.value +} + +func (v *NullableFlushDomainPayload) Set(val *FlushDomainPayload) { + v.value = val + v.isSet = true +} + +func (v NullableFlushDomainPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableFlushDomainPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlushDomainPayload(val *FlushDomainPayload) *NullableFlushDomainPayload { + return &NullableFlushDomainPayload{value: val, isSet: true} +} + +func (v NullableFlushDomainPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlushDomainPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_flush_domain_payload_type.go b/services/dns/v1api/model_flush_domain_payload_type.go new file mode 100644 index 0000000000..d5149af6b7 --- /dev/null +++ b/services/dns/v1api/model_flush_domain_payload_type.go @@ -0,0 +1,156 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// FlushDomainPayloadType the model 'FlushDomainPayloadType' +type FlushDomainPayloadType string + +// List of FlushDomainPayload_type +const ( + FLUSHDOMAINPAYLOADTYPE_A FlushDomainPayloadType = "A" + FLUSHDOMAINPAYLOADTYPE_AAAA FlushDomainPayloadType = "AAAA" + FLUSHDOMAINPAYLOADTYPE_SOA FlushDomainPayloadType = "SOA" + FLUSHDOMAINPAYLOADTYPE_CNAME FlushDomainPayloadType = "CNAME" + FLUSHDOMAINPAYLOADTYPE_NS FlushDomainPayloadType = "NS" + FLUSHDOMAINPAYLOADTYPE_MX FlushDomainPayloadType = "MX" + FLUSHDOMAINPAYLOADTYPE_TXT FlushDomainPayloadType = "TXT" + FLUSHDOMAINPAYLOADTYPE_SRV FlushDomainPayloadType = "SRV" + FLUSHDOMAINPAYLOADTYPE_PTR FlushDomainPayloadType = "PTR" + FLUSHDOMAINPAYLOADTYPE_DNAME FlushDomainPayloadType = "DNAME" + FLUSHDOMAINPAYLOADTYPE_CAA FlushDomainPayloadType = "CAA" + FLUSHDOMAINPAYLOADTYPE_DNSKEY FlushDomainPayloadType = "DNSKEY" + FLUSHDOMAINPAYLOADTYPE_DS FlushDomainPayloadType = "DS" + FLUSHDOMAINPAYLOADTYPE_LOC FlushDomainPayloadType = "LOC" + FLUSHDOMAINPAYLOADTYPE_NAPTR FlushDomainPayloadType = "NAPTR" + FLUSHDOMAINPAYLOADTYPE_SSHFP FlushDomainPayloadType = "SSHFP" + FLUSHDOMAINPAYLOADTYPE_TLSA FlushDomainPayloadType = "TLSA" + FLUSHDOMAINPAYLOADTYPE_URI FlushDomainPayloadType = "URI" + FLUSHDOMAINPAYLOADTYPE_CERT FlushDomainPayloadType = "CERT" + FLUSHDOMAINPAYLOADTYPE_SVCB FlushDomainPayloadType = "SVCB" + FLUSHDOMAINPAYLOADTYPE_CSYNC FlushDomainPayloadType = "CSYNC" + FLUSHDOMAINPAYLOADTYPE_HINFO FlushDomainPayloadType = "HINFO" + FLUSHDOMAINPAYLOADTYPE_HTTPS FlushDomainPayloadType = "HTTPS" + FLUSHDOMAINPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API FlushDomainPayloadType = "unknown_default_open_api" +) + +// All allowed values of FlushDomainPayloadType enum +var AllowedFlushDomainPayloadTypeEnumValues = []FlushDomainPayloadType{ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "CSYNC", + "HINFO", + "HTTPS", + "unknown_default_open_api", +} + +func (v *FlushDomainPayloadType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlushDomainPayloadType(value) + for _, existing := range AllowedFlushDomainPayloadTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = FLUSHDOMAINPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewFlushDomainPayloadTypeFromValue returns a pointer to a valid FlushDomainPayloadType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlushDomainPayloadTypeFromValue(v string) (*FlushDomainPayloadType, error) { + ev := FlushDomainPayloadType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlushDomainPayloadType: valid values are %v", v, AllowedFlushDomainPayloadTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlushDomainPayloadType) IsValid() bool { + for _, existing := range AllowedFlushDomainPayloadTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FlushDomainPayload_type value +func (v FlushDomainPayloadType) Ptr() *FlushDomainPayloadType { + return &v +} + +type NullableFlushDomainPayloadType struct { + value *FlushDomainPayloadType + isSet bool +} + +func (v NullableFlushDomainPayloadType) Get() *FlushDomainPayloadType { + return v.value +} + +func (v *NullableFlushDomainPayloadType) Set(val *FlushDomainPayloadType) { + v.value = val + v.isSet = true +} + +func (v NullableFlushDomainPayloadType) IsSet() bool { + return v.isSet +} + +func (v *NullableFlushDomainPayloadType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlushDomainPayloadType(val *FlushDomainPayloadType) *NullableFlushDomainPayloadType { + return &NullableFlushDomainPayloadType{value: val, isSet: true} +} + +func (v NullableFlushDomainPayloadType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlushDomainPayloadType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_flush_domain_response.go b/services/dns/v1api/model_flush_domain_response.go new file mode 100644 index 0000000000..5c1b87e04b --- /dev/null +++ b/services/dns/v1api/model_flush_domain_response.go @@ -0,0 +1,154 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the FlushDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlushDomainResponse{} + +// FlushDomainResponse struct for FlushDomainResponse +type FlushDomainResponse struct { + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlushDomainResponse FlushDomainResponse + +// NewFlushDomainResponse instantiates a new FlushDomainResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlushDomainResponse() *FlushDomainResponse { + this := FlushDomainResponse{} + return &this +} + +// NewFlushDomainResponseWithDefaults instantiates a new FlushDomainResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlushDomainResponseWithDefaults() *FlushDomainResponse { + this := FlushDomainResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *FlushDomainResponse) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlushDomainResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *FlushDomainResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *FlushDomainResponse) SetMessage(v string) { + o.Message = &v +} + +func (o FlushDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlushDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlushDomainResponse) UnmarshalJSON(data []byte) (err error) { + varFlushDomainResponse := _FlushDomainResponse{} + + err = json.Unmarshal(data, &varFlushDomainResponse) + + if err != nil { + return err + } + + *o = FlushDomainResponse(varFlushDomainResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlushDomainResponse struct { + value *FlushDomainResponse + isSet bool +} + +func (v NullableFlushDomainResponse) Get() *FlushDomainResponse { + return v.value +} + +func (v *NullableFlushDomainResponse) Set(val *FlushDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFlushDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFlushDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlushDomainResponse(val *FlushDomainResponse) *NullableFlushDomainResponse { + return &NullableFlushDomainResponse{value: val, isSet: true} +} + +func (v NullableFlushDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlushDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_domain_payload.go b/services/dns/v1api/model_lookup_domain_payload.go new file mode 100644 index 0000000000..6123efe1b4 --- /dev/null +++ b/services/dns/v1api/model_lookup_domain_payload.go @@ -0,0 +1,317 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the LookupDomainPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LookupDomainPayload{} + +// LookupDomainPayload struct for LookupDomainPayload +type LookupDomainPayload struct { + // Address is the domain name to look up + Address *string `json:"address,omitempty"` + // IncludeRawResponse indicates whether to include the raw DNS response in the result + IncludeRawResponse *bool `json:"includeRawResponse,omitempty"` + RecordType *LookupDomainPayloadRecordType `json:"recordType,omitempty"` + // Region optionally specifies a STACKIT region to scope the DNS lookup + Region *string `json:"region,omitempty"` + Type *LookupDomainPayloadType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LookupDomainPayload LookupDomainPayload + +// NewLookupDomainPayload instantiates a new LookupDomainPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLookupDomainPayload() *LookupDomainPayload { + this := LookupDomainPayload{} + var includeRawResponse bool = false + this.IncludeRawResponse = &includeRawResponse + var recordType LookupDomainPayloadRecordType = LOOKUPDOMAINPAYLOADRECORDTYPE_A + this.RecordType = &recordType + var types LookupDomainPayloadType = LOOKUPDOMAINPAYLOADTYPE_ONE + this.Type = &types + return &this +} + +// NewLookupDomainPayloadWithDefaults instantiates a new LookupDomainPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLookupDomainPayloadWithDefaults() *LookupDomainPayload { + this := LookupDomainPayload{} + var includeRawResponse bool = false + this.IncludeRawResponse = &includeRawResponse + var recordType LookupDomainPayloadRecordType = LOOKUPDOMAINPAYLOADRECORDTYPE_A + this.RecordType = &recordType + var types LookupDomainPayloadType = LOOKUPDOMAINPAYLOADTYPE_ONE + this.Type = &types + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *LookupDomainPayload) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainPayload) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *LookupDomainPayload) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *LookupDomainPayload) SetAddress(v string) { + o.Address = &v +} + +// GetIncludeRawResponse returns the IncludeRawResponse field value if set, zero value otherwise. +func (o *LookupDomainPayload) GetIncludeRawResponse() bool { + if o == nil || IsNil(o.IncludeRawResponse) { + var ret bool + return ret + } + return *o.IncludeRawResponse +} + +// GetIncludeRawResponseOk returns a tuple with the IncludeRawResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainPayload) GetIncludeRawResponseOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeRawResponse) { + return nil, false + } + return o.IncludeRawResponse, true +} + +// HasIncludeRawResponse returns a boolean if a field has been set. +func (o *LookupDomainPayload) HasIncludeRawResponse() bool { + if o != nil && !IsNil(o.IncludeRawResponse) { + return true + } + + return false +} + +// SetIncludeRawResponse gets a reference to the given bool and assigns it to the IncludeRawResponse field. +func (o *LookupDomainPayload) SetIncludeRawResponse(v bool) { + o.IncludeRawResponse = &v +} + +// GetRecordType returns the RecordType field value if set, zero value otherwise. +func (o *LookupDomainPayload) GetRecordType() LookupDomainPayloadRecordType { + if o == nil || IsNil(o.RecordType) { + var ret LookupDomainPayloadRecordType + return ret + } + return *o.RecordType +} + +// GetRecordTypeOk returns a tuple with the RecordType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainPayload) GetRecordTypeOk() (*LookupDomainPayloadRecordType, bool) { + if o == nil || IsNil(o.RecordType) { + return nil, false + } + return o.RecordType, true +} + +// HasRecordType returns a boolean if a field has been set. +func (o *LookupDomainPayload) HasRecordType() bool { + if o != nil && !IsNil(o.RecordType) { + return true + } + + return false +} + +// SetRecordType gets a reference to the given LookupDomainPayloadRecordType and assigns it to the RecordType field. +func (o *LookupDomainPayload) SetRecordType(v LookupDomainPayloadRecordType) { + o.RecordType = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *LookupDomainPayload) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainPayload) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *LookupDomainPayload) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *LookupDomainPayload) SetRegion(v string) { + o.Region = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LookupDomainPayload) GetType() LookupDomainPayloadType { + if o == nil || IsNil(o.Type) { + var ret LookupDomainPayloadType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainPayload) GetTypeOk() (*LookupDomainPayloadType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LookupDomainPayload) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given LookupDomainPayloadType and assigns it to the Type field. +func (o *LookupDomainPayload) SetType(v LookupDomainPayloadType) { + o.Type = &v +} + +func (o LookupDomainPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LookupDomainPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.IncludeRawResponse) { + toSerialize["includeRawResponse"] = o.IncludeRawResponse + } + if !IsNil(o.RecordType) { + toSerialize["recordType"] = o.RecordType + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LookupDomainPayload) UnmarshalJSON(data []byte) (err error) { + varLookupDomainPayload := _LookupDomainPayload{} + + err = json.Unmarshal(data, &varLookupDomainPayload) + + if err != nil { + return err + } + + *o = LookupDomainPayload(varLookupDomainPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "includeRawResponse") + delete(additionalProperties, "recordType") + delete(additionalProperties, "region") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLookupDomainPayload struct { + value *LookupDomainPayload + isSet bool +} + +func (v NullableLookupDomainPayload) Get() *LookupDomainPayload { + return v.value +} + +func (v *NullableLookupDomainPayload) Set(val *LookupDomainPayload) { + v.value = val + v.isSet = true +} + +func (v NullableLookupDomainPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupDomainPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupDomainPayload(val *LookupDomainPayload) *NullableLookupDomainPayload { + return &NullableLookupDomainPayload{value: val, isSet: true} +} + +func (v NullableLookupDomainPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupDomainPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_domain_payload_record_type.go b/services/dns/v1api/model_lookup_domain_payload_record_type.go new file mode 100644 index 0000000000..898a03f67f --- /dev/null +++ b/services/dns/v1api/model_lookup_domain_payload_record_type.go @@ -0,0 +1,162 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LookupDomainPayloadRecordType RecordType specifies the DNS record type to query (A, AAAA, MX, etc.) If omitted, defaults to ANY records +type LookupDomainPayloadRecordType string + +// List of LookupDomainPayload_recordType +const ( + LOOKUPDOMAINPAYLOADRECORDTYPE_A LookupDomainPayloadRecordType = "A" + LOOKUPDOMAINPAYLOADRECORDTYPE_AAAA LookupDomainPayloadRecordType = "AAAA" + LOOKUPDOMAINPAYLOADRECORDTYPE_SOA LookupDomainPayloadRecordType = "SOA" + LOOKUPDOMAINPAYLOADRECORDTYPE_CNAME LookupDomainPayloadRecordType = "CNAME" + LOOKUPDOMAINPAYLOADRECORDTYPE_NS LookupDomainPayloadRecordType = "NS" + LOOKUPDOMAINPAYLOADRECORDTYPE_MX LookupDomainPayloadRecordType = "MX" + LOOKUPDOMAINPAYLOADRECORDTYPE_TXT LookupDomainPayloadRecordType = "TXT" + LOOKUPDOMAINPAYLOADRECORDTYPE_SRV LookupDomainPayloadRecordType = "SRV" + LOOKUPDOMAINPAYLOADRECORDTYPE_PTR LookupDomainPayloadRecordType = "PTR" + LOOKUPDOMAINPAYLOADRECORDTYPE_ALIAS LookupDomainPayloadRecordType = "ALIAS" + LOOKUPDOMAINPAYLOADRECORDTYPE_DNAME LookupDomainPayloadRecordType = "DNAME" + LOOKUPDOMAINPAYLOADRECORDTYPE_CAA LookupDomainPayloadRecordType = "CAA" + LOOKUPDOMAINPAYLOADRECORDTYPE_DNSKEY LookupDomainPayloadRecordType = "DNSKEY" + LOOKUPDOMAINPAYLOADRECORDTYPE_DS LookupDomainPayloadRecordType = "DS" + LOOKUPDOMAINPAYLOADRECORDTYPE_LOC LookupDomainPayloadRecordType = "LOC" + LOOKUPDOMAINPAYLOADRECORDTYPE_NAPTR LookupDomainPayloadRecordType = "NAPTR" + LOOKUPDOMAINPAYLOADRECORDTYPE_SSHFP LookupDomainPayloadRecordType = "SSHFP" + LOOKUPDOMAINPAYLOADRECORDTYPE_TLSA LookupDomainPayloadRecordType = "TLSA" + LOOKUPDOMAINPAYLOADRECORDTYPE_URI LookupDomainPayloadRecordType = "URI" + LOOKUPDOMAINPAYLOADRECORDTYPE_CERT LookupDomainPayloadRecordType = "CERT" + LOOKUPDOMAINPAYLOADRECORDTYPE_SVCB LookupDomainPayloadRecordType = "SVCB" + LOOKUPDOMAINPAYLOADRECORDTYPE_TYPE LookupDomainPayloadRecordType = "TYPE" + LOOKUPDOMAINPAYLOADRECORDTYPE_CSYNC LookupDomainPayloadRecordType = "CSYNC" + LOOKUPDOMAINPAYLOADRECORDTYPE_HINFO LookupDomainPayloadRecordType = "HINFO" + LOOKUPDOMAINPAYLOADRECORDTYPE_HTTPS LookupDomainPayloadRecordType = "HTTPS" + LOOKUPDOMAINPAYLOADRECORDTYPE_ANY LookupDomainPayloadRecordType = "ANY" + LOOKUPDOMAINPAYLOADRECORDTYPE_UNKNOWN_DEFAULT_OPEN_API LookupDomainPayloadRecordType = "unknown_default_open_api" +) + +// All allowed values of LookupDomainPayloadRecordType enum +var AllowedLookupDomainPayloadRecordTypeEnumValues = []LookupDomainPayloadRecordType{ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "ALIAS", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", + "ANY", + "unknown_default_open_api", +} + +func (v *LookupDomainPayloadRecordType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LookupDomainPayloadRecordType(value) + for _, existing := range AllowedLookupDomainPayloadRecordTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOOKUPDOMAINPAYLOADRECORDTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLookupDomainPayloadRecordTypeFromValue returns a pointer to a valid LookupDomainPayloadRecordType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLookupDomainPayloadRecordTypeFromValue(v string) (*LookupDomainPayloadRecordType, error) { + ev := LookupDomainPayloadRecordType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LookupDomainPayloadRecordType: valid values are %v", v, AllowedLookupDomainPayloadRecordTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LookupDomainPayloadRecordType) IsValid() bool { + for _, existing := range AllowedLookupDomainPayloadRecordTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LookupDomainPayload_recordType value +func (v LookupDomainPayloadRecordType) Ptr() *LookupDomainPayloadRecordType { + return &v +} + +type NullableLookupDomainPayloadRecordType struct { + value *LookupDomainPayloadRecordType + isSet bool +} + +func (v NullableLookupDomainPayloadRecordType) Get() *LookupDomainPayloadRecordType { + return v.value +} + +func (v *NullableLookupDomainPayloadRecordType) Set(val *LookupDomainPayloadRecordType) { + v.value = val + v.isSet = true +} + +func (v NullableLookupDomainPayloadRecordType) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupDomainPayloadRecordType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupDomainPayloadRecordType(val *LookupDomainPayloadRecordType) *NullableLookupDomainPayloadRecordType { + return &NullableLookupDomainPayloadRecordType{value: val, isSet: true} +} + +func (v NullableLookupDomainPayloadRecordType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupDomainPayloadRecordType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_domain_payload_type.go b/services/dns/v1api/model_lookup_domain_payload_type.go new file mode 100644 index 0000000000..cf5b0bd393 --- /dev/null +++ b/services/dns/v1api/model_lookup_domain_payload_type.go @@ -0,0 +1,114 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LookupDomainPayloadType Type specifies whether to query all configured resolvers or just one \"one\" - query a single resolver chosen by round-robin (default) \"all\" - query all configured resolvers +type LookupDomainPayloadType string + +// List of LookupDomainPayload_type +const ( + LOOKUPDOMAINPAYLOADTYPE_ALL LookupDomainPayloadType = "all" + LOOKUPDOMAINPAYLOADTYPE_ONE LookupDomainPayloadType = "one" + LOOKUPDOMAINPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API LookupDomainPayloadType = "unknown_default_open_api" +) + +// All allowed values of LookupDomainPayloadType enum +var AllowedLookupDomainPayloadTypeEnumValues = []LookupDomainPayloadType{ + "all", + "one", + "unknown_default_open_api", +} + +func (v *LookupDomainPayloadType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LookupDomainPayloadType(value) + for _, existing := range AllowedLookupDomainPayloadTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOOKUPDOMAINPAYLOADTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLookupDomainPayloadTypeFromValue returns a pointer to a valid LookupDomainPayloadType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLookupDomainPayloadTypeFromValue(v string) (*LookupDomainPayloadType, error) { + ev := LookupDomainPayloadType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LookupDomainPayloadType: valid values are %v", v, AllowedLookupDomainPayloadTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LookupDomainPayloadType) IsValid() bool { + for _, existing := range AllowedLookupDomainPayloadTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LookupDomainPayload_type value +func (v LookupDomainPayloadType) Ptr() *LookupDomainPayloadType { + return &v +} + +type NullableLookupDomainPayloadType struct { + value *LookupDomainPayloadType + isSet bool +} + +func (v NullableLookupDomainPayloadType) Get() *LookupDomainPayloadType { + return v.value +} + +func (v *NullableLookupDomainPayloadType) Set(val *LookupDomainPayloadType) { + v.value = val + v.isSet = true +} + +func (v NullableLookupDomainPayloadType) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupDomainPayloadType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupDomainPayloadType(val *LookupDomainPayloadType) *NullableLookupDomainPayloadType { + return &NullableLookupDomainPayloadType{value: val, isSet: true} +} + +func (v NullableLookupDomainPayloadType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupDomainPayloadType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_domain_response.go b/services/dns/v1api/model_lookup_domain_response.go new file mode 100644 index 0000000000..1b99b4b2ea --- /dev/null +++ b/services/dns/v1api/model_lookup_domain_response.go @@ -0,0 +1,191 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the LookupDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LookupDomainResponse{} + +// LookupDomainResponse struct for LookupDomainResponse +type LookupDomainResponse struct { + Message *string `json:"message,omitempty"` + State []LookupResult `json:"state,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LookupDomainResponse LookupDomainResponse + +// NewLookupDomainResponse instantiates a new LookupDomainResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLookupDomainResponse() *LookupDomainResponse { + this := LookupDomainResponse{} + return &this +} + +// NewLookupDomainResponseWithDefaults instantiates a new LookupDomainResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLookupDomainResponseWithDefaults() *LookupDomainResponse { + this := LookupDomainResponse{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *LookupDomainResponse) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *LookupDomainResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *LookupDomainResponse) SetMessage(v string) { + o.Message = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *LookupDomainResponse) GetState() []LookupResult { + if o == nil || IsNil(o.State) { + var ret []LookupResult + return ret + } + return o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupDomainResponse) GetStateOk() ([]LookupResult, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *LookupDomainResponse) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given []LookupResult and assigns it to the State field. +func (o *LookupDomainResponse) SetState(v []LookupResult) { + o.State = v +} + +func (o LookupDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LookupDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LookupDomainResponse) UnmarshalJSON(data []byte) (err error) { + varLookupDomainResponse := _LookupDomainResponse{} + + err = json.Unmarshal(data, &varLookupDomainResponse) + + if err != nil { + return err + } + + *o = LookupDomainResponse(varLookupDomainResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLookupDomainResponse struct { + value *LookupDomainResponse + isSet bool +} + +func (v NullableLookupDomainResponse) Get() *LookupDomainResponse { + return v.value +} + +func (v *NullableLookupDomainResponse) Set(val *LookupDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableLookupDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupDomainResponse(val *LookupDomainResponse) *NullableLookupDomainResponse { + return &NullableLookupDomainResponse{value: val, isSet: true} +} + +func (v NullableLookupDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_record.go b/services/dns/v1api/model_lookup_record.go new file mode 100644 index 0000000000..77ce4077b1 --- /dev/null +++ b/services/dns/v1api/model_lookup_record.go @@ -0,0 +1,268 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the LookupRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LookupRecord{} + +// LookupRecord struct for LookupRecord +type LookupRecord struct { + // Data contains the record-specific data (e.g., IP address for A records) + Data *string `json:"data,omitempty"` + // Name is the domain name to which this record applies + Name *string `json:"name,omitempty"` + // TTL (Time To Live) is the duration in seconds that the record may be cached + Ttl *int32 `json:"ttl,omitempty"` + Type *LookupRecordType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LookupRecord LookupRecord + +// NewLookupRecord instantiates a new LookupRecord object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLookupRecord() *LookupRecord { + this := LookupRecord{} + return &this +} + +// NewLookupRecordWithDefaults instantiates a new LookupRecord object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLookupRecordWithDefaults() *LookupRecord { + this := LookupRecord{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *LookupRecord) GetData() string { + if o == nil || IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupRecord) GetDataOk() (*string, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *LookupRecord) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *LookupRecord) SetData(v string) { + o.Data = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LookupRecord) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupRecord) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *LookupRecord) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *LookupRecord) SetName(v string) { + o.Name = &v +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *LookupRecord) GetTtl() int32 { + if o == nil || IsNil(o.Ttl) { + var ret int32 + return ret + } + return *o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupRecord) GetTtlOk() (*int32, bool) { + if o == nil || IsNil(o.Ttl) { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *LookupRecord) HasTtl() bool { + if o != nil && !IsNil(o.Ttl) { + return true + } + + return false +} + +// SetTtl gets a reference to the given int32 and assigns it to the Ttl field. +func (o *LookupRecord) SetTtl(v int32) { + o.Ttl = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *LookupRecord) GetType() LookupRecordType { + if o == nil || IsNil(o.Type) { + var ret LookupRecordType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupRecord) GetTypeOk() (*LookupRecordType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *LookupRecord) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given LookupRecordType and assigns it to the Type field. +func (o *LookupRecord) SetType(v LookupRecordType) { + o.Type = &v +} + +func (o LookupRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LookupRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ttl) { + toSerialize["ttl"] = o.Ttl + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LookupRecord) UnmarshalJSON(data []byte) (err error) { + varLookupRecord := _LookupRecord{} + + err = json.Unmarshal(data, &varLookupRecord) + + if err != nil { + return err + } + + *o = LookupRecord(varLookupRecord) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "name") + delete(additionalProperties, "ttl") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLookupRecord struct { + value *LookupRecord + isSet bool +} + +func (v NullableLookupRecord) Get() *LookupRecord { + return v.value +} + +func (v *NullableLookupRecord) Set(val *LookupRecord) { + v.value = val + v.isSet = true +} + +func (v NullableLookupRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupRecord(val *LookupRecord) *NullableLookupRecord { + return &NullableLookupRecord{value: val, isSet: true} +} + +func (v NullableLookupRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_record_type.go b/services/dns/v1api/model_lookup_record_type.go new file mode 100644 index 0000000000..6e9494de75 --- /dev/null +++ b/services/dns/v1api/model_lookup_record_type.go @@ -0,0 +1,160 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// LookupRecordType Type is the DNS record type (A, AAAA, MX, etc.) +type LookupRecordType string + +// List of LookupRecord_type +const ( + LOOKUPRECORDTYPE_A LookupRecordType = "A" + LOOKUPRECORDTYPE_AAAA LookupRecordType = "AAAA" + LOOKUPRECORDTYPE_SOA LookupRecordType = "SOA" + LOOKUPRECORDTYPE_CNAME LookupRecordType = "CNAME" + LOOKUPRECORDTYPE_NS LookupRecordType = "NS" + LOOKUPRECORDTYPE_MX LookupRecordType = "MX" + LOOKUPRECORDTYPE_TXT LookupRecordType = "TXT" + LOOKUPRECORDTYPE_SRV LookupRecordType = "SRV" + LOOKUPRECORDTYPE_PTR LookupRecordType = "PTR" + LOOKUPRECORDTYPE_ALIAS LookupRecordType = "ALIAS" + LOOKUPRECORDTYPE_DNAME LookupRecordType = "DNAME" + LOOKUPRECORDTYPE_CAA LookupRecordType = "CAA" + LOOKUPRECORDTYPE_DNSKEY LookupRecordType = "DNSKEY" + LOOKUPRECORDTYPE_DS LookupRecordType = "DS" + LOOKUPRECORDTYPE_LOC LookupRecordType = "LOC" + LOOKUPRECORDTYPE_NAPTR LookupRecordType = "NAPTR" + LOOKUPRECORDTYPE_SSHFP LookupRecordType = "SSHFP" + LOOKUPRECORDTYPE_TLSA LookupRecordType = "TLSA" + LOOKUPRECORDTYPE_URI LookupRecordType = "URI" + LOOKUPRECORDTYPE_CERT LookupRecordType = "CERT" + LOOKUPRECORDTYPE_SVCB LookupRecordType = "SVCB" + LOOKUPRECORDTYPE_TYPE LookupRecordType = "TYPE" + LOOKUPRECORDTYPE_CSYNC LookupRecordType = "CSYNC" + LOOKUPRECORDTYPE_HINFO LookupRecordType = "HINFO" + LOOKUPRECORDTYPE_HTTPS LookupRecordType = "HTTPS" + LOOKUPRECORDTYPE_UNKNOWN_DEFAULT_OPEN_API LookupRecordType = "unknown_default_open_api" +) + +// All allowed values of LookupRecordType enum +var AllowedLookupRecordTypeEnumValues = []LookupRecordType{ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "ALIAS", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", + "unknown_default_open_api", +} + +func (v *LookupRecordType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LookupRecordType(value) + for _, existing := range AllowedLookupRecordTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = LOOKUPRECORDTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewLookupRecordTypeFromValue returns a pointer to a valid LookupRecordType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLookupRecordTypeFromValue(v string) (*LookupRecordType, error) { + ev := LookupRecordType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LookupRecordType: valid values are %v", v, AllowedLookupRecordTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LookupRecordType) IsValid() bool { + for _, existing := range AllowedLookupRecordTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LookupRecord_type value +func (v LookupRecordType) Ptr() *LookupRecordType { + return &v +} + +type NullableLookupRecordType struct { + value *LookupRecordType + isSet bool +} + +func (v NullableLookupRecordType) Get() *LookupRecordType { + return v.value +} + +func (v *NullableLookupRecordType) Set(val *LookupRecordType) { + v.value = val + v.isSet = true +} + +func (v NullableLookupRecordType) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupRecordType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupRecordType(val *LookupRecordType) *NullableLookupRecordType { + return &NullableLookupRecordType{value: val, isSet: true} +} + +func (v NullableLookupRecordType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupRecordType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/dns/v1api/model_lookup_result.go b/services/dns/v1api/model_lookup_result.go new file mode 100644 index 0000000000..1473bd3c33 --- /dev/null +++ b/services/dns/v1api/model_lookup_result.go @@ -0,0 +1,231 @@ +/* +STACKIT DNS API + +This api provides dns + +API version: 1.0 +Contact: dns@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the LookupResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LookupResult{} + +// LookupResult struct for LookupResult +type LookupResult struct { + // RawResponse contains the raw DNS response in a human-readable format (only included when requested) + RawResponse *string `json:"rawResponse,omitempty"` + // Records contains the DNS records returned by the lookup + Records []LookupRecord `json:"records,omitempty"` + // ResolverIP is the IP address of the DNS resolver used for the query + ResolverIP *string `json:"resolverIP,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LookupResult LookupResult + +// NewLookupResult instantiates a new LookupResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLookupResult() *LookupResult { + this := LookupResult{} + return &this +} + +// NewLookupResultWithDefaults instantiates a new LookupResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLookupResultWithDefaults() *LookupResult { + this := LookupResult{} + return &this +} + +// GetRawResponse returns the RawResponse field value if set, zero value otherwise. +func (o *LookupResult) GetRawResponse() string { + if o == nil || IsNil(o.RawResponse) { + var ret string + return ret + } + return *o.RawResponse +} + +// GetRawResponseOk returns a tuple with the RawResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupResult) GetRawResponseOk() (*string, bool) { + if o == nil || IsNil(o.RawResponse) { + return nil, false + } + return o.RawResponse, true +} + +// HasRawResponse returns a boolean if a field has been set. +func (o *LookupResult) HasRawResponse() bool { + if o != nil && !IsNil(o.RawResponse) { + return true + } + + return false +} + +// SetRawResponse gets a reference to the given string and assigns it to the RawResponse field. +func (o *LookupResult) SetRawResponse(v string) { + o.RawResponse = &v +} + +// GetRecords returns the Records field value if set, zero value otherwise. +func (o *LookupResult) GetRecords() []LookupRecord { + if o == nil || IsNil(o.Records) { + var ret []LookupRecord + return ret + } + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupResult) GetRecordsOk() ([]LookupRecord, bool) { + if o == nil || IsNil(o.Records) { + return nil, false + } + return o.Records, true +} + +// HasRecords returns a boolean if a field has been set. +func (o *LookupResult) HasRecords() bool { + if o != nil && !IsNil(o.Records) { + return true + } + + return false +} + +// SetRecords gets a reference to the given []LookupRecord and assigns it to the Records field. +func (o *LookupResult) SetRecords(v []LookupRecord) { + o.Records = v +} + +// GetResolverIP returns the ResolverIP field value if set, zero value otherwise. +func (o *LookupResult) GetResolverIP() string { + if o == nil || IsNil(o.ResolverIP) { + var ret string + return ret + } + return *o.ResolverIP +} + +// GetResolverIPOk returns a tuple with the ResolverIP field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LookupResult) GetResolverIPOk() (*string, bool) { + if o == nil || IsNil(o.ResolverIP) { + return nil, false + } + return o.ResolverIP, true +} + +// HasResolverIP returns a boolean if a field has been set. +func (o *LookupResult) HasResolverIP() bool { + if o != nil && !IsNil(o.ResolverIP) { + return true + } + + return false +} + +// SetResolverIP gets a reference to the given string and assigns it to the ResolverIP field. +func (o *LookupResult) SetResolverIP(v string) { + o.ResolverIP = &v +} + +func (o LookupResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LookupResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawResponse) { + toSerialize["rawResponse"] = o.RawResponse + } + if !IsNil(o.Records) { + toSerialize["records"] = o.Records + } + if !IsNil(o.ResolverIP) { + toSerialize["resolverIP"] = o.ResolverIP + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LookupResult) UnmarshalJSON(data []byte) (err error) { + varLookupResult := _LookupResult{} + + err = json.Unmarshal(data, &varLookupResult) + + if err != nil { + return err + } + + *o = LookupResult(varLookupResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rawResponse") + delete(additionalProperties, "records") + delete(additionalProperties, "resolverIP") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLookupResult struct { + value *LookupResult + isSet bool +} + +func (v NullableLookupResult) Get() *LookupResult { + return v.value +} + +func (v *NullableLookupResult) Set(val *LookupResult) { + v.value = val + v.isSet = true +} + +func (v NullableLookupResult) IsSet() bool { + return v.isSet +} + +func (v *NullableLookupResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLookupResult(val *LookupResult) *NullableLookupResult { + return &NullableLookupResult{value: val, isSet: true} +} + +func (v NullableLookupResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLookupResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}