From 2abc9f1d611c8f4618a4224fc6ba01abcdd35d04 Mon Sep 17 00:00:00 2001 From: Ashish Mathew Date: Wed, 29 Nov 2023 19:41:32 -0800 Subject: [PATCH 1/3] Add DDI keys client --- README.md | 11 +- client/client.go | 8 + keys/.openapi-generator-ignore | 23 + keys/.openapi-generator/FILES | 43 + keys/.openapi-generator/VERSION | 1 + keys/README.md | 160 ++++ keys/api_generate_tsig.go | 159 ++++ keys/api_kerberos.go | 630 +++++++++++++++ keys/api_tsig.go | 765 ++++++++++++++++++ keys/api_upload.go | 160 ++++ keys/client.go | 44 + keys/docs/DdiuploadResponse.md | 82 ++ keys/docs/GenerateTsigAPI.md | 75 ++ keys/docs/KerberosAPI.md | 304 +++++++ keys/docs/KerberosKey.md | 238 ++++++ keys/docs/KerberosKeys.md | 56 ++ keys/docs/KeysCreateTSIGKeyResponse.md | 56 ++ keys/docs/KeysGenerateTSIGResponse.md | 56 ++ keys/docs/KeysGenerateTSIGResult.md | 56 ++ keys/docs/KeysListKerberosKeyResponse.md | 56 ++ keys/docs/KeysListTSIGKeyResponse.md | 56 ++ keys/docs/KeysReadKerberosKeyResponse.md | 56 ++ keys/docs/KeysReadTSIGKeyResponse.md | 56 ++ keys/docs/KeysTSIGKey.md | 254 ++++++ keys/docs/KeysUpdateKerberosKeyResponse.md | 56 ++ keys/docs/KeysUpdateTSIGKeyResponse.md | 56 ++ keys/docs/ProtobufFieldMask.md | 56 ++ keys/docs/TsigAPI.md | 371 +++++++++ keys/docs/UploadAPI.md | 75 ++ keys/docs/UploadContentType.md | 13 + keys/docs/UploadRequest.md | 150 ++++ keys/model_ddiupload_response.go | 161 ++++ keys/model_kerberos_key.go | 384 +++++++++ keys/model_kerberos_keys.go | 124 +++ keys/model_keys_create_tsig_key_response.go | 124 +++ keys/model_keys_generate_tsig_response.go | 124 +++ keys/model_keys_generate_tsig_result.go | 125 +++ keys/model_keys_list_kerberos_key_response.go | 125 +++ keys/model_keys_list_tsig_key_response.go | 125 +++ keys/model_keys_read_kerberos_key_response.go | 124 +++ keys/model_keys_read_tsig_key_response.go | 124 +++ keys/model_keys_tsig_key.go | 404 +++++++++ ...model_keys_update_kerberos_key_response.go | 124 +++ keys/model_keys_update_tsig_key_response.go | 124 +++ keys/model_protobuf_field_mask.go | 125 +++ keys/model_upload_content_type.go | 110 +++ keys/model_upload_request.go | 255 ++++++ keys/test/api_generate_tsig_test.go | 40 + keys/test/api_kerberos_test.go | 81 ++ keys/test/api_tsig_test.go | 93 +++ keys/test/api_upload_test.go | 40 + keys/utils.go | 347 ++++++++ 52 files changed, 7460 insertions(+), 5 deletions(-) create mode 100644 keys/.openapi-generator-ignore create mode 100644 keys/.openapi-generator/FILES create mode 100644 keys/.openapi-generator/VERSION create mode 100644 keys/README.md create mode 100644 keys/api_generate_tsig.go create mode 100644 keys/api_kerberos.go create mode 100644 keys/api_tsig.go create mode 100644 keys/api_upload.go create mode 100644 keys/client.go create mode 100644 keys/docs/DdiuploadResponse.md create mode 100644 keys/docs/GenerateTsigAPI.md create mode 100644 keys/docs/KerberosAPI.md create mode 100644 keys/docs/KerberosKey.md create mode 100644 keys/docs/KerberosKeys.md create mode 100644 keys/docs/KeysCreateTSIGKeyResponse.md create mode 100644 keys/docs/KeysGenerateTSIGResponse.md create mode 100644 keys/docs/KeysGenerateTSIGResult.md create mode 100644 keys/docs/KeysListKerberosKeyResponse.md create mode 100644 keys/docs/KeysListTSIGKeyResponse.md create mode 100644 keys/docs/KeysReadKerberosKeyResponse.md create mode 100644 keys/docs/KeysReadTSIGKeyResponse.md create mode 100644 keys/docs/KeysTSIGKey.md create mode 100644 keys/docs/KeysUpdateKerberosKeyResponse.md create mode 100644 keys/docs/KeysUpdateTSIGKeyResponse.md create mode 100644 keys/docs/ProtobufFieldMask.md create mode 100644 keys/docs/TsigAPI.md create mode 100644 keys/docs/UploadAPI.md create mode 100644 keys/docs/UploadContentType.md create mode 100644 keys/docs/UploadRequest.md create mode 100644 keys/model_ddiupload_response.go create mode 100644 keys/model_kerberos_key.go create mode 100644 keys/model_kerberos_keys.go create mode 100644 keys/model_keys_create_tsig_key_response.go create mode 100644 keys/model_keys_generate_tsig_response.go create mode 100644 keys/model_keys_generate_tsig_result.go create mode 100644 keys/model_keys_list_kerberos_key_response.go create mode 100644 keys/model_keys_list_tsig_key_response.go create mode 100644 keys/model_keys_read_kerberos_key_response.go create mode 100644 keys/model_keys_read_tsig_key_response.go create mode 100644 keys/model_keys_tsig_key.go create mode 100644 keys/model_keys_update_kerberos_key_response.go create mode 100644 keys/model_keys_update_tsig_key_response.go create mode 100644 keys/model_protobuf_field_mask.go create mode 100644 keys/model_upload_content_type.go create mode 100644 keys/model_upload_request.go create mode 100644 keys/test/api_generate_tsig_test.go create mode 100644 keys/test/api_kerberos_test.go create mode 100644 keys/test/api_tsig_test.go create mode 100644 keys/test/api_upload_test.go create mode 100644 keys/utils.go diff --git a/README.md b/README.md index e9c99f5..2bdc472 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,15 @@ This library enables the management of BloxOne DDI and BloxOne Cloud resources. The following BloxOne DDI APIs are supported: -- [IP Address Management (Ipamsvc API)](https://github.com/infobloxopen/bloxone-go-client/tree/master/ipam#readme) -- [DNS Configuration (DNSConfig API)](https://github.com/infobloxopen/bloxone-go-client/tree/master/dns_config#readme) -- [DNS Data (DnsData API)](https://github.com/infobloxopen/bloxone-go-client/tree/master/dns_data#readme) +- [IP Address Management (Ipamsvc API)](ipam#readme) +- [DNS Configuration (DNSConfig API)](dns_config#readme) +- [DNS Data (DnsData API)](dns_data#readme) +- [Keys (Keys API)](keys#readme) The following BloxOne Cloud APIs are supported: -- [Infrastructure Management](https://github.com/infobloxopen/bloxone-go-client/tree/master/infra_mgmt#readme) -- [Infrastructure Provision (HOSTActivation API)](https://github.com/infobloxopen/bloxone-go-client/tree/master/infra_provision#readme) +- [Infrastructure Management](infra_mgmt#readme) +- [Infrastructure Provision (HOSTActivation API)](infra_provision#readme) # Installation diff --git a/client/client.go b/client/client.go index 092d555..a452863 100644 --- a/client/client.go +++ b/client/client.go @@ -7,6 +7,7 @@ import ( "github.com/infobloxopen/bloxone-go-client/infra_mgmt" "github.com/infobloxopen/bloxone-go-client/infra_provision" "github.com/infobloxopen/bloxone-go-client/ipam" + "github.com/infobloxopen/bloxone-go-client/keys" ) // APIClient is an aggregation of different BloxOne API clients. @@ -16,6 +17,7 @@ type APIClient struct { DNSDataAPI *dns_data.APIClient HostActivationAPI *infra_provision.APIClient InfraManagementAPI *infra_mgmt.APIClient + KeysAPI *keys.APIClient } // NewAPIClient creates a new BloxOne API Client. @@ -40,11 +42,17 @@ func NewAPIClient(conf Configuration) (*APIClient, error) { if err != nil { return nil, err } + keysConf, err := conf.internal(keys.ServiceBasePath) + if err != nil { + return nil, err + } + return &APIClient{ IPAddressManagementAPI: ipam.NewAPIClient(ipamConf), DNSConfigurationAPI: dns_config.NewAPIClient(dnsConfigConf), DNSDataAPI: dns_data.NewAPIClient(dnsDataConf), HostActivationAPI: infra_provision.NewAPIClient(infraProvisionConf), InfraManagementAPI: infra_mgmt.NewAPIClient(infraMgmtConf), + KeysAPI: keys.NewAPIClient(keysConf), }, nil } diff --git a/keys/.openapi-generator-ignore b/keys/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/keys/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/keys/.openapi-generator/FILES b/keys/.openapi-generator/FILES new file mode 100644 index 0000000..619bfc0 --- /dev/null +++ b/keys/.openapi-generator/FILES @@ -0,0 +1,43 @@ +README.md +api_generate_tsig.go +api_kerberos.go +api_tsig.go +api_upload.go +client.go +docs/DdiuploadResponse.md +docs/GenerateTsigAPI.md +docs/KerberosAPI.md +docs/KerberosKey.md +docs/KerberosKeys.md +docs/KeysCreateTSIGKeyResponse.md +docs/KeysGenerateTSIGResponse.md +docs/KeysGenerateTSIGResult.md +docs/KeysListKerberosKeyResponse.md +docs/KeysListTSIGKeyResponse.md +docs/KeysReadKerberosKeyResponse.md +docs/KeysReadTSIGKeyResponse.md +docs/KeysTSIGKey.md +docs/KeysUpdateKerberosKeyResponse.md +docs/KeysUpdateTSIGKeyResponse.md +docs/ProtobufFieldMask.md +docs/TsigAPI.md +docs/UploadAPI.md +docs/UploadContentType.md +docs/UploadRequest.md +model_ddiupload_response.go +model_kerberos_key.go +model_kerberos_keys.go +model_keys_create_tsig_key_response.go +model_keys_generate_tsig_response.go +model_keys_generate_tsig_result.go +model_keys_list_kerberos_key_response.go +model_keys_list_tsig_key_response.go +model_keys_read_kerberos_key_response.go +model_keys_read_tsig_key_response.go +model_keys_tsig_key.go +model_keys_update_kerberos_key_response.go +model_keys_update_tsig_key_response.go +model_protobuf_field_mask.go +model_upload_content_type.go +model_upload_request.go +utils.go diff --git a/keys/.openapi-generator/VERSION b/keys/.openapi-generator/VERSION new file mode 100644 index 0000000..9fe9ff9 --- /dev/null +++ b/keys/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.1 diff --git a/keys/README.md b/keys/README.md new file mode 100644 index 0000000..20dc152 --- /dev/null +++ b/keys/README.md @@ -0,0 +1,160 @@ +# Go API client for keys + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + + + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v1 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import keys "github.com/infobloxopen/bloxone-go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), keys.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), keys.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), keys.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), keys.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost/api/ddi/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*GenerateTsigAPI* | [**GenerateTsigGenerateTSIG**](docs/GenerateTsigAPI.md#generatetsiggeneratetsig) | **Get** /keys/generate_tsig | Generate TSIG key with a random secret. +*KerberosAPI* | [**KerberosDelete**](docs/KerberosAPI.md#kerberosdelete) | **Delete** /keys/kerberos/{id} | Delete the Kerberos key. +*KerberosAPI* | [**KerberosList**](docs/KerberosAPI.md#kerberoslist) | **Get** /keys/kerberos | Retrieve Kerberos keys. +*KerberosAPI* | [**KerberosRead**](docs/KerberosAPI.md#kerberosread) | **Get** /keys/kerberos/{id} | Retrieve the Kerberos key. +*KerberosAPI* | [**KerberosUpdate**](docs/KerberosAPI.md#kerberosupdate) | **Patch** /keys/kerberos/{id} | Update the Kerberos key. +*TsigAPI* | [**TsigCreate**](docs/TsigAPI.md#tsigcreate) | **Post** /keys/tsig | Create the TSIG key. +*TsigAPI* | [**TsigDelete**](docs/TsigAPI.md#tsigdelete) | **Delete** /keys/tsig/{id} | Delete the TSIG key. +*TsigAPI* | [**TsigList**](docs/TsigAPI.md#tsiglist) | **Get** /keys/tsig | Retrieve TSIG keys. +*TsigAPI* | [**TsigRead**](docs/TsigAPI.md#tsigread) | **Get** /keys/tsig/{id} | Retrieve the TSIG key. +*TsigAPI* | [**TsigUpdate**](docs/TsigAPI.md#tsigupdate) | **Patch** /keys/tsig/{id} | Update the TSIG key. +*UploadAPI* | [**UploadUpload**](docs/UploadAPI.md#uploadupload) | **Post** /keys/upload | Upload content to the keys service. + + +## Documentation For Models + + - [DdiuploadResponse](docs/DdiuploadResponse.md) + - [KerberosKey](docs/KerberosKey.md) + - [KerberosKeys](docs/KerberosKeys.md) + - [KeysCreateTSIGKeyResponse](docs/KeysCreateTSIGKeyResponse.md) + - [KeysGenerateTSIGResponse](docs/KeysGenerateTSIGResponse.md) + - [KeysGenerateTSIGResult](docs/KeysGenerateTSIGResult.md) + - [KeysListKerberosKeyResponse](docs/KeysListKerberosKeyResponse.md) + - [KeysListTSIGKeyResponse](docs/KeysListTSIGKeyResponse.md) + - [KeysReadKerberosKeyResponse](docs/KeysReadKerberosKeyResponse.md) + - [KeysReadTSIGKeyResponse](docs/KeysReadTSIGKeyResponse.md) + - [KeysTSIGKey](docs/KeysTSIGKey.md) + - [KeysUpdateKerberosKeyResponse](docs/KeysUpdateKerberosKeyResponse.md) + - [KeysUpdateTSIGKeyResponse](docs/KeysUpdateTSIGKeyResponse.md) + - [ProtobufFieldMask](docs/ProtobufFieldMask.md) + - [UploadContentType](docs/UploadContentType.md) + - [UploadRequest](docs/UploadRequest.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### ApiKeyAuth + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. + +Example + +```golang +auth := context.WithValue( + context.Background(), + sw.ContextAPIKeys, + map[string]sw.APIKey{ + "Authorization": {Key: "API_KEY_STRING"}, + }, + ) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/keys/api_generate_tsig.go b/keys/api_generate_tsig.go new file mode 100644 index 0000000..d4e3ab8 --- /dev/null +++ b/keys/api_generate_tsig.go @@ -0,0 +1,159 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + + "github.com/infobloxopen/bloxone-go-client/internal" +) + +type GenerateTsigAPI interface { + + /* + GenerateTsigGenerateTSIG Generate TSIG key with a random secret. + + Use this method to generate a TSIG key with a random secret using the specified algorithm. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateTsigGenerateTSIGRequest + */ + GenerateTsigGenerateTSIG(ctx context.Context) ApiGenerateTsigGenerateTSIGRequest + + // GenerateTsigGenerateTSIGExecute executes the request + // @return KeysGenerateTSIGResponse + GenerateTsigGenerateTSIGExecute(r ApiGenerateTsigGenerateTSIGRequest) (*KeysGenerateTSIGResponse, *http.Response, error) +} + +// GenerateTsigAPIService GenerateTsigAPI service +type GenerateTsigAPIService internal.Service + +type ApiGenerateTsigGenerateTSIGRequest struct { + ctx context.Context + ApiService GenerateTsigAPI + algorithm *string +} + +// The TSIG key algorithm. Valid values are: * _hmac_sha256_ * _hmac_sha1_ * _hmac_sha224_ * _hmac_sha384_ * _hmac_sha512_ Defaults to _hmac_sha256_. +func (r ApiGenerateTsigGenerateTSIGRequest) Algorithm(algorithm string) ApiGenerateTsigGenerateTSIGRequest { + r.algorithm = &algorithm + return r +} + +func (r ApiGenerateTsigGenerateTSIGRequest) Execute() (*KeysGenerateTSIGResponse, *http.Response, error) { + return r.ApiService.GenerateTsigGenerateTSIGExecute(r) +} + +/* +GenerateTsigGenerateTSIG Generate TSIG key with a random secret. + +Use this method to generate a TSIG key with a random secret using the specified algorithm. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateTsigGenerateTSIGRequest +*/ +func (a *GenerateTsigAPIService) GenerateTsigGenerateTSIG(ctx context.Context) ApiGenerateTsigGenerateTSIGRequest { + return ApiGenerateTsigGenerateTSIGRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeysGenerateTSIGResponse +func (a *GenerateTsigAPIService) GenerateTsigGenerateTSIGExecute(r ApiGenerateTsigGenerateTSIGRequest) (*KeysGenerateTSIGResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysGenerateTSIGResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "GenerateTsigAPIService.GenerateTsigGenerateTSIG") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/generate_tsig" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.algorithm != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "algorithm", r.algorithm, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/keys/api_kerberos.go b/keys/api_kerberos.go new file mode 100644 index 0000000..df70288 --- /dev/null +++ b/keys/api_kerberos.go @@ -0,0 +1,630 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/infobloxopen/bloxone-go-client/internal" +) + +type KerberosAPI interface { + + /* + KerberosDelete Delete the Kerberos key. + + Use this method to delete a __KerberosKey__ object. + A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiKerberosDeleteRequest + */ + KerberosDelete(ctx context.Context, id string) ApiKerberosDeleteRequest + + // KerberosDeleteExecute executes the request + KerberosDeleteExecute(r ApiKerberosDeleteRequest) (*http.Response, error) + + /* + KerberosList Retrieve Kerberos keys. + + Use this method to retrieve __KerberosKey__ objects. + A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiKerberosListRequest + */ + KerberosList(ctx context.Context) ApiKerberosListRequest + + // KerberosListExecute executes the request + // @return KeysListKerberosKeyResponse + KerberosListExecute(r ApiKerberosListRequest) (*KeysListKerberosKeyResponse, *http.Response, error) + + /* + KerberosRead Retrieve the Kerberos key. + + Use this method to retrieve a __KerberosKey__ object. + A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiKerberosReadRequest + */ + KerberosRead(ctx context.Context, id string) ApiKerberosReadRequest + + // KerberosReadExecute executes the request + // @return KeysReadKerberosKeyResponse + KerberosReadExecute(r ApiKerberosReadRequest) (*KeysReadKerberosKeyResponse, *http.Response, error) + + /* + KerberosUpdate Update the Kerberos key. + + Use this method to update a __KerberosKey__ object. + A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiKerberosUpdateRequest + */ + KerberosUpdate(ctx context.Context, id string) ApiKerberosUpdateRequest + + // KerberosUpdateExecute executes the request + // @return KeysUpdateKerberosKeyResponse + KerberosUpdateExecute(r ApiKerberosUpdateRequest) (*KeysUpdateKerberosKeyResponse, *http.Response, error) +} + +// KerberosAPIService KerberosAPI service +type KerberosAPIService internal.Service + +type ApiKerberosDeleteRequest struct { + ctx context.Context + ApiService KerberosAPI + id string +} + +func (r ApiKerberosDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.KerberosDeleteExecute(r) +} + +/* +KerberosDelete Delete the Kerberos key. + +Use this method to delete a __KerberosKey__ object. +A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiKerberosDeleteRequest +*/ +func (a *KerberosAPIService) KerberosDelete(ctx context.Context, id string) ApiKerberosDeleteRequest { + return ApiKerberosDeleteRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *KerberosAPIService) KerberosDeleteExecute(r ApiKerberosDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []internal.FormFile + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "KerberosAPIService.KerberosDelete") + if err != nil { + return nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/kerberos/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(internal.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiKerberosListRequest struct { + ctx context.Context + ApiService KerberosAPI + fields *string + filter *string + offset *int32 + limit *int32 + pageToken *string + orderBy *string + tfilter *string + torderBy *string +} + +// A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. +func (r ApiKerberosListRequest) Fields(fields string) ApiKerberosListRequest { + r.fields = &fields + return r +} + +// A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | +func (r ApiKerberosListRequest) Filter(filter string) ApiKerberosListRequest { + r.filter = &filter + return r +} + +// The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. +func (r ApiKerberosListRequest) Offset(offset int32) ApiKerberosListRequest { + r.offset = &offset + return r +} + +// The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. +func (r ApiKerberosListRequest) Limit(limit int32) ApiKerberosListRequest { + r.limit = &limit + return r +} + +// The service-defined string used to identify a page of resources. A null value indicates the first page. +func (r ApiKerberosListRequest) PageToken(pageToken string) ApiKerberosListRequest { + r.pageToken = &pageToken + return r +} + +// A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. +func (r ApiKerberosListRequest) OrderBy(orderBy string) ApiKerberosListRequest { + r.orderBy = &orderBy + return r +} + +// This parameter is used for filtering by tags. +func (r ApiKerberosListRequest) Tfilter(tfilter string) ApiKerberosListRequest { + r.tfilter = &tfilter + return r +} + +// This parameter is used for sorting by tags. +func (r ApiKerberosListRequest) TorderBy(torderBy string) ApiKerberosListRequest { + r.torderBy = &torderBy + return r +} + +func (r ApiKerberosListRequest) Execute() (*KeysListKerberosKeyResponse, *http.Response, error) { + return r.ApiService.KerberosListExecute(r) +} + +/* +KerberosList Retrieve Kerberos keys. + +Use this method to retrieve __KerberosKey__ objects. +A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiKerberosListRequest +*/ +func (a *KerberosAPIService) KerberosList(ctx context.Context) ApiKerberosListRequest { + return ApiKerberosListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeysListKerberosKeyResponse +func (a *KerberosAPIService) KerberosListExecute(r ApiKerberosListRequest) (*KeysListKerberosKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysListKerberosKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "KerberosAPIService.KerberosList") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/kerberos" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.fields != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_fields", r.fields, "") + } + if r.filter != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_filter", r.filter, "") + } + if r.offset != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_offset", r.offset, "") + } + if r.limit != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_limit", r.limit, "") + } + if r.pageToken != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_page_token", r.pageToken, "") + } + if r.orderBy != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_order_by", r.orderBy, "") + } + if r.tfilter != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_tfilter", r.tfilter, "") + } + if r.torderBy != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_torder_by", r.torderBy, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKerberosReadRequest struct { + ctx context.Context + ApiService KerberosAPI + id string + fields *string +} + +// A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. +func (r ApiKerberosReadRequest) Fields(fields string) ApiKerberosReadRequest { + r.fields = &fields + return r +} + +func (r ApiKerberosReadRequest) Execute() (*KeysReadKerberosKeyResponse, *http.Response, error) { + return r.ApiService.KerberosReadExecute(r) +} + +/* +KerberosRead Retrieve the Kerberos key. + +Use this method to retrieve a __KerberosKey__ object. +A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiKerberosReadRequest +*/ +func (a *KerberosAPIService) KerberosRead(ctx context.Context, id string) ApiKerberosReadRequest { + return ApiKerberosReadRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return KeysReadKerberosKeyResponse +func (a *KerberosAPIService) KerberosReadExecute(r ApiKerberosReadRequest) (*KeysReadKerberosKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysReadKerberosKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "KerberosAPIService.KerberosRead") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/kerberos/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(internal.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.fields != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_fields", r.fields, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiKerberosUpdateRequest struct { + ctx context.Context + ApiService KerberosAPI + id string + body *KerberosKey +} + +func (r ApiKerberosUpdateRequest) Body(body KerberosKey) ApiKerberosUpdateRequest { + r.body = &body + return r +} + +func (r ApiKerberosUpdateRequest) Execute() (*KeysUpdateKerberosKeyResponse, *http.Response, error) { + return r.ApiService.KerberosUpdateExecute(r) +} + +/* +KerberosUpdate Update the Kerberos key. + +Use this method to update a __KerberosKey__ object. +A __KerberosKey__ object represents a Kerberos key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiKerberosUpdateRequest +*/ +func (a *KerberosAPIService) KerberosUpdate(ctx context.Context, id string) ApiKerberosUpdateRequest { + return ApiKerberosUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return KeysUpdateKerberosKeyResponse +func (a *KerberosAPIService) KerberosUpdateExecute(r ApiKerberosUpdateRequest) (*KeysUpdateKerberosKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysUpdateKerberosKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "KerberosAPIService.KerberosUpdate") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/kerberos/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(internal.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, internal.ReportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/keys/api_tsig.go b/keys/api_tsig.go new file mode 100644 index 0000000..4386f89 --- /dev/null +++ b/keys/api_tsig.go @@ -0,0 +1,765 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/infobloxopen/bloxone-go-client/internal" +) + +type TsigAPI interface { + + /* + TsigCreate Create the TSIG key. + + Use this method to create a __TSIGKey__ object. + A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTsigCreateRequest + */ + TsigCreate(ctx context.Context) ApiTsigCreateRequest + + // TsigCreateExecute executes the request + // @return KeysCreateTSIGKeyResponse + TsigCreateExecute(r ApiTsigCreateRequest) (*KeysCreateTSIGKeyResponse, *http.Response, error) + + /* + TsigDelete Delete the TSIG key. + + Use this method to delete a __TSIGKey__ object. + A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiTsigDeleteRequest + */ + TsigDelete(ctx context.Context, id string) ApiTsigDeleteRequest + + // TsigDeleteExecute executes the request + TsigDeleteExecute(r ApiTsigDeleteRequest) (*http.Response, error) + + /* + TsigList Retrieve TSIG keys. + + Use this method to retrieve __TSIGKey__ objects. + A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTsigListRequest + */ + TsigList(ctx context.Context) ApiTsigListRequest + + // TsigListExecute executes the request + // @return KeysListTSIGKeyResponse + TsigListExecute(r ApiTsigListRequest) (*KeysListTSIGKeyResponse, *http.Response, error) + + /* + TsigRead Retrieve the TSIG key. + + Use this method to retrieve a __TSIGKey__ object. + A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiTsigReadRequest + */ + TsigRead(ctx context.Context, id string) ApiTsigReadRequest + + // TsigReadExecute executes the request + // @return KeysReadTSIGKeyResponse + TsigReadExecute(r ApiTsigReadRequest) (*KeysReadTSIGKeyResponse, *http.Response, error) + + /* + TsigUpdate Update the TSIG key. + + Use this method to update a __TSIGKey__ object. + A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiTsigUpdateRequest + */ + TsigUpdate(ctx context.Context, id string) ApiTsigUpdateRequest + + // TsigUpdateExecute executes the request + // @return KeysUpdateTSIGKeyResponse + TsigUpdateExecute(r ApiTsigUpdateRequest) (*KeysUpdateTSIGKeyResponse, *http.Response, error) +} + +// TsigAPIService TsigAPI service +type TsigAPIService internal.Service + +type ApiTsigCreateRequest struct { + ctx context.Context + ApiService TsigAPI + body *KeysTSIGKey +} + +func (r ApiTsigCreateRequest) Body(body KeysTSIGKey) ApiTsigCreateRequest { + r.body = &body + return r +} + +func (r ApiTsigCreateRequest) Execute() (*KeysCreateTSIGKeyResponse, *http.Response, error) { + return r.ApiService.TsigCreateExecute(r) +} + +/* +TsigCreate Create the TSIG key. + +Use this method to create a __TSIGKey__ object. +A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTsigCreateRequest +*/ +func (a *TsigAPIService) TsigCreate(ctx context.Context) ApiTsigCreateRequest { + return ApiTsigCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeysCreateTSIGKeyResponse +func (a *TsigAPIService) TsigCreateExecute(r ApiTsigCreateRequest) (*KeysCreateTSIGKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysCreateTSIGKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "TsigAPIService.TsigCreate") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/tsig" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, internal.ReportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTsigDeleteRequest struct { + ctx context.Context + ApiService TsigAPI + id string +} + +func (r ApiTsigDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.TsigDeleteExecute(r) +} + +/* +TsigDelete Delete the TSIG key. + +Use this method to delete a __TSIGKey__ object. +A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiTsigDeleteRequest +*/ +func (a *TsigAPIService) TsigDelete(ctx context.Context, id string) ApiTsigDeleteRequest { + return ApiTsigDeleteRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TsigAPIService) TsigDeleteExecute(r ApiTsigDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []internal.FormFile + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "TsigAPIService.TsigDelete") + if err != nil { + return nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/tsig/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(internal.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTsigListRequest struct { + ctx context.Context + ApiService TsigAPI + fields *string + filter *string + offset *int32 + limit *int32 + pageToken *string + orderBy *string + tfilter *string + torderBy *string +} + +// A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. +func (r ApiTsigListRequest) Fields(fields string) ApiTsigListRequest { + r.fields = &fields + return r +} + +// A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | +func (r ApiTsigListRequest) Filter(filter string) ApiTsigListRequest { + r.filter = &filter + return r +} + +// The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. +func (r ApiTsigListRequest) Offset(offset int32) ApiTsigListRequest { + r.offset = &offset + return r +} + +// The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. +func (r ApiTsigListRequest) Limit(limit int32) ApiTsigListRequest { + r.limit = &limit + return r +} + +// The service-defined string used to identify a page of resources. A null value indicates the first page. +func (r ApiTsigListRequest) PageToken(pageToken string) ApiTsigListRequest { + r.pageToken = &pageToken + return r +} + +// A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. +func (r ApiTsigListRequest) OrderBy(orderBy string) ApiTsigListRequest { + r.orderBy = &orderBy + return r +} + +// This parameter is used for filtering by tags. +func (r ApiTsigListRequest) Tfilter(tfilter string) ApiTsigListRequest { + r.tfilter = &tfilter + return r +} + +// This parameter is used for sorting by tags. +func (r ApiTsigListRequest) TorderBy(torderBy string) ApiTsigListRequest { + r.torderBy = &torderBy + return r +} + +func (r ApiTsigListRequest) Execute() (*KeysListTSIGKeyResponse, *http.Response, error) { + return r.ApiService.TsigListExecute(r) +} + +/* +TsigList Retrieve TSIG keys. + +Use this method to retrieve __TSIGKey__ objects. +A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTsigListRequest +*/ +func (a *TsigAPIService) TsigList(ctx context.Context) ApiTsigListRequest { + return ApiTsigListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeysListTSIGKeyResponse +func (a *TsigAPIService) TsigListExecute(r ApiTsigListRequest) (*KeysListTSIGKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysListTSIGKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "TsigAPIService.TsigList") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/tsig" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.fields != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_fields", r.fields, "") + } + if r.filter != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_filter", r.filter, "") + } + if r.offset != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_offset", r.offset, "") + } + if r.limit != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_limit", r.limit, "") + } + if r.pageToken != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_page_token", r.pageToken, "") + } + if r.orderBy != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_order_by", r.orderBy, "") + } + if r.tfilter != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_tfilter", r.tfilter, "") + } + if r.torderBy != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_torder_by", r.torderBy, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTsigReadRequest struct { + ctx context.Context + ApiService TsigAPI + id string + fields *string +} + +// A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. +func (r ApiTsigReadRequest) Fields(fields string) ApiTsigReadRequest { + r.fields = &fields + return r +} + +func (r ApiTsigReadRequest) Execute() (*KeysReadTSIGKeyResponse, *http.Response, error) { + return r.ApiService.TsigReadExecute(r) +} + +/* +TsigRead Retrieve the TSIG key. + +Use this method to retrieve a __TSIGKey__ object. +A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiTsigReadRequest +*/ +func (a *TsigAPIService) TsigRead(ctx context.Context, id string) ApiTsigReadRequest { + return ApiTsigReadRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return KeysReadTSIGKeyResponse +func (a *TsigAPIService) TsigReadExecute(r ApiTsigReadRequest) (*KeysReadTSIGKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysReadTSIGKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "TsigAPIService.TsigRead") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/tsig/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(internal.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.fields != nil { + internal.ParameterAddToHeaderOrQuery(localVarQueryParams, "_fields", r.fields, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTsigUpdateRequest struct { + ctx context.Context + ApiService TsigAPI + id string + body *KeysTSIGKey +} + +func (r ApiTsigUpdateRequest) Body(body KeysTSIGKey) ApiTsigUpdateRequest { + r.body = &body + return r +} + +func (r ApiTsigUpdateRequest) Execute() (*KeysUpdateTSIGKeyResponse, *http.Response, error) { + return r.ApiService.TsigUpdateExecute(r) +} + +/* +TsigUpdate Update the TSIG key. + +Use this method to update a __TSIGKey__ object. +A __TSIGKey__ object represents a TSIG key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id An application specific resource identity of a resource + @return ApiTsigUpdateRequest +*/ +func (a *TsigAPIService) TsigUpdate(ctx context.Context, id string) ApiTsigUpdateRequest { + return ApiTsigUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return KeysUpdateTSIGKeyResponse +func (a *TsigAPIService) TsigUpdateExecute(r ApiTsigUpdateRequest) (*KeysUpdateTSIGKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *KeysUpdateTSIGKeyResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "TsigAPIService.TsigUpdate") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/tsig/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(internal.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, internal.ReportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/keys/api_upload.go b/keys/api_upload.go new file mode 100644 index 0000000..3d68206 --- /dev/null +++ b/keys/api_upload.go @@ -0,0 +1,160 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + + "github.com/infobloxopen/bloxone-go-client/internal" +) + +type UploadAPI interface { + + /* + UploadUpload Upload content to the keys service. + + Use this method to upload specified content type to the keys service. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUploadUploadRequest + */ + UploadUpload(ctx context.Context) ApiUploadUploadRequest + + // UploadUploadExecute executes the request + // @return DdiuploadResponse + UploadUploadExecute(r ApiUploadUploadRequest) (*DdiuploadResponse, *http.Response, error) +} + +// UploadAPIService UploadAPI service +type UploadAPIService internal.Service + +type ApiUploadUploadRequest struct { + ctx context.Context + ApiService UploadAPI + body *UploadRequest +} + +func (r ApiUploadUploadRequest) Body(body UploadRequest) ApiUploadUploadRequest { + r.body = &body + return r +} + +func (r ApiUploadUploadRequest) Execute() (*DdiuploadResponse, *http.Response, error) { + return r.ApiService.UploadUploadExecute(r) +} + +/* +UploadUpload Upload content to the keys service. + +Use this method to upload specified content type to the keys service. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUploadUploadRequest +*/ +func (a *UploadAPIService) UploadUpload(ctx context.Context) ApiUploadUploadRequest { + return ApiUploadUploadRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DdiuploadResponse +func (a *UploadAPIService) UploadUploadExecute(r ApiUploadUploadRequest) (*DdiuploadResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []internal.FormFile + localVarReturnValue *DdiuploadResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "UploadAPIService.UploadUpload") + if err != nil { + return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) + } + + localVarPath := localBasePath + "/keys/upload" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, internal.ReportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := internal.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := internal.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(internal.ContextAPIKeys).(map[string]internal.APIKey); ok { + if apiKey, ok := auth["ApiKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.Client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := internal.NewGenericOpenAPIErrorWithBody(localVarHTTPResponse.Status, localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := internal.NewGenericOpenAPIErrorWithBody(err.Error(), localVarBody) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/keys/client.go b/keys/client.go new file mode 100644 index 0000000..b3649a4 --- /dev/null +++ b/keys/client.go @@ -0,0 +1,44 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "github.com/infobloxopen/bloxone-go-client/internal" +) + +var ServiceBasePath = "/api/ddi/v1" + +// APIClient manages communication with the DDI Keys API API vv1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + *internal.APIClient + + // API Services + GenerateTsigAPI GenerateTsigAPI + KerberosAPI KerberosAPI + TsigAPI TsigAPI + UploadAPI UploadAPI +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *internal.Configuration) *APIClient { + c := &APIClient{} + c.APIClient = internal.NewAPIClient(cfg) + + // API Services + c.GenerateTsigAPI = (*GenerateTsigAPIService)(&c.Common) + c.KerberosAPI = (*KerberosAPIService)(&c.Common) + c.TsigAPI = (*TsigAPIService)(&c.Common) + c.UploadAPI = (*UploadAPIService)(&c.Common) + + return c +} diff --git a/keys/docs/DdiuploadResponse.md b/keys/docs/DdiuploadResponse.md new file mode 100644 index 0000000..22a3625 --- /dev/null +++ b/keys/docs/DdiuploadResponse.md @@ -0,0 +1,82 @@ +# DdiuploadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KerberosKeys** | Pointer to [**KerberosKeys**](KerberosKeys.md) | | [optional] +**Warning** | Pointer to **string** | May contain any non-critical warning messages after processing the content. | [optional] + +## Methods + +### NewDdiuploadResponse + +`func NewDdiuploadResponse() *DdiuploadResponse` + +NewDdiuploadResponse instantiates a new DdiuploadResponse 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 + +### NewDdiuploadResponseWithDefaults + +`func NewDdiuploadResponseWithDefaults() *DdiuploadResponse` + +NewDdiuploadResponseWithDefaults instantiates a new DdiuploadResponse 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 + +### GetKerberosKeys + +`func (o *DdiuploadResponse) GetKerberosKeys() KerberosKeys` + +GetKerberosKeys returns the KerberosKeys field if non-nil, zero value otherwise. + +### GetKerberosKeysOk + +`func (o *DdiuploadResponse) GetKerberosKeysOk() (*KerberosKeys, bool)` + +GetKerberosKeysOk returns a tuple with the KerberosKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKerberosKeys + +`func (o *DdiuploadResponse) SetKerberosKeys(v KerberosKeys)` + +SetKerberosKeys sets KerberosKeys field to given value. + +### HasKerberosKeys + +`func (o *DdiuploadResponse) HasKerberosKeys() bool` + +HasKerberosKeys returns a boolean if a field has been set. + +### GetWarning + +`func (o *DdiuploadResponse) GetWarning() string` + +GetWarning returns the Warning field if non-nil, zero value otherwise. + +### GetWarningOk + +`func (o *DdiuploadResponse) GetWarningOk() (*string, bool)` + +GetWarningOk returns a tuple with the Warning field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWarning + +`func (o *DdiuploadResponse) SetWarning(v string)` + +SetWarning sets Warning field to given value. + +### HasWarning + +`func (o *DdiuploadResponse) HasWarning() bool` + +HasWarning returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/GenerateTsigAPI.md b/keys/docs/GenerateTsigAPI.md new file mode 100644 index 0000000..6f5663a --- /dev/null +++ b/keys/docs/GenerateTsigAPI.md @@ -0,0 +1,75 @@ +# \GenerateTsigAPI + +All URIs are relative to *http://localhost/api/ddi/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GenerateTsigGenerateTSIG**](GenerateTsigAPI.md#GenerateTsigGenerateTSIG) | **Get** /keys/generate_tsig | Generate TSIG key with a random secret. + + + +## GenerateTsigGenerateTSIG + +> KeysGenerateTSIGResponse GenerateTsigGenerateTSIG(ctx).Algorithm(algorithm).Execute() + +Generate TSIG key with a random secret. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + algorithm := "algorithm_example" // string | The TSIG key algorithm. Valid values are: * _hmac_sha256_ * _hmac_sha1_ * _hmac_sha224_ * _hmac_sha384_ * _hmac_sha512_ Defaults to _hmac_sha256_. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.GenerateTsigAPI.GenerateTsigGenerateTSIG(context.Background()).Algorithm(algorithm).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GenerateTsigAPI.GenerateTsigGenerateTSIG``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GenerateTsigGenerateTSIG`: KeysGenerateTSIGResponse + fmt.Fprintf(os.Stdout, "Response from `GenerateTsigAPI.GenerateTsigGenerateTSIG`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGenerateTsigGenerateTSIGRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **algorithm** | **string** | The TSIG key algorithm. Valid values are: * _hmac_sha256_ * _hmac_sha1_ * _hmac_sha224_ * _hmac_sha384_ * _hmac_sha512_ Defaults to _hmac_sha256_. | + +### Return type + +[**KeysGenerateTSIGResponse**](KeysGenerateTSIGResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/keys/docs/KerberosAPI.md b/keys/docs/KerberosAPI.md new file mode 100644 index 0000000..01fc80b --- /dev/null +++ b/keys/docs/KerberosAPI.md @@ -0,0 +1,304 @@ +# \KerberosAPI + +All URIs are relative to *http://localhost/api/ddi/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**KerberosDelete**](KerberosAPI.md#KerberosDelete) | **Delete** /keys/kerberos/{id} | Delete the Kerberos key. +[**KerberosList**](KerberosAPI.md#KerberosList) | **Get** /keys/kerberos | Retrieve Kerberos keys. +[**KerberosRead**](KerberosAPI.md#KerberosRead) | **Get** /keys/kerberos/{id} | Retrieve the Kerberos key. +[**KerberosUpdate**](KerberosAPI.md#KerberosUpdate) | **Patch** /keys/kerberos/{id} | Update the Kerberos key. + + + +## KerberosDelete + +> KerberosDelete(ctx, id).Execute() + +Delete the Kerberos key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + id := "id_example" // string | An application specific resource identity of a resource + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.KerberosAPI.KerberosDelete(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `KerberosAPI.KerberosDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | An application specific resource identity of a resource | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKerberosDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KerberosList + +> KeysListKerberosKeyResponse KerberosList(ctx).Fields(fields).Filter(filter).Offset(offset).Limit(limit).PageToken(pageToken).OrderBy(orderBy).Tfilter(tfilter).TorderBy(torderBy).Execute() + +Retrieve Kerberos keys. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + fields := "fields_example" // string | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. (optional) + filter := "filter_example" // string | A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | (optional) + offset := int32(56) // int32 | The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. (optional) + limit := int32(56) // int32 | The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. (optional) + pageToken := "pageToken_example" // string | The service-defined string used to identify a page of resources. A null value indicates the first page. (optional) + orderBy := "orderBy_example" // string | A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. (optional) + tfilter := "tfilter_example" // string | This parameter is used for filtering by tags. (optional) + torderBy := "torderBy_example" // string | This parameter is used for sorting by tags. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.KerberosAPI.KerberosList(context.Background()).Fields(fields).Filter(filter).Offset(offset).Limit(limit).PageToken(pageToken).OrderBy(orderBy).Tfilter(tfilter).TorderBy(torderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `KerberosAPI.KerberosList``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KerberosList`: KeysListKerberosKeyResponse + fmt.Fprintf(os.Stdout, "Response from `KerberosAPI.KerberosList`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiKerberosListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **string** | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. | + **filter** | **string** | A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | | + **offset** | **int32** | The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. | + **limit** | **int32** | The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. | + **pageToken** | **string** | The service-defined string used to identify a page of resources. A null value indicates the first page. | + **orderBy** | **string** | A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. | + **tfilter** | **string** | This parameter is used for filtering by tags. | + **torderBy** | **string** | This parameter is used for sorting by tags. | + +### Return type + +[**KeysListKerberosKeyResponse**](KeysListKerberosKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KerberosRead + +> KeysReadKerberosKeyResponse KerberosRead(ctx, id).Fields(fields).Execute() + +Retrieve the Kerberos key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + id := "id_example" // string | An application specific resource identity of a resource + fields := "fields_example" // string | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.KerberosAPI.KerberosRead(context.Background(), id).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `KerberosAPI.KerberosRead``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KerberosRead`: KeysReadKerberosKeyResponse + fmt.Fprintf(os.Stdout, "Response from `KerberosAPI.KerberosRead`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | An application specific resource identity of a resource | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKerberosReadRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **string** | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. | + +### Return type + +[**KeysReadKerberosKeyResponse**](KeysReadKerberosKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## KerberosUpdate + +> KeysUpdateKerberosKeyResponse KerberosUpdate(ctx, id).Body(body).Execute() + +Update the Kerberos key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + id := "id_example" // string | An application specific resource identity of a resource + body := *openapiclient.NewKerberosKey() // KerberosKey | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.KerberosAPI.KerberosUpdate(context.Background(), id).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `KerberosAPI.KerberosUpdate``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KerberosUpdate`: KeysUpdateKerberosKeyResponse + fmt.Fprintf(os.Stdout, "Response from `KerberosAPI.KerberosUpdate`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | An application specific resource identity of a resource | + +### Other Parameters + +Other parameters are passed through a pointer to a apiKerberosUpdateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**KerberosKey**](KerberosKey.md) | | + +### Return type + +[**KeysUpdateKerberosKeyResponse**](KeysUpdateKerberosKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/keys/docs/KerberosKey.md b/keys/docs/KerberosKey.md new file mode 100644 index 0000000..dd792a9 --- /dev/null +++ b/keys/docs/KerberosKey.md @@ -0,0 +1,238 @@ +# KerberosKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Algorithm** | Pointer to **string** | Encryption algorithm of the key in accordance with RFC 3961. | [optional] [readonly] +**Comment** | Pointer to **string** | The description for Kerberos key. May contain 0 to 1024 characters. Can include UTF-8. | [optional] +**Domain** | Pointer to **string** | Kerberos realm of the principal. | [optional] [readonly] +**Id** | Pointer to **string** | The resource identifier. | [optional] [readonly] +**Principal** | Pointer to **string** | Kerberos principal associated with key. | [optional] [readonly] +**Tags** | Pointer to **map[string]interface{}** | The tags for the Kerberos key in JSON format. | [optional] +**UploadedAt** | Pointer to **string** | Upload time for the key. | [optional] [readonly] +**Version** | Pointer to **int64** | The version number (KVNO) of the key. | [optional] [readonly] + +## Methods + +### NewKerberosKey + +`func NewKerberosKey() *KerberosKey` + +NewKerberosKey instantiates a new KerberosKey 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 + +### NewKerberosKeyWithDefaults + +`func NewKerberosKeyWithDefaults() *KerberosKey` + +NewKerberosKeyWithDefaults instantiates a new KerberosKey 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 + +### GetAlgorithm + +`func (o *KerberosKey) GetAlgorithm() string` + +GetAlgorithm returns the Algorithm field if non-nil, zero value otherwise. + +### GetAlgorithmOk + +`func (o *KerberosKey) GetAlgorithmOk() (*string, bool)` + +GetAlgorithmOk returns a tuple with the Algorithm field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlgorithm + +`func (o *KerberosKey) SetAlgorithm(v string)` + +SetAlgorithm sets Algorithm field to given value. + +### HasAlgorithm + +`func (o *KerberosKey) HasAlgorithm() bool` + +HasAlgorithm returns a boolean if a field has been set. + +### GetComment + +`func (o *KerberosKey) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *KerberosKey) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *KerberosKey) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *KerberosKey) HasComment() bool` + +HasComment returns a boolean if a field has been set. + +### GetDomain + +`func (o *KerberosKey) GetDomain() string` + +GetDomain returns the Domain field if non-nil, zero value otherwise. + +### GetDomainOk + +`func (o *KerberosKey) GetDomainOk() (*string, bool)` + +GetDomainOk returns a tuple with the Domain field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDomain + +`func (o *KerberosKey) SetDomain(v string)` + +SetDomain sets Domain field to given value. + +### HasDomain + +`func (o *KerberosKey) HasDomain() bool` + +HasDomain returns a boolean if a field has been set. + +### GetId + +`func (o *KerberosKey) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *KerberosKey) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *KerberosKey) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *KerberosKey) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPrincipal + +`func (o *KerberosKey) GetPrincipal() string` + +GetPrincipal returns the Principal field if non-nil, zero value otherwise. + +### GetPrincipalOk + +`func (o *KerberosKey) GetPrincipalOk() (*string, bool)` + +GetPrincipalOk returns a tuple with the Principal field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrincipal + +`func (o *KerberosKey) SetPrincipal(v string)` + +SetPrincipal sets Principal field to given value. + +### HasPrincipal + +`func (o *KerberosKey) HasPrincipal() bool` + +HasPrincipal returns a boolean if a field has been set. + +### GetTags + +`func (o *KerberosKey) GetTags() map[string]interface{}` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *KerberosKey) GetTagsOk() (*map[string]interface{}, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *KerberosKey) SetTags(v map[string]interface{})` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *KerberosKey) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetUploadedAt + +`func (o *KerberosKey) GetUploadedAt() string` + +GetUploadedAt returns the UploadedAt field if non-nil, zero value otherwise. + +### GetUploadedAtOk + +`func (o *KerberosKey) GetUploadedAtOk() (*string, bool)` + +GetUploadedAtOk returns a tuple with the UploadedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUploadedAt + +`func (o *KerberosKey) SetUploadedAt(v string)` + +SetUploadedAt sets UploadedAt field to given value. + +### HasUploadedAt + +`func (o *KerberosKey) HasUploadedAt() bool` + +HasUploadedAt returns a boolean if a field has been set. + +### GetVersion + +`func (o *KerberosKey) GetVersion() int64` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *KerberosKey) GetVersionOk() (*int64, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *KerberosKey) SetVersion(v int64)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *KerberosKey) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KerberosKeys.md b/keys/docs/KerberosKeys.md new file mode 100644 index 0000000..56a65cb --- /dev/null +++ b/keys/docs/KerberosKeys.md @@ -0,0 +1,56 @@ +# KerberosKeys + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Items** | Pointer to [**[]KerberosKey**](KerberosKey.md) | | [optional] + +## Methods + +### NewKerberosKeys + +`func NewKerberosKeys() *KerberosKeys` + +NewKerberosKeys instantiates a new KerberosKeys 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 + +### NewKerberosKeysWithDefaults + +`func NewKerberosKeysWithDefaults() *KerberosKeys` + +NewKerberosKeysWithDefaults instantiates a new KerberosKeys 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 + +### GetItems + +`func (o *KerberosKeys) GetItems() []KerberosKey` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *KerberosKeys) GetItemsOk() (*[]KerberosKey, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *KerberosKeys) SetItems(v []KerberosKey)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *KerberosKeys) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysCreateTSIGKeyResponse.md b/keys/docs/KeysCreateTSIGKeyResponse.md new file mode 100644 index 0000000..3aaf505 --- /dev/null +++ b/keys/docs/KeysCreateTSIGKeyResponse.md @@ -0,0 +1,56 @@ +# KeysCreateTSIGKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to [**KeysTSIGKey**](KeysTSIGKey.md) | | [optional] + +## Methods + +### NewKeysCreateTSIGKeyResponse + +`func NewKeysCreateTSIGKeyResponse() *KeysCreateTSIGKeyResponse` + +NewKeysCreateTSIGKeyResponse instantiates a new KeysCreateTSIGKeyResponse 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 + +### NewKeysCreateTSIGKeyResponseWithDefaults + +`func NewKeysCreateTSIGKeyResponseWithDefaults() *KeysCreateTSIGKeyResponse` + +NewKeysCreateTSIGKeyResponseWithDefaults instantiates a new KeysCreateTSIGKeyResponse 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 + +### GetResult + +`func (o *KeysCreateTSIGKeyResponse) GetResult() KeysTSIGKey` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *KeysCreateTSIGKeyResponse) GetResultOk() (*KeysTSIGKey, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *KeysCreateTSIGKeyResponse) SetResult(v KeysTSIGKey)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *KeysCreateTSIGKeyResponse) HasResult() bool` + +HasResult returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysGenerateTSIGResponse.md b/keys/docs/KeysGenerateTSIGResponse.md new file mode 100644 index 0000000..c6eeda5 --- /dev/null +++ b/keys/docs/KeysGenerateTSIGResponse.md @@ -0,0 +1,56 @@ +# KeysGenerateTSIGResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to [**KeysGenerateTSIGResult**](KeysGenerateTSIGResult.md) | | [optional] + +## Methods + +### NewKeysGenerateTSIGResponse + +`func NewKeysGenerateTSIGResponse() *KeysGenerateTSIGResponse` + +NewKeysGenerateTSIGResponse instantiates a new KeysGenerateTSIGResponse 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 + +### NewKeysGenerateTSIGResponseWithDefaults + +`func NewKeysGenerateTSIGResponseWithDefaults() *KeysGenerateTSIGResponse` + +NewKeysGenerateTSIGResponseWithDefaults instantiates a new KeysGenerateTSIGResponse 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 + +### GetResult + +`func (o *KeysGenerateTSIGResponse) GetResult() KeysGenerateTSIGResult` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *KeysGenerateTSIGResponse) GetResultOk() (*KeysGenerateTSIGResult, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *KeysGenerateTSIGResponse) SetResult(v KeysGenerateTSIGResult)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *KeysGenerateTSIGResponse) HasResult() bool` + +HasResult returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysGenerateTSIGResult.md b/keys/docs/KeysGenerateTSIGResult.md new file mode 100644 index 0000000..5a72c6d --- /dev/null +++ b/keys/docs/KeysGenerateTSIGResult.md @@ -0,0 +1,56 @@ +# KeysGenerateTSIGResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Secret** | Pointer to **string** | The random TSIG key secret generated by the specified algorithm as a Base64 encoded string. | [optional] + +## Methods + +### NewKeysGenerateTSIGResult + +`func NewKeysGenerateTSIGResult() *KeysGenerateTSIGResult` + +NewKeysGenerateTSIGResult instantiates a new KeysGenerateTSIGResult 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 + +### NewKeysGenerateTSIGResultWithDefaults + +`func NewKeysGenerateTSIGResultWithDefaults() *KeysGenerateTSIGResult` + +NewKeysGenerateTSIGResultWithDefaults instantiates a new KeysGenerateTSIGResult 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 + +### GetSecret + +`func (o *KeysGenerateTSIGResult) GetSecret() string` + +GetSecret returns the Secret field if non-nil, zero value otherwise. + +### GetSecretOk + +`func (o *KeysGenerateTSIGResult) GetSecretOk() (*string, bool)` + +GetSecretOk returns a tuple with the Secret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecret + +`func (o *KeysGenerateTSIGResult) SetSecret(v string)` + +SetSecret sets Secret field to given value. + +### HasSecret + +`func (o *KeysGenerateTSIGResult) HasSecret() bool` + +HasSecret returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysListKerberosKeyResponse.md b/keys/docs/KeysListKerberosKeyResponse.md new file mode 100644 index 0000000..6b20f0e --- /dev/null +++ b/keys/docs/KeysListKerberosKeyResponse.md @@ -0,0 +1,56 @@ +# KeysListKerberosKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | Pointer to [**[]KerberosKey**](KerberosKey.md) | The list of KerberosKey objects. | [optional] + +## Methods + +### NewKeysListKerberosKeyResponse + +`func NewKeysListKerberosKeyResponse() *KeysListKerberosKeyResponse` + +NewKeysListKerberosKeyResponse instantiates a new KeysListKerberosKeyResponse 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 + +### NewKeysListKerberosKeyResponseWithDefaults + +`func NewKeysListKerberosKeyResponseWithDefaults() *KeysListKerberosKeyResponse` + +NewKeysListKerberosKeyResponseWithDefaults instantiates a new KeysListKerberosKeyResponse 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 + +### GetResults + +`func (o *KeysListKerberosKeyResponse) GetResults() []KerberosKey` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *KeysListKerberosKeyResponse) GetResultsOk() (*[]KerberosKey, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *KeysListKerberosKeyResponse) SetResults(v []KerberosKey)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *KeysListKerberosKeyResponse) HasResults() bool` + +HasResults returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysListTSIGKeyResponse.md b/keys/docs/KeysListTSIGKeyResponse.md new file mode 100644 index 0000000..712b24a --- /dev/null +++ b/keys/docs/KeysListTSIGKeyResponse.md @@ -0,0 +1,56 @@ +# KeysListTSIGKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | Pointer to [**[]KeysTSIGKey**](KeysTSIGKey.md) | The list of TSIGKey objects. | [optional] + +## Methods + +### NewKeysListTSIGKeyResponse + +`func NewKeysListTSIGKeyResponse() *KeysListTSIGKeyResponse` + +NewKeysListTSIGKeyResponse instantiates a new KeysListTSIGKeyResponse 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 + +### NewKeysListTSIGKeyResponseWithDefaults + +`func NewKeysListTSIGKeyResponseWithDefaults() *KeysListTSIGKeyResponse` + +NewKeysListTSIGKeyResponseWithDefaults instantiates a new KeysListTSIGKeyResponse 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 + +### GetResults + +`func (o *KeysListTSIGKeyResponse) GetResults() []KeysTSIGKey` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *KeysListTSIGKeyResponse) GetResultsOk() (*[]KeysTSIGKey, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *KeysListTSIGKeyResponse) SetResults(v []KeysTSIGKey)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *KeysListTSIGKeyResponse) HasResults() bool` + +HasResults returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysReadKerberosKeyResponse.md b/keys/docs/KeysReadKerberosKeyResponse.md new file mode 100644 index 0000000..1b347c9 --- /dev/null +++ b/keys/docs/KeysReadKerberosKeyResponse.md @@ -0,0 +1,56 @@ +# KeysReadKerberosKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to [**KerberosKey**](KerberosKey.md) | | [optional] + +## Methods + +### NewKeysReadKerberosKeyResponse + +`func NewKeysReadKerberosKeyResponse() *KeysReadKerberosKeyResponse` + +NewKeysReadKerberosKeyResponse instantiates a new KeysReadKerberosKeyResponse 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 + +### NewKeysReadKerberosKeyResponseWithDefaults + +`func NewKeysReadKerberosKeyResponseWithDefaults() *KeysReadKerberosKeyResponse` + +NewKeysReadKerberosKeyResponseWithDefaults instantiates a new KeysReadKerberosKeyResponse 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 + +### GetResult + +`func (o *KeysReadKerberosKeyResponse) GetResult() KerberosKey` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *KeysReadKerberosKeyResponse) GetResultOk() (*KerberosKey, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *KeysReadKerberosKeyResponse) SetResult(v KerberosKey)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *KeysReadKerberosKeyResponse) HasResult() bool` + +HasResult returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysReadTSIGKeyResponse.md b/keys/docs/KeysReadTSIGKeyResponse.md new file mode 100644 index 0000000..ac24fa0 --- /dev/null +++ b/keys/docs/KeysReadTSIGKeyResponse.md @@ -0,0 +1,56 @@ +# KeysReadTSIGKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to [**KeysTSIGKey**](KeysTSIGKey.md) | | [optional] + +## Methods + +### NewKeysReadTSIGKeyResponse + +`func NewKeysReadTSIGKeyResponse() *KeysReadTSIGKeyResponse` + +NewKeysReadTSIGKeyResponse instantiates a new KeysReadTSIGKeyResponse 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 + +### NewKeysReadTSIGKeyResponseWithDefaults + +`func NewKeysReadTSIGKeyResponseWithDefaults() *KeysReadTSIGKeyResponse` + +NewKeysReadTSIGKeyResponseWithDefaults instantiates a new KeysReadTSIGKeyResponse 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 + +### GetResult + +`func (o *KeysReadTSIGKeyResponse) GetResult() KeysTSIGKey` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *KeysReadTSIGKeyResponse) GetResultOk() (*KeysTSIGKey, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *KeysReadTSIGKeyResponse) SetResult(v KeysTSIGKey)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *KeysReadTSIGKeyResponse) HasResult() bool` + +HasResult returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysTSIGKey.md b/keys/docs/KeysTSIGKey.md new file mode 100644 index 0000000..d4f1e06 --- /dev/null +++ b/keys/docs/KeysTSIGKey.md @@ -0,0 +1,254 @@ +# KeysTSIGKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Algorithm** | Pointer to **string** | The TSIG key algorithm. Valid values are: * _hmac_sha1_ * _hmac_sha224_ * _hmac_sha256_ * _hmac_sha384_ * _hmac_sha512_ Defaults to _hmac_sha256_. | [optional] +**Comment** | Pointer to **string** | The description for the TSIG key. May contain 0 to 1024 characters. Can include UTF-8. | [optional] +**CreatedAt** | Pointer to **time.Time** | Time when the object has been created. | [optional] [readonly] +**Id** | Pointer to **string** | The resource identifier. | [optional] [readonly] +**Name** | **string** | The TSIG key name in the absolute domain name format. | +**ProtocolName** | Pointer to **string** | The TSIG key name supplied during a create/update operation that is converted to canonical form in punycode. | [optional] [readonly] +**Secret** | **string** | The TSIG key secret as a Base64 encoded string. | +**Tags** | Pointer to **map[string]interface{}** | The tags for the TSIG key in JSON format. | [optional] +**UpdatedAt** | Pointer to **time.Time** | Time when the object has been updated. Equals to _created_at_ if not updated after creation. | [optional] [readonly] + +## Methods + +### NewKeysTSIGKey + +`func NewKeysTSIGKey(name string, secret string, ) *KeysTSIGKey` + +NewKeysTSIGKey instantiates a new KeysTSIGKey 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 + +### NewKeysTSIGKeyWithDefaults + +`func NewKeysTSIGKeyWithDefaults() *KeysTSIGKey` + +NewKeysTSIGKeyWithDefaults instantiates a new KeysTSIGKey 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 + +### GetAlgorithm + +`func (o *KeysTSIGKey) GetAlgorithm() string` + +GetAlgorithm returns the Algorithm field if non-nil, zero value otherwise. + +### GetAlgorithmOk + +`func (o *KeysTSIGKey) GetAlgorithmOk() (*string, bool)` + +GetAlgorithmOk returns a tuple with the Algorithm field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlgorithm + +`func (o *KeysTSIGKey) SetAlgorithm(v string)` + +SetAlgorithm sets Algorithm field to given value. + +### HasAlgorithm + +`func (o *KeysTSIGKey) HasAlgorithm() bool` + +HasAlgorithm returns a boolean if a field has been set. + +### GetComment + +`func (o *KeysTSIGKey) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *KeysTSIGKey) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *KeysTSIGKey) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *KeysTSIGKey) HasComment() bool` + +HasComment returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *KeysTSIGKey) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *KeysTSIGKey) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *KeysTSIGKey) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *KeysTSIGKey) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetId + +`func (o *KeysTSIGKey) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *KeysTSIGKey) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *KeysTSIGKey) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *KeysTSIGKey) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *KeysTSIGKey) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *KeysTSIGKey) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *KeysTSIGKey) SetName(v string)` + +SetName sets Name field to given value. + + +### GetProtocolName + +`func (o *KeysTSIGKey) GetProtocolName() string` + +GetProtocolName returns the ProtocolName field if non-nil, zero value otherwise. + +### GetProtocolNameOk + +`func (o *KeysTSIGKey) GetProtocolNameOk() (*string, bool)` + +GetProtocolNameOk returns a tuple with the ProtocolName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProtocolName + +`func (o *KeysTSIGKey) SetProtocolName(v string)` + +SetProtocolName sets ProtocolName field to given value. + +### HasProtocolName + +`func (o *KeysTSIGKey) HasProtocolName() bool` + +HasProtocolName returns a boolean if a field has been set. + +### GetSecret + +`func (o *KeysTSIGKey) GetSecret() string` + +GetSecret returns the Secret field if non-nil, zero value otherwise. + +### GetSecretOk + +`func (o *KeysTSIGKey) GetSecretOk() (*string, bool)` + +GetSecretOk returns a tuple with the Secret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecret + +`func (o *KeysTSIGKey) SetSecret(v string)` + +SetSecret sets Secret field to given value. + + +### GetTags + +`func (o *KeysTSIGKey) GetTags() map[string]interface{}` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *KeysTSIGKey) GetTagsOk() (*map[string]interface{}, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *KeysTSIGKey) SetTags(v map[string]interface{})` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *KeysTSIGKey) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *KeysTSIGKey) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *KeysTSIGKey) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *KeysTSIGKey) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *KeysTSIGKey) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysUpdateKerberosKeyResponse.md b/keys/docs/KeysUpdateKerberosKeyResponse.md new file mode 100644 index 0000000..36f36e6 --- /dev/null +++ b/keys/docs/KeysUpdateKerberosKeyResponse.md @@ -0,0 +1,56 @@ +# KeysUpdateKerberosKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to [**KerberosKey**](KerberosKey.md) | | [optional] + +## Methods + +### NewKeysUpdateKerberosKeyResponse + +`func NewKeysUpdateKerberosKeyResponse() *KeysUpdateKerberosKeyResponse` + +NewKeysUpdateKerberosKeyResponse instantiates a new KeysUpdateKerberosKeyResponse 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 + +### NewKeysUpdateKerberosKeyResponseWithDefaults + +`func NewKeysUpdateKerberosKeyResponseWithDefaults() *KeysUpdateKerberosKeyResponse` + +NewKeysUpdateKerberosKeyResponseWithDefaults instantiates a new KeysUpdateKerberosKeyResponse 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 + +### GetResult + +`func (o *KeysUpdateKerberosKeyResponse) GetResult() KerberosKey` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *KeysUpdateKerberosKeyResponse) GetResultOk() (*KerberosKey, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *KeysUpdateKerberosKeyResponse) SetResult(v KerberosKey)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *KeysUpdateKerberosKeyResponse) HasResult() bool` + +HasResult returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/KeysUpdateTSIGKeyResponse.md b/keys/docs/KeysUpdateTSIGKeyResponse.md new file mode 100644 index 0000000..81063c2 --- /dev/null +++ b/keys/docs/KeysUpdateTSIGKeyResponse.md @@ -0,0 +1,56 @@ +# KeysUpdateTSIGKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | Pointer to [**KeysTSIGKey**](KeysTSIGKey.md) | | [optional] + +## Methods + +### NewKeysUpdateTSIGKeyResponse + +`func NewKeysUpdateTSIGKeyResponse() *KeysUpdateTSIGKeyResponse` + +NewKeysUpdateTSIGKeyResponse instantiates a new KeysUpdateTSIGKeyResponse 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 + +### NewKeysUpdateTSIGKeyResponseWithDefaults + +`func NewKeysUpdateTSIGKeyResponseWithDefaults() *KeysUpdateTSIGKeyResponse` + +NewKeysUpdateTSIGKeyResponseWithDefaults instantiates a new KeysUpdateTSIGKeyResponse 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 + +### GetResult + +`func (o *KeysUpdateTSIGKeyResponse) GetResult() KeysTSIGKey` + +GetResult returns the Result field if non-nil, zero value otherwise. + +### GetResultOk + +`func (o *KeysUpdateTSIGKeyResponse) GetResultOk() (*KeysTSIGKey, bool)` + +GetResultOk returns a tuple with the Result field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResult + +`func (o *KeysUpdateTSIGKeyResponse) SetResult(v KeysTSIGKey)` + +SetResult sets Result field to given value. + +### HasResult + +`func (o *KeysUpdateTSIGKeyResponse) HasResult() bool` + +HasResult returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/ProtobufFieldMask.md b/keys/docs/ProtobufFieldMask.md new file mode 100644 index 0000000..770b011 --- /dev/null +++ b/keys/docs/ProtobufFieldMask.md @@ -0,0 +1,56 @@ +# ProtobufFieldMask + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Paths** | Pointer to **[]string** | The set of field mask paths. | [optional] + +## Methods + +### NewProtobufFieldMask + +`func NewProtobufFieldMask() *ProtobufFieldMask` + +NewProtobufFieldMask instantiates a new ProtobufFieldMask 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 + +### NewProtobufFieldMaskWithDefaults + +`func NewProtobufFieldMaskWithDefaults() *ProtobufFieldMask` + +NewProtobufFieldMaskWithDefaults instantiates a new ProtobufFieldMask 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 + +### GetPaths + +`func (o *ProtobufFieldMask) GetPaths() []string` + +GetPaths returns the Paths field if non-nil, zero value otherwise. + +### GetPathsOk + +`func (o *ProtobufFieldMask) GetPathsOk() (*[]string, bool)` + +GetPathsOk returns a tuple with the Paths field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaths + +`func (o *ProtobufFieldMask) SetPaths(v []string)` + +SetPaths sets Paths field to given value. + +### HasPaths + +`func (o *ProtobufFieldMask) HasPaths() bool` + +HasPaths returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/TsigAPI.md b/keys/docs/TsigAPI.md new file mode 100644 index 0000000..447b8d2 --- /dev/null +++ b/keys/docs/TsigAPI.md @@ -0,0 +1,371 @@ +# \TsigAPI + +All URIs are relative to *http://localhost/api/ddi/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TsigCreate**](TsigAPI.md#TsigCreate) | **Post** /keys/tsig | Create the TSIG key. +[**TsigDelete**](TsigAPI.md#TsigDelete) | **Delete** /keys/tsig/{id} | Delete the TSIG key. +[**TsigList**](TsigAPI.md#TsigList) | **Get** /keys/tsig | Retrieve TSIG keys. +[**TsigRead**](TsigAPI.md#TsigRead) | **Get** /keys/tsig/{id} | Retrieve the TSIG key. +[**TsigUpdate**](TsigAPI.md#TsigUpdate) | **Patch** /keys/tsig/{id} | Update the TSIG key. + + + +## TsigCreate + +> KeysCreateTSIGKeyResponse TsigCreate(ctx).Body(body).Execute() + +Create the TSIG key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + body := *openapiclient.NewKeysTSIGKey("Name_example", "Secret_example") // KeysTSIGKey | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TsigAPI.TsigCreate(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TsigAPI.TsigCreate``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TsigCreate`: KeysCreateTSIGKeyResponse + fmt.Fprintf(os.Stdout, "Response from `TsigAPI.TsigCreate`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTsigCreateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**KeysTSIGKey**](KeysTSIGKey.md) | | + +### Return type + +[**KeysCreateTSIGKeyResponse**](KeysCreateTSIGKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TsigDelete + +> TsigDelete(ctx, id).Execute() + +Delete the TSIG key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + id := "id_example" // string | An application specific resource identity of a resource + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TsigAPI.TsigDelete(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TsigAPI.TsigDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | An application specific resource identity of a resource | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTsigDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TsigList + +> KeysListTSIGKeyResponse TsigList(ctx).Fields(fields).Filter(filter).Offset(offset).Limit(limit).PageToken(pageToken).OrderBy(orderBy).Tfilter(tfilter).TorderBy(torderBy).Execute() + +Retrieve TSIG keys. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + fields := "fields_example" // string | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. (optional) + filter := "filter_example" // string | A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | (optional) + offset := int32(56) // int32 | The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. (optional) + limit := int32(56) // int32 | The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. (optional) + pageToken := "pageToken_example" // string | The service-defined string used to identify a page of resources. A null value indicates the first page. (optional) + orderBy := "orderBy_example" // string | A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. (optional) + tfilter := "tfilter_example" // string | This parameter is used for filtering by tags. (optional) + torderBy := "torderBy_example" // string | This parameter is used for sorting by tags. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TsigAPI.TsigList(context.Background()).Fields(fields).Filter(filter).Offset(offset).Limit(limit).PageToken(pageToken).OrderBy(orderBy).Tfilter(tfilter).TorderBy(torderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TsigAPI.TsigList``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TsigList`: KeysListTSIGKeyResponse + fmt.Fprintf(os.Stdout, "Response from `TsigAPI.TsigList`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTsigListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **string** | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. | + **filter** | **string** | A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | | + **offset** | **int32** | The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. | + **limit** | **int32** | The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. | + **pageToken** | **string** | The service-defined string used to identify a page of resources. A null value indicates the first page. | + **orderBy** | **string** | A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. | + **tfilter** | **string** | This parameter is used for filtering by tags. | + **torderBy** | **string** | This parameter is used for sorting by tags. | + +### Return type + +[**KeysListTSIGKeyResponse**](KeysListTSIGKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TsigRead + +> KeysReadTSIGKeyResponse TsigRead(ctx, id).Fields(fields).Execute() + +Retrieve the TSIG key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + id := "id_example" // string | An application specific resource identity of a resource + fields := "fields_example" // string | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TsigAPI.TsigRead(context.Background(), id).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TsigAPI.TsigRead``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TsigRead`: KeysReadTSIGKeyResponse + fmt.Fprintf(os.Stdout, "Response from `TsigAPI.TsigRead`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | An application specific resource identity of a resource | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTsigReadRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **string** | A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. | + +### Return type + +[**KeysReadTSIGKeyResponse**](KeysReadTSIGKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TsigUpdate + +> KeysUpdateTSIGKeyResponse TsigUpdate(ctx, id).Body(body).Execute() + +Update the TSIG key. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + id := "id_example" // string | An application specific resource identity of a resource + body := *openapiclient.NewKeysTSIGKey("Name_example", "Secret_example") // KeysTSIGKey | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TsigAPI.TsigUpdate(context.Background(), id).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TsigAPI.TsigUpdate``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TsigUpdate`: KeysUpdateTSIGKeyResponse + fmt.Fprintf(os.Stdout, "Response from `TsigAPI.TsigUpdate`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | An application specific resource identity of a resource | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTsigUpdateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**KeysTSIGKey**](KeysTSIGKey.md) | | + +### Return type + +[**KeysUpdateTSIGKeyResponse**](KeysUpdateTSIGKeyResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/keys/docs/UploadAPI.md b/keys/docs/UploadAPI.md new file mode 100644 index 0000000..00cc161 --- /dev/null +++ b/keys/docs/UploadAPI.md @@ -0,0 +1,75 @@ +# \UploadAPI + +All URIs are relative to *http://localhost/api/ddi/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UploadUpload**](UploadAPI.md#UploadUpload) | **Post** /keys/upload | Upload content to the keys service. + + + +## UploadUpload + +> DdiuploadResponse UploadUpload(ctx).Body(body).Execute() + +Upload content to the keys service. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/infobloxopen/bloxone-go-client" +) + +func main() { + body := *openapiclient.NewUploadRequest("Content_example", openapiclient.uploadContentType("UNKNOWN")) // UploadRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UploadAPI.UploadUpload(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UploadAPI.UploadUpload``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadUpload`: DdiuploadResponse + fmt.Fprintf(os.Stdout, "Response from `UploadAPI.UploadUpload`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUploadUploadRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**UploadRequest**](UploadRequest.md) | | + +### Return type + +[**DdiuploadResponse**](DdiuploadResponse.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/keys/docs/UploadContentType.md b/keys/docs/UploadContentType.md new file mode 100644 index 0000000..bf699ed --- /dev/null +++ b/keys/docs/UploadContentType.md @@ -0,0 +1,13 @@ +# UploadContentType + +## Enum + + +* `UNKNOWN` (value: `"UNKNOWN"`) + +* `KEYTAB` (value: `"KEYTAB"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/docs/UploadRequest.md b/keys/docs/UploadRequest.md new file mode 100644 index 0000000..8c9d587 --- /dev/null +++ b/keys/docs/UploadRequest.md @@ -0,0 +1,150 @@ +# UploadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Comment** | Pointer to **string** | The description for uploaded content. May contain 0 to 1024 characters. Can include UTF-8. | [optional] +**Content** | **string** | Base64 encoded content. | +**Fields** | Pointer to [**ProtobufFieldMask**](ProtobufFieldMask.md) | | [optional] +**Tags** | Pointer to **map[string]interface{}** | The tags for uploaded content in JSON format. | [optional] +**Type** | [**UploadContentType**](UploadContentType.md) | | [default to UPLOADCONTENTTYPE_UNKNOWN] + +## Methods + +### NewUploadRequest + +`func NewUploadRequest(content string, type_ UploadContentType, ) *UploadRequest` + +NewUploadRequest instantiates a new UploadRequest 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 + +### NewUploadRequestWithDefaults + +`func NewUploadRequestWithDefaults() *UploadRequest` + +NewUploadRequestWithDefaults instantiates a new UploadRequest 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 + +### GetComment + +`func (o *UploadRequest) GetComment() string` + +GetComment returns the Comment field if non-nil, zero value otherwise. + +### GetCommentOk + +`func (o *UploadRequest) GetCommentOk() (*string, bool)` + +GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComment + +`func (o *UploadRequest) SetComment(v string)` + +SetComment sets Comment field to given value. + +### HasComment + +`func (o *UploadRequest) HasComment() bool` + +HasComment returns a boolean if a field has been set. + +### GetContent + +`func (o *UploadRequest) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *UploadRequest) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *UploadRequest) SetContent(v string)` + +SetContent sets Content field to given value. + + +### GetFields + +`func (o *UploadRequest) GetFields() ProtobufFieldMask` + +GetFields returns the Fields field if non-nil, zero value otherwise. + +### GetFieldsOk + +`func (o *UploadRequest) GetFieldsOk() (*ProtobufFieldMask, bool)` + +GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFields + +`func (o *UploadRequest) SetFields(v ProtobufFieldMask)` + +SetFields sets Fields field to given value. + +### HasFields + +`func (o *UploadRequest) HasFields() bool` + +HasFields returns a boolean if a field has been set. + +### GetTags + +`func (o *UploadRequest) GetTags() map[string]interface{}` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *UploadRequest) GetTagsOk() (*map[string]interface{}, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *UploadRequest) SetTags(v map[string]interface{})` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *UploadRequest) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *UploadRequest) GetType() UploadContentType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *UploadRequest) GetTypeOk() (*UploadContentType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *UploadRequest) SetType(v UploadContentType)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/keys/model_ddiupload_response.go b/keys/model_ddiupload_response.go new file mode 100644 index 0000000..a58ddfb --- /dev/null +++ b/keys/model_ddiupload_response.go @@ -0,0 +1,161 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the DdiuploadResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DdiuploadResponse{} + +// DdiuploadResponse The response format for uploading content. +type DdiuploadResponse struct { + KerberosKeys *KerberosKeys `json:"kerberos_keys,omitempty"` + // May contain any non-critical warning messages after processing the content. + Warning *string `json:"warning,omitempty"` +} + +// NewDdiuploadResponse instantiates a new DdiuploadResponse 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 NewDdiuploadResponse() *DdiuploadResponse { + this := DdiuploadResponse{} + return &this +} + +// NewDdiuploadResponseWithDefaults instantiates a new DdiuploadResponse 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 NewDdiuploadResponseWithDefaults() *DdiuploadResponse { + this := DdiuploadResponse{} + return &this +} + +// GetKerberosKeys returns the KerberosKeys field value if set, zero value otherwise. +func (o *DdiuploadResponse) GetKerberosKeys() KerberosKeys { + if o == nil || IsNil(o.KerberosKeys) { + var ret KerberosKeys + return ret + } + return *o.KerberosKeys +} + +// GetKerberosKeysOk returns a tuple with the KerberosKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DdiuploadResponse) GetKerberosKeysOk() (*KerberosKeys, bool) { + if o == nil || IsNil(o.KerberosKeys) { + return nil, false + } + return o.KerberosKeys, true +} + +// HasKerberosKeys returns a boolean if a field has been set. +func (o *DdiuploadResponse) HasKerberosKeys() bool { + if o != nil && !IsNil(o.KerberosKeys) { + return true + } + + return false +} + +// SetKerberosKeys gets a reference to the given KerberosKeys and assigns it to the KerberosKeys field. +func (o *DdiuploadResponse) SetKerberosKeys(v KerberosKeys) { + o.KerberosKeys = &v +} + +// GetWarning returns the Warning field value if set, zero value otherwise. +func (o *DdiuploadResponse) GetWarning() string { + if o == nil || IsNil(o.Warning) { + var ret string + return ret + } + return *o.Warning +} + +// GetWarningOk returns a tuple with the Warning field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DdiuploadResponse) GetWarningOk() (*string, bool) { + if o == nil || IsNil(o.Warning) { + return nil, false + } + return o.Warning, true +} + +// HasWarning returns a boolean if a field has been set. +func (o *DdiuploadResponse) HasWarning() bool { + if o != nil && !IsNil(o.Warning) { + return true + } + + return false +} + +// SetWarning gets a reference to the given string and assigns it to the Warning field. +func (o *DdiuploadResponse) SetWarning(v string) { + o.Warning = &v +} + +func (o DdiuploadResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DdiuploadResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.KerberosKeys) { + toSerialize["kerberos_keys"] = o.KerberosKeys + } + if !IsNil(o.Warning) { + toSerialize["warning"] = o.Warning + } + return toSerialize, nil +} + +type NullableDdiuploadResponse struct { + value *DdiuploadResponse + isSet bool +} + +func (v NullableDdiuploadResponse) Get() *DdiuploadResponse { + return v.value +} + +func (v *NullableDdiuploadResponse) Set(val *DdiuploadResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDdiuploadResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDdiuploadResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDdiuploadResponse(val *DdiuploadResponse) *NullableDdiuploadResponse { + return &NullableDdiuploadResponse{value: val, isSet: true} +} + +func (v NullableDdiuploadResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDdiuploadResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_kerberos_key.go b/keys/model_kerberos_key.go new file mode 100644 index 0000000..ee036c9 --- /dev/null +++ b/keys/model_kerberos_key.go @@ -0,0 +1,384 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KerberosKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KerberosKey{} + +// KerberosKey A __Key__ object represents a Kerberos key. +type KerberosKey struct { + // Encryption algorithm of the key in accordance with RFC 3961. + Algorithm *string `json:"algorithm,omitempty"` + // The description for Kerberos key. May contain 0 to 1024 characters. Can include UTF-8. + Comment *string `json:"comment,omitempty"` + // Kerberos realm of the principal. + Domain *string `json:"domain,omitempty"` + // The resource identifier. + Id *string `json:"id,omitempty"` + // Kerberos principal associated with key. + Principal *string `json:"principal,omitempty"` + // The tags for the Kerberos key in JSON format. + Tags map[string]interface{} `json:"tags,omitempty"` + // Upload time for the key. + UploadedAt *string `json:"uploaded_at,omitempty"` + // The version number (KVNO) of the key. + Version *int64 `json:"version,omitempty"` +} + +// NewKerberosKey instantiates a new KerberosKey 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 NewKerberosKey() *KerberosKey { + this := KerberosKey{} + return &this +} + +// NewKerberosKeyWithDefaults instantiates a new KerberosKey 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 NewKerberosKeyWithDefaults() *KerberosKey { + this := KerberosKey{} + return &this +} + +// GetAlgorithm returns the Algorithm field value if set, zero value otherwise. +func (o *KerberosKey) GetAlgorithm() string { + if o == nil || IsNil(o.Algorithm) { + var ret string + return ret + } + return *o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetAlgorithmOk() (*string, bool) { + if o == nil || IsNil(o.Algorithm) { + return nil, false + } + return o.Algorithm, true +} + +// HasAlgorithm returns a boolean if a field has been set. +func (o *KerberosKey) HasAlgorithm() bool { + if o != nil && !IsNil(o.Algorithm) { + return true + } + + return false +} + +// SetAlgorithm gets a reference to the given string and assigns it to the Algorithm field. +func (o *KerberosKey) SetAlgorithm(v string) { + o.Algorithm = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *KerberosKey) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *KerberosKey) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *KerberosKey) SetComment(v string) { + o.Comment = &v +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *KerberosKey) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *KerberosKey) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *KerberosKey) SetDomain(v string) { + o.Domain = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *KerberosKey) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *KerberosKey) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *KerberosKey) SetId(v string) { + o.Id = &v +} + +// GetPrincipal returns the Principal field value if set, zero value otherwise. +func (o *KerberosKey) GetPrincipal() string { + if o == nil || IsNil(o.Principal) { + var ret string + return ret + } + return *o.Principal +} + +// GetPrincipalOk returns a tuple with the Principal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetPrincipalOk() (*string, bool) { + if o == nil || IsNil(o.Principal) { + return nil, false + } + return o.Principal, true +} + +// HasPrincipal returns a boolean if a field has been set. +func (o *KerberosKey) HasPrincipal() bool { + if o != nil && !IsNil(o.Principal) { + return true + } + + return false +} + +// SetPrincipal gets a reference to the given string and assigns it to the Principal field. +func (o *KerberosKey) SetPrincipal(v string) { + o.Principal = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *KerberosKey) GetTags() map[string]interface{} { + if o == nil || IsNil(o.Tags) { + var ret map[string]interface{} + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetTagsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Tags) { + return map[string]interface{}{}, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *KerberosKey) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]interface{} and assigns it to the Tags field. +func (o *KerberosKey) SetTags(v map[string]interface{}) { + o.Tags = v +} + +// GetUploadedAt returns the UploadedAt field value if set, zero value otherwise. +func (o *KerberosKey) GetUploadedAt() string { + if o == nil || IsNil(o.UploadedAt) { + var ret string + return ret + } + return *o.UploadedAt +} + +// GetUploadedAtOk returns a tuple with the UploadedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetUploadedAtOk() (*string, bool) { + if o == nil || IsNil(o.UploadedAt) { + return nil, false + } + return o.UploadedAt, true +} + +// HasUploadedAt returns a boolean if a field has been set. +func (o *KerberosKey) HasUploadedAt() bool { + if o != nil && !IsNil(o.UploadedAt) { + return true + } + + return false +} + +// SetUploadedAt gets a reference to the given string and assigns it to the UploadedAt field. +func (o *KerberosKey) SetUploadedAt(v string) { + o.UploadedAt = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *KerberosKey) GetVersion() int64 { + if o == nil || IsNil(o.Version) { + var ret int64 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKey) GetVersionOk() (*int64, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *KerberosKey) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given int64 and assigns it to the Version field. +func (o *KerberosKey) SetVersion(v int64) { + o.Version = &v +} + +func (o KerberosKey) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KerberosKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Algorithm) { + toSerialize["algorithm"] = o.Algorithm + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Principal) { + toSerialize["principal"] = o.Principal + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.UploadedAt) { + toSerialize["uploaded_at"] = o.UploadedAt + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil +} + +type NullableKerberosKey struct { + value *KerberosKey + isSet bool +} + +func (v NullableKerberosKey) Get() *KerberosKey { + return v.value +} + +func (v *NullableKerberosKey) Set(val *KerberosKey) { + v.value = val + v.isSet = true +} + +func (v NullableKerberosKey) IsSet() bool { + return v.isSet +} + +func (v *NullableKerberosKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKerberosKey(val *KerberosKey) *NullableKerberosKey { + return &NullableKerberosKey{value: val, isSet: true} +} + +func (v NullableKerberosKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKerberosKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_kerberos_keys.go b/keys/model_kerberos_keys.go new file mode 100644 index 0000000..1c06064 --- /dev/null +++ b/keys/model_kerberos_keys.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KerberosKeys type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KerberosKeys{} + +// KerberosKeys The list of __Key__ objects. +type KerberosKeys struct { + Items []KerberosKey `json:"items,omitempty"` +} + +// NewKerberosKeys instantiates a new KerberosKeys 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 NewKerberosKeys() *KerberosKeys { + this := KerberosKeys{} + return &this +} + +// NewKerberosKeysWithDefaults instantiates a new KerberosKeys 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 NewKerberosKeysWithDefaults() *KerberosKeys { + this := KerberosKeys{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *KerberosKeys) GetItems() []KerberosKey { + if o == nil || IsNil(o.Items) { + var ret []KerberosKey + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosKeys) GetItemsOk() ([]KerberosKey, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *KerberosKeys) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []KerberosKey and assigns it to the Items field. +func (o *KerberosKeys) SetItems(v []KerberosKey) { + o.Items = v +} + +func (o KerberosKeys) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KerberosKeys) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableKerberosKeys struct { + value *KerberosKeys + isSet bool +} + +func (v NullableKerberosKeys) Get() *KerberosKeys { + return v.value +} + +func (v *NullableKerberosKeys) Set(val *KerberosKeys) { + v.value = val + v.isSet = true +} + +func (v NullableKerberosKeys) IsSet() bool { + return v.isSet +} + +func (v *NullableKerberosKeys) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKerberosKeys(val *KerberosKeys) *NullableKerberosKeys { + return &NullableKerberosKeys{value: val, isSet: true} +} + +func (v NullableKerberosKeys) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKerberosKeys) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_create_tsig_key_response.go b/keys/model_keys_create_tsig_key_response.go new file mode 100644 index 0000000..edd0da5 --- /dev/null +++ b/keys/model_keys_create_tsig_key_response.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysCreateTSIGKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysCreateTSIGKeyResponse{} + +// KeysCreateTSIGKeyResponse The response format to create a __TSIGKey__ object. +type KeysCreateTSIGKeyResponse struct { + Result *KeysTSIGKey `json:"result,omitempty"` +} + +// NewKeysCreateTSIGKeyResponse instantiates a new KeysCreateTSIGKeyResponse 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 NewKeysCreateTSIGKeyResponse() *KeysCreateTSIGKeyResponse { + this := KeysCreateTSIGKeyResponse{} + return &this +} + +// NewKeysCreateTSIGKeyResponseWithDefaults instantiates a new KeysCreateTSIGKeyResponse 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 NewKeysCreateTSIGKeyResponseWithDefaults() *KeysCreateTSIGKeyResponse { + this := KeysCreateTSIGKeyResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *KeysCreateTSIGKeyResponse) GetResult() KeysTSIGKey { + if o == nil || IsNil(o.Result) { + var ret KeysTSIGKey + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysCreateTSIGKeyResponse) GetResultOk() (*KeysTSIGKey, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *KeysCreateTSIGKeyResponse) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given KeysTSIGKey and assigns it to the Result field. +func (o *KeysCreateTSIGKeyResponse) SetResult(v KeysTSIGKey) { + o.Result = &v +} + +func (o KeysCreateTSIGKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysCreateTSIGKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + return toSerialize, nil +} + +type NullableKeysCreateTSIGKeyResponse struct { + value *KeysCreateTSIGKeyResponse + isSet bool +} + +func (v NullableKeysCreateTSIGKeyResponse) Get() *KeysCreateTSIGKeyResponse { + return v.value +} + +func (v *NullableKeysCreateTSIGKeyResponse) Set(val *KeysCreateTSIGKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysCreateTSIGKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysCreateTSIGKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysCreateTSIGKeyResponse(val *KeysCreateTSIGKeyResponse) *NullableKeysCreateTSIGKeyResponse { + return &NullableKeysCreateTSIGKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysCreateTSIGKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysCreateTSIGKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_generate_tsig_response.go b/keys/model_keys_generate_tsig_response.go new file mode 100644 index 0000000..85f10e4 --- /dev/null +++ b/keys/model_keys_generate_tsig_response.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysGenerateTSIGResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysGenerateTSIGResponse{} + +// KeysGenerateTSIGResponse The response format to generate the TSIG key. +type KeysGenerateTSIGResponse struct { + Result *KeysGenerateTSIGResult `json:"result,omitempty"` +} + +// NewKeysGenerateTSIGResponse instantiates a new KeysGenerateTSIGResponse 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 NewKeysGenerateTSIGResponse() *KeysGenerateTSIGResponse { + this := KeysGenerateTSIGResponse{} + return &this +} + +// NewKeysGenerateTSIGResponseWithDefaults instantiates a new KeysGenerateTSIGResponse 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 NewKeysGenerateTSIGResponseWithDefaults() *KeysGenerateTSIGResponse { + this := KeysGenerateTSIGResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *KeysGenerateTSIGResponse) GetResult() KeysGenerateTSIGResult { + if o == nil || IsNil(o.Result) { + var ret KeysGenerateTSIGResult + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysGenerateTSIGResponse) GetResultOk() (*KeysGenerateTSIGResult, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *KeysGenerateTSIGResponse) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given KeysGenerateTSIGResult and assigns it to the Result field. +func (o *KeysGenerateTSIGResponse) SetResult(v KeysGenerateTSIGResult) { + o.Result = &v +} + +func (o KeysGenerateTSIGResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysGenerateTSIGResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + return toSerialize, nil +} + +type NullableKeysGenerateTSIGResponse struct { + value *KeysGenerateTSIGResponse + isSet bool +} + +func (v NullableKeysGenerateTSIGResponse) Get() *KeysGenerateTSIGResponse { + return v.value +} + +func (v *NullableKeysGenerateTSIGResponse) Set(val *KeysGenerateTSIGResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysGenerateTSIGResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysGenerateTSIGResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysGenerateTSIGResponse(val *KeysGenerateTSIGResponse) *NullableKeysGenerateTSIGResponse { + return &NullableKeysGenerateTSIGResponse{value: val, isSet: true} +} + +func (v NullableKeysGenerateTSIGResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysGenerateTSIGResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_generate_tsig_result.go b/keys/model_keys_generate_tsig_result.go new file mode 100644 index 0000000..4f6b49d --- /dev/null +++ b/keys/model_keys_generate_tsig_result.go @@ -0,0 +1,125 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysGenerateTSIGResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysGenerateTSIGResult{} + +// KeysGenerateTSIGResult The generated TSIG key. +type KeysGenerateTSIGResult struct { + // The random TSIG key secret generated by the specified algorithm as a Base64 encoded string. + Secret *string `json:"secret,omitempty"` +} + +// NewKeysGenerateTSIGResult instantiates a new KeysGenerateTSIGResult 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 NewKeysGenerateTSIGResult() *KeysGenerateTSIGResult { + this := KeysGenerateTSIGResult{} + return &this +} + +// NewKeysGenerateTSIGResultWithDefaults instantiates a new KeysGenerateTSIGResult 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 NewKeysGenerateTSIGResultWithDefaults() *KeysGenerateTSIGResult { + this := KeysGenerateTSIGResult{} + return &this +} + +// GetSecret returns the Secret field value if set, zero value otherwise. +func (o *KeysGenerateTSIGResult) GetSecret() string { + if o == nil || IsNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysGenerateTSIGResult) GetSecretOk() (*string, bool) { + if o == nil || IsNil(o.Secret) { + return nil, false + } + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *KeysGenerateTSIGResult) HasSecret() bool { + if o != nil && !IsNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *KeysGenerateTSIGResult) SetSecret(v string) { + o.Secret = &v +} + +func (o KeysGenerateTSIGResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysGenerateTSIGResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Secret) { + toSerialize["secret"] = o.Secret + } + return toSerialize, nil +} + +type NullableKeysGenerateTSIGResult struct { + value *KeysGenerateTSIGResult + isSet bool +} + +func (v NullableKeysGenerateTSIGResult) Get() *KeysGenerateTSIGResult { + return v.value +} + +func (v *NullableKeysGenerateTSIGResult) Set(val *KeysGenerateTSIGResult) { + v.value = val + v.isSet = true +} + +func (v NullableKeysGenerateTSIGResult) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysGenerateTSIGResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysGenerateTSIGResult(val *KeysGenerateTSIGResult) *NullableKeysGenerateTSIGResult { + return &NullableKeysGenerateTSIGResult{value: val, isSet: true} +} + +func (v NullableKeysGenerateTSIGResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysGenerateTSIGResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_list_kerberos_key_response.go b/keys/model_keys_list_kerberos_key_response.go new file mode 100644 index 0000000..5966a99 --- /dev/null +++ b/keys/model_keys_list_kerberos_key_response.go @@ -0,0 +1,125 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysListKerberosKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysListKerberosKeyResponse{} + +// KeysListKerberosKeyResponse The response format to retrieve __KerberosKey__ resources extracted from the uploaded keytab file. +type KeysListKerberosKeyResponse struct { + // The list of KerberosKey objects. + Results []KerberosKey `json:"results,omitempty"` +} + +// NewKeysListKerberosKeyResponse instantiates a new KeysListKerberosKeyResponse 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 NewKeysListKerberosKeyResponse() *KeysListKerberosKeyResponse { + this := KeysListKerberosKeyResponse{} + return &this +} + +// NewKeysListKerberosKeyResponseWithDefaults instantiates a new KeysListKerberosKeyResponse 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 NewKeysListKerberosKeyResponseWithDefaults() *KeysListKerberosKeyResponse { + this := KeysListKerberosKeyResponse{} + return &this +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *KeysListKerberosKeyResponse) GetResults() []KerberosKey { + if o == nil || IsNil(o.Results) { + var ret []KerberosKey + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysListKerberosKeyResponse) GetResultsOk() ([]KerberosKey, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *KeysListKerberosKeyResponse) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []KerberosKey and assigns it to the Results field. +func (o *KeysListKerberosKeyResponse) SetResults(v []KerberosKey) { + o.Results = v +} + +func (o KeysListKerberosKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysListKerberosKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + return toSerialize, nil +} + +type NullableKeysListKerberosKeyResponse struct { + value *KeysListKerberosKeyResponse + isSet bool +} + +func (v NullableKeysListKerberosKeyResponse) Get() *KeysListKerberosKeyResponse { + return v.value +} + +func (v *NullableKeysListKerberosKeyResponse) Set(val *KeysListKerberosKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysListKerberosKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysListKerberosKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysListKerberosKeyResponse(val *KeysListKerberosKeyResponse) *NullableKeysListKerberosKeyResponse { + return &NullableKeysListKerberosKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysListKerberosKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysListKerberosKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_list_tsig_key_response.go b/keys/model_keys_list_tsig_key_response.go new file mode 100644 index 0000000..2a6d699 --- /dev/null +++ b/keys/model_keys_list_tsig_key_response.go @@ -0,0 +1,125 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysListTSIGKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysListTSIGKeyResponse{} + +// KeysListTSIGKeyResponse The response format to retrieve __TSIGKey__ objects. +type KeysListTSIGKeyResponse struct { + // The list of TSIGKey objects. + Results []KeysTSIGKey `json:"results,omitempty"` +} + +// NewKeysListTSIGKeyResponse instantiates a new KeysListTSIGKeyResponse 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 NewKeysListTSIGKeyResponse() *KeysListTSIGKeyResponse { + this := KeysListTSIGKeyResponse{} + return &this +} + +// NewKeysListTSIGKeyResponseWithDefaults instantiates a new KeysListTSIGKeyResponse 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 NewKeysListTSIGKeyResponseWithDefaults() *KeysListTSIGKeyResponse { + this := KeysListTSIGKeyResponse{} + return &this +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *KeysListTSIGKeyResponse) GetResults() []KeysTSIGKey { + if o == nil || IsNil(o.Results) { + var ret []KeysTSIGKey + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysListTSIGKeyResponse) GetResultsOk() ([]KeysTSIGKey, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *KeysListTSIGKeyResponse) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []KeysTSIGKey and assigns it to the Results field. +func (o *KeysListTSIGKeyResponse) SetResults(v []KeysTSIGKey) { + o.Results = v +} + +func (o KeysListTSIGKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysListTSIGKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + return toSerialize, nil +} + +type NullableKeysListTSIGKeyResponse struct { + value *KeysListTSIGKeyResponse + isSet bool +} + +func (v NullableKeysListTSIGKeyResponse) Get() *KeysListTSIGKeyResponse { + return v.value +} + +func (v *NullableKeysListTSIGKeyResponse) Set(val *KeysListTSIGKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysListTSIGKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysListTSIGKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysListTSIGKeyResponse(val *KeysListTSIGKeyResponse) *NullableKeysListTSIGKeyResponse { + return &NullableKeysListTSIGKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysListTSIGKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysListTSIGKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_read_kerberos_key_response.go b/keys/model_keys_read_kerberos_key_response.go new file mode 100644 index 0000000..dce9578 --- /dev/null +++ b/keys/model_keys_read_kerberos_key_response.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysReadKerberosKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysReadKerberosKeyResponse{} + +// KeysReadKerberosKeyResponse The response format to retrieve the __KerberosKey__ resource extracted from the uploaded keytab file. +type KeysReadKerberosKeyResponse struct { + Result *KerberosKey `json:"result,omitempty"` +} + +// NewKeysReadKerberosKeyResponse instantiates a new KeysReadKerberosKeyResponse 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 NewKeysReadKerberosKeyResponse() *KeysReadKerberosKeyResponse { + this := KeysReadKerberosKeyResponse{} + return &this +} + +// NewKeysReadKerberosKeyResponseWithDefaults instantiates a new KeysReadKerberosKeyResponse 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 NewKeysReadKerberosKeyResponseWithDefaults() *KeysReadKerberosKeyResponse { + this := KeysReadKerberosKeyResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *KeysReadKerberosKeyResponse) GetResult() KerberosKey { + if o == nil || IsNil(o.Result) { + var ret KerberosKey + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysReadKerberosKeyResponse) GetResultOk() (*KerberosKey, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *KeysReadKerberosKeyResponse) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given KerberosKey and assigns it to the Result field. +func (o *KeysReadKerberosKeyResponse) SetResult(v KerberosKey) { + o.Result = &v +} + +func (o KeysReadKerberosKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysReadKerberosKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + return toSerialize, nil +} + +type NullableKeysReadKerberosKeyResponse struct { + value *KeysReadKerberosKeyResponse + isSet bool +} + +func (v NullableKeysReadKerberosKeyResponse) Get() *KeysReadKerberosKeyResponse { + return v.value +} + +func (v *NullableKeysReadKerberosKeyResponse) Set(val *KeysReadKerberosKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysReadKerberosKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysReadKerberosKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysReadKerberosKeyResponse(val *KeysReadKerberosKeyResponse) *NullableKeysReadKerberosKeyResponse { + return &NullableKeysReadKerberosKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysReadKerberosKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysReadKerberosKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_read_tsig_key_response.go b/keys/model_keys_read_tsig_key_response.go new file mode 100644 index 0000000..fdc725c --- /dev/null +++ b/keys/model_keys_read_tsig_key_response.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysReadTSIGKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysReadTSIGKeyResponse{} + +// KeysReadTSIGKeyResponse The response format to retrieve the __TSIGKey__ object. +type KeysReadTSIGKeyResponse struct { + Result *KeysTSIGKey `json:"result,omitempty"` +} + +// NewKeysReadTSIGKeyResponse instantiates a new KeysReadTSIGKeyResponse 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 NewKeysReadTSIGKeyResponse() *KeysReadTSIGKeyResponse { + this := KeysReadTSIGKeyResponse{} + return &this +} + +// NewKeysReadTSIGKeyResponseWithDefaults instantiates a new KeysReadTSIGKeyResponse 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 NewKeysReadTSIGKeyResponseWithDefaults() *KeysReadTSIGKeyResponse { + this := KeysReadTSIGKeyResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *KeysReadTSIGKeyResponse) GetResult() KeysTSIGKey { + if o == nil || IsNil(o.Result) { + var ret KeysTSIGKey + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysReadTSIGKeyResponse) GetResultOk() (*KeysTSIGKey, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *KeysReadTSIGKeyResponse) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given KeysTSIGKey and assigns it to the Result field. +func (o *KeysReadTSIGKeyResponse) SetResult(v KeysTSIGKey) { + o.Result = &v +} + +func (o KeysReadTSIGKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysReadTSIGKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + return toSerialize, nil +} + +type NullableKeysReadTSIGKeyResponse struct { + value *KeysReadTSIGKeyResponse + isSet bool +} + +func (v NullableKeysReadTSIGKeyResponse) Get() *KeysReadTSIGKeyResponse { + return v.value +} + +func (v *NullableKeysReadTSIGKeyResponse) Set(val *KeysReadTSIGKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysReadTSIGKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysReadTSIGKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysReadTSIGKeyResponse(val *KeysReadTSIGKeyResponse) *NullableKeysReadTSIGKeyResponse { + return &NullableKeysReadTSIGKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysReadTSIGKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysReadTSIGKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_tsig_key.go b/keys/model_keys_tsig_key.go new file mode 100644 index 0000000..9ebb444 --- /dev/null +++ b/keys/model_keys_tsig_key.go @@ -0,0 +1,404 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" + "time" +) + +// checks if the KeysTSIGKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysTSIGKey{} + +// KeysTSIGKey A __TSIGKey__ object (_keys/tsig_) represents a TSIG key. +type KeysTSIGKey struct { + // The TSIG key algorithm. Valid values are: * _hmac_sha1_ * _hmac_sha224_ * _hmac_sha256_ * _hmac_sha384_ * _hmac_sha512_ Defaults to _hmac_sha256_. + Algorithm *string `json:"algorithm,omitempty"` + // The description for the TSIG key. May contain 0 to 1024 characters. Can include UTF-8. + Comment *string `json:"comment,omitempty"` + // Time when the object has been created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // The resource identifier. + Id *string `json:"id,omitempty"` + // The TSIG key name in the absolute domain name format. + Name string `json:"name"` + // The TSIG key name supplied during a create/update operation that is converted to canonical form in punycode. + ProtocolName *string `json:"protocol_name,omitempty"` + // The TSIG key secret as a Base64 encoded string. + Secret string `json:"secret"` + // The tags for the TSIG key in JSON format. + Tags map[string]interface{} `json:"tags,omitempty"` + // Time when the object has been updated. Equals to _created_at_ if not updated after creation. + UpdatedAt *time.Time `json:"updated_at,omitempty"` +} + +// NewKeysTSIGKey instantiates a new KeysTSIGKey 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 NewKeysTSIGKey(name string, secret string) *KeysTSIGKey { + this := KeysTSIGKey{} + this.Name = name + this.Secret = secret + return &this +} + +// NewKeysTSIGKeyWithDefaults instantiates a new KeysTSIGKey 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 NewKeysTSIGKeyWithDefaults() *KeysTSIGKey { + this := KeysTSIGKey{} + return &this +} + +// GetAlgorithm returns the Algorithm field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetAlgorithm() string { + if o == nil || IsNil(o.Algorithm) { + var ret string + return ret + } + return *o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetAlgorithmOk() (*string, bool) { + if o == nil || IsNil(o.Algorithm) { + return nil, false + } + return o.Algorithm, true +} + +// HasAlgorithm returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasAlgorithm() bool { + if o != nil && !IsNil(o.Algorithm) { + return true + } + + return false +} + +// SetAlgorithm gets a reference to the given string and assigns it to the Algorithm field. +func (o *KeysTSIGKey) SetAlgorithm(v string) { + o.Algorithm = &v +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *KeysTSIGKey) SetComment(v string) { + o.Comment = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *KeysTSIGKey) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *KeysTSIGKey) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *KeysTSIGKey) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KeysTSIGKey) SetName(v string) { + o.Name = v +} + +// GetProtocolName returns the ProtocolName field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetProtocolName() string { + if o == nil || IsNil(o.ProtocolName) { + var ret string + return ret + } + return *o.ProtocolName +} + +// GetProtocolNameOk returns a tuple with the ProtocolName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetProtocolNameOk() (*string, bool) { + if o == nil || IsNil(o.ProtocolName) { + return nil, false + } + return o.ProtocolName, true +} + +// HasProtocolName returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasProtocolName() bool { + if o != nil && !IsNil(o.ProtocolName) { + return true + } + + return false +} + +// SetProtocolName gets a reference to the given string and assigns it to the ProtocolName field. +func (o *KeysTSIGKey) SetProtocolName(v string) { + o.ProtocolName = &v +} + +// GetSecret returns the Secret field value +func (o *KeysTSIGKey) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *KeysTSIGKey) SetSecret(v string) { + o.Secret = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetTags() map[string]interface{} { + if o == nil || IsNil(o.Tags) { + var ret map[string]interface{} + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetTagsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Tags) { + return map[string]interface{}{}, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]interface{} and assigns it to the Tags field. +func (o *KeysTSIGKey) SetTags(v map[string]interface{}) { + o.Tags = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *KeysTSIGKey) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysTSIGKey) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *KeysTSIGKey) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *KeysTSIGKey) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o KeysTSIGKey) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysTSIGKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Algorithm) { + toSerialize["algorithm"] = o.Algorithm + } + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["name"] = o.Name + if !IsNil(o.ProtocolName) { + toSerialize["protocol_name"] = o.ProtocolName + } + toSerialize["secret"] = o.Secret + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableKeysTSIGKey struct { + value *KeysTSIGKey + isSet bool +} + +func (v NullableKeysTSIGKey) Get() *KeysTSIGKey { + return v.value +} + +func (v *NullableKeysTSIGKey) Set(val *KeysTSIGKey) { + v.value = val + v.isSet = true +} + +func (v NullableKeysTSIGKey) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysTSIGKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysTSIGKey(val *KeysTSIGKey) *NullableKeysTSIGKey { + return &NullableKeysTSIGKey{value: val, isSet: true} +} + +func (v NullableKeysTSIGKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysTSIGKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_update_kerberos_key_response.go b/keys/model_keys_update_kerberos_key_response.go new file mode 100644 index 0000000..9e83ae5 --- /dev/null +++ b/keys/model_keys_update_kerberos_key_response.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysUpdateKerberosKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysUpdateKerberosKeyResponse{} + +// KeysUpdateKerberosKeyResponse The response format to update __KerberosKey__ resource extracted from the uploaded keytab file. +type KeysUpdateKerberosKeyResponse struct { + Result *KerberosKey `json:"result,omitempty"` +} + +// NewKeysUpdateKerberosKeyResponse instantiates a new KeysUpdateKerberosKeyResponse 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 NewKeysUpdateKerberosKeyResponse() *KeysUpdateKerberosKeyResponse { + this := KeysUpdateKerberosKeyResponse{} + return &this +} + +// NewKeysUpdateKerberosKeyResponseWithDefaults instantiates a new KeysUpdateKerberosKeyResponse 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 NewKeysUpdateKerberosKeyResponseWithDefaults() *KeysUpdateKerberosKeyResponse { + this := KeysUpdateKerberosKeyResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *KeysUpdateKerberosKeyResponse) GetResult() KerberosKey { + if o == nil || IsNil(o.Result) { + var ret KerberosKey + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysUpdateKerberosKeyResponse) GetResultOk() (*KerberosKey, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *KeysUpdateKerberosKeyResponse) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given KerberosKey and assigns it to the Result field. +func (o *KeysUpdateKerberosKeyResponse) SetResult(v KerberosKey) { + o.Result = &v +} + +func (o KeysUpdateKerberosKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysUpdateKerberosKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + return toSerialize, nil +} + +type NullableKeysUpdateKerberosKeyResponse struct { + value *KeysUpdateKerberosKeyResponse + isSet bool +} + +func (v NullableKeysUpdateKerberosKeyResponse) Get() *KeysUpdateKerberosKeyResponse { + return v.value +} + +func (v *NullableKeysUpdateKerberosKeyResponse) Set(val *KeysUpdateKerberosKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysUpdateKerberosKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysUpdateKerberosKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysUpdateKerberosKeyResponse(val *KeysUpdateKerberosKeyResponse) *NullableKeysUpdateKerberosKeyResponse { + return &NullableKeysUpdateKerberosKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysUpdateKerberosKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysUpdateKerberosKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_keys_update_tsig_key_response.go b/keys/model_keys_update_tsig_key_response.go new file mode 100644 index 0000000..dc1acd7 --- /dev/null +++ b/keys/model_keys_update_tsig_key_response.go @@ -0,0 +1,124 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the KeysUpdateTSIGKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeysUpdateTSIGKeyResponse{} + +// KeysUpdateTSIGKeyResponse The response format to update __TSIGKey__ object. +type KeysUpdateTSIGKeyResponse struct { + Result *KeysTSIGKey `json:"result,omitempty"` +} + +// NewKeysUpdateTSIGKeyResponse instantiates a new KeysUpdateTSIGKeyResponse 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 NewKeysUpdateTSIGKeyResponse() *KeysUpdateTSIGKeyResponse { + this := KeysUpdateTSIGKeyResponse{} + return &this +} + +// NewKeysUpdateTSIGKeyResponseWithDefaults instantiates a new KeysUpdateTSIGKeyResponse 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 NewKeysUpdateTSIGKeyResponseWithDefaults() *KeysUpdateTSIGKeyResponse { + this := KeysUpdateTSIGKeyResponse{} + return &this +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *KeysUpdateTSIGKeyResponse) GetResult() KeysTSIGKey { + if o == nil || IsNil(o.Result) { + var ret KeysTSIGKey + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KeysUpdateTSIGKeyResponse) GetResultOk() (*KeysTSIGKey, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *KeysUpdateTSIGKeyResponse) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given KeysTSIGKey and assigns it to the Result field. +func (o *KeysUpdateTSIGKeyResponse) SetResult(v KeysTSIGKey) { + o.Result = &v +} + +func (o KeysUpdateTSIGKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeysUpdateTSIGKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + return toSerialize, nil +} + +type NullableKeysUpdateTSIGKeyResponse struct { + value *KeysUpdateTSIGKeyResponse + isSet bool +} + +func (v NullableKeysUpdateTSIGKeyResponse) Get() *KeysUpdateTSIGKeyResponse { + return v.value +} + +func (v *NullableKeysUpdateTSIGKeyResponse) Set(val *KeysUpdateTSIGKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeysUpdateTSIGKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeysUpdateTSIGKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeysUpdateTSIGKeyResponse(val *KeysUpdateTSIGKeyResponse) *NullableKeysUpdateTSIGKeyResponse { + return &NullableKeysUpdateTSIGKeyResponse{value: val, isSet: true} +} + +func (v NullableKeysUpdateTSIGKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeysUpdateTSIGKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_protobuf_field_mask.go b/keys/model_protobuf_field_mask.go new file mode 100644 index 0000000..c76ddb4 --- /dev/null +++ b/keys/model_protobuf_field_mask.go @@ -0,0 +1,125 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the ProtobufFieldMask type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProtobufFieldMask{} + +// ProtobufFieldMask paths: \"f.a\" paths: \"f.b.d\" Here `f` represents a field in some root message, `a` and `b` fields in the message found in `f`, and `d` a field found in the message in `f.b`. Field masks are used to specify a subset of fields that should be returned by a get operation or modified by an update operation. Field masks also have a custom JSON encoding (see below). # Field Masks in Projections When used in the context of a projection, a response message or sub-message is filtered by the API to only contain those fields as specified in the mask. For example, if the mask in the previous example is applied to a response message as follows: f { a : 22 b { d : 1 x : 2 } y : 13 } z: 8 The result will not contain specific values for fields x,y and z (their value will be set to the default, and omitted in proto text output): f { a : 22 b { d : 1 } } A repeated field is not allowed except at the last position of a paths string. If a FieldMask object is not present in a get operation, the operation applies to all fields (as if a FieldMask of all fields had been specified). Note that a field mask does not necessarily apply to the top-level response message. In case of a REST get operation, the field mask applies directly to the response, but in case of a REST list operation, the mask instead applies to each individual message in the returned resource list. In case of a REST custom method, other definitions may be used. Where the mask applies will be clearly documented together with its declaration in the API. In any case, the effect on the returned resource/resources is required behavior for APIs. # Field Masks in Update Operations A field mask in update operations specifies which fields of the targeted resource are going to be updated. The API is required to only change the values of the fields as specified in the mask and leave the others untouched. If a resource is passed in to describe the updated values, the API ignores the values of all fields not covered by the mask. If a repeated field is specified for an update operation, the existing repeated values in the target resource will be overwritten by the new values. Note that a repeated field is only allowed in the last position of a `paths` string. If a sub-message is specified in the last position of the field mask for an update operation, then the existing sub-message in the target resource is overwritten. Given the target message: f { b { d : 1 x : 2 } c : 1 } And an update message: f { b { d : 10 } } then if the field mask is: paths: \"f.b\" then the result will be: f { b { d : 10 } c : 1 } However, if the update mask was: paths: \"f.b.d\" then the result would be: f { b { d : 10 x : 2 } c : 1 } In order to reset a field's value to the default, the field must be in the mask and set to the default value in the provided resource. Hence, in order to reset all fields of a resource, provide a default instance of the resource and set all fields in the mask, or do not provide a mask as described below. If a field mask is not present on update, the operation applies to all fields (as if a field mask of all fields has been specified). Note that in the presence of schema evolution, this may mean that fields the client does not know and has therefore not filled into the request will be reset to their default. If this is unwanted behavior, a specific service may require a client to always specify a field mask, producing an error if not. As with get operations, the location of the resource which describes the updated values in the request message depends on the operation kind. In any case, the effect of the field mask is required to be honored by the API. ## Considerations for HTTP REST The HTTP kind of an update operation which uses a field mask must be set to PATCH instead of PUT in order to satisfy HTTP semantics (PUT must only be used for full updates). # JSON Encoding of Field Masks In JSON, a field mask is encoded as a single string where paths are separated by a comma. Fields name in each path are converted to/from lower-camel naming conventions. As an example, consider the following message declarations: message Profile { User user = 1; Photo photo = 2; } message User { string display_name = 1; string address = 2; } In proto a field mask for `Profile` may look as such: mask { paths: \"user.display_name\" paths: \"photo\" } In JSON, the same mask is represented as below: { mask: \"user.displayName,photo\" } # Field Masks and Oneof Fields Field masks treat fields in oneofs just as regular fields. Consider the following message: message SampleMessage { oneof test_oneof { string name = 4; SubMessage sub_message = 9; } } The field mask can be: mask { paths: \"name\" } Or: mask { paths: \"sub_message\" } Note that oneof type names (\"test_oneof\" in this case) cannot be used in paths. ## Field Mask Verification The implementation of the all the API methods, which have any FieldMask type field in the request, should verify the included field paths, and return `INVALID_ARGUMENT` error if any path is duplicated or unmappable. +type ProtobufFieldMask struct { + // The set of field mask paths. + Paths []string `json:"paths,omitempty"` +} + +// NewProtobufFieldMask instantiates a new ProtobufFieldMask 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 NewProtobufFieldMask() *ProtobufFieldMask { + this := ProtobufFieldMask{} + return &this +} + +// NewProtobufFieldMaskWithDefaults instantiates a new ProtobufFieldMask 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 NewProtobufFieldMaskWithDefaults() *ProtobufFieldMask { + this := ProtobufFieldMask{} + return &this +} + +// GetPaths returns the Paths field value if set, zero value otherwise. +func (o *ProtobufFieldMask) GetPaths() []string { + if o == nil || IsNil(o.Paths) { + var ret []string + return ret + } + return o.Paths +} + +// GetPathsOk returns a tuple with the Paths field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtobufFieldMask) GetPathsOk() ([]string, bool) { + if o == nil || IsNil(o.Paths) { + return nil, false + } + return o.Paths, true +} + +// HasPaths returns a boolean if a field has been set. +func (o *ProtobufFieldMask) HasPaths() bool { + if o != nil && !IsNil(o.Paths) { + return true + } + + return false +} + +// SetPaths gets a reference to the given []string and assigns it to the Paths field. +func (o *ProtobufFieldMask) SetPaths(v []string) { + o.Paths = v +} + +func (o ProtobufFieldMask) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProtobufFieldMask) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Paths) { + toSerialize["paths"] = o.Paths + } + return toSerialize, nil +} + +type NullableProtobufFieldMask struct { + value *ProtobufFieldMask + isSet bool +} + +func (v NullableProtobufFieldMask) Get() *ProtobufFieldMask { + return v.value +} + +func (v *NullableProtobufFieldMask) Set(val *ProtobufFieldMask) { + v.value = val + v.isSet = true +} + +func (v NullableProtobufFieldMask) IsSet() bool { + return v.isSet +} + +func (v *NullableProtobufFieldMask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtobufFieldMask(val *ProtobufFieldMask) *NullableProtobufFieldMask { + return &NullableProtobufFieldMask{value: val, isSet: true} +} + +func (v NullableProtobufFieldMask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtobufFieldMask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_upload_content_type.go b/keys/model_upload_content_type.go new file mode 100644 index 0000000..dbdf50c --- /dev/null +++ b/keys/model_upload_content_type.go @@ -0,0 +1,110 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" + "fmt" +) + +// UploadContentType - UNKNOWN: Unknown type. - KEYTAB: Keytab file containing Kerberos keys. +type UploadContentType string + +// List of uploadContentType +const ( + UPLOADCONTENTTYPE_UNKNOWN UploadContentType = "UNKNOWN" + UPLOADCONTENTTYPE_KEYTAB UploadContentType = "KEYTAB" +) + +// All allowed values of UploadContentType enum +var AllowedUploadContentTypeEnumValues = []UploadContentType{ + "UNKNOWN", + "KEYTAB", +} + +func (v *UploadContentType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UploadContentType(value) + for _, existing := range AllowedUploadContentTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UploadContentType", value) +} + +// NewUploadContentTypeFromValue returns a pointer to a valid UploadContentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUploadContentTypeFromValue(v string) (*UploadContentType, error) { + ev := UploadContentType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UploadContentType: valid values are %v", v, AllowedUploadContentTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UploadContentType) IsValid() bool { + for _, existing := range AllowedUploadContentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to uploadContentType value +func (v UploadContentType) Ptr() *UploadContentType { + return &v +} + +type NullableUploadContentType struct { + value *UploadContentType + isSet bool +} + +func (v NullableUploadContentType) Get() *UploadContentType { + return v.value +} + +func (v *NullableUploadContentType) Set(val *UploadContentType) { + v.value = val + v.isSet = true +} + +func (v NullableUploadContentType) IsSet() bool { + return v.isSet +} + +func (v *NullableUploadContentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUploadContentType(val *UploadContentType) *NullableUploadContentType { + return &NullableUploadContentType{value: val, isSet: true} +} + +func (v NullableUploadContentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUploadContentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/model_upload_request.go b/keys/model_upload_request.go new file mode 100644 index 0000000..bb985e6 --- /dev/null +++ b/keys/model_upload_request.go @@ -0,0 +1,255 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" +) + +// checks if the UploadRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UploadRequest{} + +// UploadRequest The request format for uploading content. +type UploadRequest struct { + // The description for uploaded content. May contain 0 to 1024 characters. Can include UTF-8. + Comment *string `json:"comment,omitempty"` + // Base64 encoded content. + Content string `json:"content"` + Fields *ProtobufFieldMask `json:"fields,omitempty"` + // The tags for uploaded content in JSON format. + Tags map[string]interface{} `json:"tags,omitempty"` + Type UploadContentType `json:"type"` +} + +// NewUploadRequest instantiates a new UploadRequest 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 NewUploadRequest(content string, type_ UploadContentType) *UploadRequest { + this := UploadRequest{} + this.Content = content + this.Type = type_ + return &this +} + +// NewUploadRequestWithDefaults instantiates a new UploadRequest 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 NewUploadRequestWithDefaults() *UploadRequest { + this := UploadRequest{} + var type_ UploadContentType = UPLOADCONTENTTYPE_UNKNOWN + this.Type = type_ + return &this +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *UploadRequest) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UploadRequest) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *UploadRequest) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *UploadRequest) SetComment(v string) { + o.Comment = &v +} + +// GetContent returns the Content field value +func (o *UploadRequest) GetContent() string { + if o == nil { + var ret string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *UploadRequest) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *UploadRequest) SetContent(v string) { + o.Content = v +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *UploadRequest) GetFields() ProtobufFieldMask { + if o == nil || IsNil(o.Fields) { + var ret ProtobufFieldMask + return ret + } + return *o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UploadRequest) GetFieldsOk() (*ProtobufFieldMask, bool) { + if o == nil || IsNil(o.Fields) { + return nil, false + } + return o.Fields, true +} + +// HasFields returns a boolean if a field has been set. +func (o *UploadRequest) HasFields() bool { + if o != nil && !IsNil(o.Fields) { + return true + } + + return false +} + +// SetFields gets a reference to the given ProtobufFieldMask and assigns it to the Fields field. +func (o *UploadRequest) SetFields(v ProtobufFieldMask) { + o.Fields = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *UploadRequest) GetTags() map[string]interface{} { + if o == nil || IsNil(o.Tags) { + var ret map[string]interface{} + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UploadRequest) GetTagsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Tags) { + return map[string]interface{}{}, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *UploadRequest) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given map[string]interface{} and assigns it to the Tags field. +func (o *UploadRequest) SetTags(v map[string]interface{}) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *UploadRequest) GetType() UploadContentType { + if o == nil { + var ret UploadContentType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *UploadRequest) GetTypeOk() (*UploadContentType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *UploadRequest) SetType(v UploadContentType) { + o.Type = v +} + +func (o UploadRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UploadRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + toSerialize["content"] = o.Content + if !IsNil(o.Fields) { + toSerialize["fields"] = o.Fields + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableUploadRequest struct { + value *UploadRequest + isSet bool +} + +func (v NullableUploadRequest) Get() *UploadRequest { + return v.value +} + +func (v *NullableUploadRequest) Set(val *UploadRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUploadRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUploadRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUploadRequest(val *UploadRequest) *NullableUploadRequest { + return &NullableUploadRequest{value: val, isSet: true} +} + +func (v NullableUploadRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUploadRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/keys/test/api_generate_tsig_test.go b/keys/test/api_generate_tsig_test.go new file mode 100644 index 0000000..3ea00f9 --- /dev/null +++ b/keys/test/api_generate_tsig_test.go @@ -0,0 +1,40 @@ +/* +DDI Keys API + +Testing GenerateTsigAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package keys + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/infobloxopen/bloxone-go-client/internal" + openapiclient "github.com/infobloxopen/bloxone-go-client/keys" +) + +func Test_keys_GenerateTsigAPIService(t *testing.T) { + + configuration := internal.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test GenerateTsigAPIService GenerateTsigGenerateTSIG", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.GenerateTsigAPI.GenerateTsigGenerateTSIG(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/keys/test/api_kerberos_test.go b/keys/test/api_kerberos_test.go new file mode 100644 index 0000000..21283c8 --- /dev/null +++ b/keys/test/api_kerberos_test.go @@ -0,0 +1,81 @@ +/* +DDI Keys API + +Testing KerberosAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package keys + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/infobloxopen/bloxone-go-client/internal" + openapiclient "github.com/infobloxopen/bloxone-go-client/keys" +) + +func Test_keys_KerberosAPIService(t *testing.T) { + + configuration := internal.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test KerberosAPIService KerberosDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.KerberosAPI.KerberosDelete(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test KerberosAPIService KerberosList", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.KerberosAPI.KerberosList(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test KerberosAPIService KerberosRead", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.KerberosAPI.KerberosRead(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test KerberosAPIService KerberosUpdate", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.KerberosAPI.KerberosUpdate(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/keys/test/api_tsig_test.go b/keys/test/api_tsig_test.go new file mode 100644 index 0000000..c11a32a --- /dev/null +++ b/keys/test/api_tsig_test.go @@ -0,0 +1,93 @@ +/* +DDI Keys API + +Testing TsigAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package keys + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/infobloxopen/bloxone-go-client/internal" + openapiclient "github.com/infobloxopen/bloxone-go-client/keys" +) + +func Test_keys_TsigAPIService(t *testing.T) { + + configuration := internal.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test TsigAPIService TsigCreate", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.TsigAPI.TsigCreate(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TsigAPIService TsigDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.TsigAPI.TsigDelete(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TsigAPIService TsigList", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.TsigAPI.TsigList(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TsigAPIService TsigRead", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.TsigAPI.TsigRead(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TsigAPIService TsigUpdate", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.TsigAPI.TsigUpdate(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/keys/test/api_upload_test.go b/keys/test/api_upload_test.go new file mode 100644 index 0000000..f2cd257 --- /dev/null +++ b/keys/test/api_upload_test.go @@ -0,0 +1,40 @@ +/* +DDI Keys API + +Testing UploadAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package keys + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/infobloxopen/bloxone-go-client/internal" + openapiclient "github.com/infobloxopen/bloxone-go-client/keys" +) + +func Test_keys_UploadAPIService(t *testing.T) { + + configuration := internal.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UploadAPIService UploadUpload", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UploadAPI.UploadUpload(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/keys/utils.go b/keys/utils.go new file mode 100644 index 0000000..54647cd --- /dev/null +++ b/keys/utils.go @@ -0,0 +1,347 @@ +/* +DDI Keys API + +The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network. + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package keys + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} From af0e0f8ebc11cf7f852e56292bdb37c7c59ea71a Mon Sep 17 00:00:00 2001 From: Ashish Mathew Date: Thu, 4 Jan 2024 21:47:54 -0800 Subject: [PATCH 2/3] fixes for infra/service --- infra_mgmt/README.md | 4 +- infra_mgmt/api_detail.go | 88 ++++++++++++------------ infra_mgmt/docs/DetailAPI.md | 32 ++++----- infra_mgmt/docs/InfraDetailService.md | 52 -------------- infra_mgmt/docs/InfraHost.md | 14 ++-- infra_mgmt/model_infra_detail_service.go | 74 -------------------- 6 files changed, 69 insertions(+), 195 deletions(-) diff --git a/infra_mgmt/README.md b/infra_mgmt/README.md index 4d5b24e..7a82978 100644 --- a/infra_mgmt/README.md +++ b/infra_mgmt/README.md @@ -126,8 +126,8 @@ All URIs are relative to *http://csp.infoblox.com/api/infra/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DetailAPI* | [**DetailList**](docs/DetailAPI.md#detaillist) | **Get** /detail_hosts | List all the Hosts along with its associated Services (applications). -*DetailAPI* | [**DetailList_0**](docs/DetailAPI.md#detaillist_0) | **Get** /detail_services | List all the Services (applications) along with its associated Hosts. +*DetailAPI* | [**DetailHostsList**](docs/DetailAPI.md#detailhostslist) | **Get** /detail_hosts | List all the Hosts along with its associated Services (applications). +*DetailAPI* | [**DetailServicesList**](docs/DetailAPI.md#detailserviceslist) | **Get** /detail_services | List all the Services (applications) along with its associated Hosts. *HostsAPI* | [**HostsAssignTags**](docs/HostsAPI.md#hostsassigntags) | **Post** /hosts/assign_tags | Assign tags for list of hosts. *HostsAPI* | [**HostsCreate**](docs/HostsAPI.md#hostscreate) | **Post** /hosts | Create a Host resource. *HostsAPI* | [**HostsDelete**](docs/HostsAPI.md#hostsdelete) | **Delete** /hosts/{id} | Delete a Host resource. diff --git a/infra_mgmt/api_detail.go b/infra_mgmt/api_detail.go index 9d857b5..cb3d549 100644 --- a/infra_mgmt/api_detail.go +++ b/infra_mgmt/api_detail.go @@ -23,34 +23,34 @@ import ( type DetailAPI interface { /* - DetailList List all the Hosts along with its associated Services (applications). + DetailHostsList List all the Hosts along with its associated Services (applications). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiDetailListRequest + @return ApiDetailHostsListRequest */ - DetailList(ctx context.Context) ApiDetailListRequest + DetailHostsList(ctx context.Context) ApiDetailHostsListRequest - // DetailListExecute executes the request + // DetailHostsListExecute executes the request // @return InfraListDetailHostsResponse - DetailListExecute(r ApiDetailListRequest) (*InfraListDetailHostsResponse, *http.Response, error) + DetailHostsListExecute(r ApiDetailHostsListRequest) (*InfraListDetailHostsResponse, *http.Response, error) /* - DetailList_0 List all the Services (applications) along with its associated Hosts. + DetailServicesList List all the Services (applications) along with its associated Hosts. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiDetailList_0Request + @return ApiDetailServicesListRequest */ - DetailList_1(ctx context.Context) ApiDetailList_0Request + DetailServicesList(ctx context.Context) ApiDetailServicesListRequest - // DetailList_1Execute executes the request + // DetailServicesListExecute executes the request // @return InfraListDetailServicesResponse - DetailList_1Execute(r ApiDetailList_0Request) (*InfraListDetailServicesResponse, *http.Response, error) + DetailServicesListExecute(r ApiDetailServicesListRequest) (*InfraListDetailServicesResponse, *http.Response, error) } // DetailAPIService DetailAPI service type DetailAPIService internal.Service -type ApiDetailListRequest struct { +type ApiDetailHostsListRequest struct { ctx context.Context ApiService DetailAPI filter *string @@ -64,65 +64,65 @@ type ApiDetailListRequest struct { } // A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | -func (r ApiDetailListRequest) Filter(filter string) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) Filter(filter string) ApiDetailHostsListRequest { r.filter = &filter return r } // A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. -func (r ApiDetailListRequest) OrderBy(orderBy string) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) OrderBy(orderBy string) ApiDetailHostsListRequest { r.orderBy = &orderBy return r } // The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. -func (r ApiDetailListRequest) Offset(offset int32) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) Offset(offset int32) ApiDetailHostsListRequest { r.offset = &offset return r } // The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. -func (r ApiDetailListRequest) Limit(limit int32) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) Limit(limit int32) ApiDetailHostsListRequest { r.limit = &limit return r } // The service-defined string used to identify a page of resources. A null value indicates the first page. -func (r ApiDetailListRequest) PageToken(pageToken string) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) PageToken(pageToken string) ApiDetailHostsListRequest { r.pageToken = &pageToken return r } // A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. -func (r ApiDetailListRequest) Fields(fields string) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) Fields(fields string) ApiDetailHostsListRequest { r.fields = &fields return r } // This parameter is used for filtering by tags. -func (r ApiDetailListRequest) Tfilter(tfilter string) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) Tfilter(tfilter string) ApiDetailHostsListRequest { r.tfilter = &tfilter return r } // This parameter is used for sorting by tags. -func (r ApiDetailListRequest) TorderBy(torderBy string) ApiDetailListRequest { +func (r ApiDetailHostsListRequest) TorderBy(torderBy string) ApiDetailHostsListRequest { r.torderBy = &torderBy return r } -func (r ApiDetailListRequest) Execute() (*InfraListDetailHostsResponse, *http.Response, error) { - return r.ApiService.DetailListExecute(r) +func (r ApiDetailHostsListRequest) Execute() (*InfraListDetailHostsResponse, *http.Response, error) { + return r.ApiService.DetailHostsListExecute(r) } /* -DetailList List all the Hosts along with its associated Services (applications). +DetailHostsList List all the Hosts along with its associated Services (applications). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiDetailListRequest + @return ApiDetailHostsListRequest */ -func (a *DetailAPIService) DetailList(ctx context.Context) ApiDetailListRequest { - return ApiDetailListRequest{ +func (a *DetailAPIService) DetailHostsList(ctx context.Context) ApiDetailHostsListRequest { + return ApiDetailHostsListRequest{ ApiService: a, ctx: ctx, } @@ -131,7 +131,7 @@ func (a *DetailAPIService) DetailList(ctx context.Context) ApiDetailListRequest // Execute executes the request // // @return InfraListDetailHostsResponse -func (a *DetailAPIService) DetailListExecute(r ApiDetailListRequest) (*InfraListDetailHostsResponse, *http.Response, error) { +func (a *DetailAPIService) DetailHostsListExecute(r ApiDetailHostsListRequest) (*InfraListDetailHostsResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -139,7 +139,7 @@ func (a *DetailAPIService) DetailListExecute(r ApiDetailListRequest) (*InfraList localVarReturnValue *InfraListDetailHostsResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "DetailAPIService.DetailList") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "DetailAPIService.DetailHostsList") if err != nil { return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) } @@ -236,7 +236,7 @@ func (a *DetailAPIService) DetailListExecute(r ApiDetailListRequest) (*InfraList return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDetailList_0Request struct { +type ApiDetailServicesListRequest struct { ctx context.Context ApiService DetailAPI filter *string @@ -250,65 +250,65 @@ type ApiDetailList_0Request struct { } // A collection of response resources can be filtered by a logical expression string that includes JSON tag references to values in each resource, literal values, and logical operators. If a resource does not have the specified tag, its value is assumed to be null. Literal values include numbers (integer and floating-point), and quoted (both single- or double-quoted) literal strings, and 'null'. The following operators are commonly used in filter expressions: | Op | Description | | -- | ----------- | | == | Equal | | != | Not Equal | | > | Greater Than | | >= | Greater Than or Equal To | | < | Less Than | | <= | Less Than or Equal To | | and | Logical AND | | ~ | Matches Regex | | !~ | Does Not Match Regex | | or | Logical OR | | not | Logical NOT | | () | Groupping Operators | -func (r ApiDetailList_0Request) Filter(filter string) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) Filter(filter string) ApiDetailServicesListRequest { r.filter = &filter return r } // A collection of response resources can be sorted by their JSON tags. For a 'flat' resource, the tag name is straightforward. If sorting is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, its value is assumed to be null.) Specify this parameter as a comma-separated list of JSON tag names. The sort direction can be specified by a suffix separated by whitespace before the tag name. The suffix 'asc' sorts the data in ascending order. The suffix 'desc' sorts the data in descending order. If no suffix is specified the data is sorted in ascending order. -func (r ApiDetailList_0Request) OrderBy(orderBy string) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) OrderBy(orderBy string) ApiDetailServicesListRequest { r.orderBy = &orderBy return r } // The integer index (zero-origin) of the offset into a collection of resources. If omitted or null the value is assumed to be '0'. -func (r ApiDetailList_0Request) Offset(offset int32) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) Offset(offset int32) ApiDetailServicesListRequest { r.offset = &offset return r } // The integer number of resources to be returned in the response. The service may impose maximum value. If omitted the service may impose a default value. -func (r ApiDetailList_0Request) Limit(limit int32) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) Limit(limit int32) ApiDetailServicesListRequest { r.limit = &limit return r } // The service-defined string used to identify a page of resources. A null value indicates the first page. -func (r ApiDetailList_0Request) PageToken(pageToken string) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) PageToken(pageToken string) ApiDetailServicesListRequest { r.pageToken = &pageToken return r } // A collection of response resources can be transformed by specifying a set of JSON tags to be returned. For a “flat” resource, the tag name is straightforward. If field selection is allowed on non-flat hierarchical resources, the service should implement a qualified naming scheme such as dot-qualification to reference data down the hierarchy. If a resource does not have the specified tag, the tag does not appear in the output resource. Specify this parameter as a comma-separated list of JSON tag names. -func (r ApiDetailList_0Request) Fields(fields string) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) Fields(fields string) ApiDetailServicesListRequest { r.fields = &fields return r } // This parameter is used for filtering by tags. -func (r ApiDetailList_0Request) Tfilter(tfilter string) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) Tfilter(tfilter string) ApiDetailServicesListRequest { r.tfilter = &tfilter return r } // This parameter is used for sorting by tags. -func (r ApiDetailList_0Request) TorderBy(torderBy string) ApiDetailList_0Request { +func (r ApiDetailServicesListRequest) TorderBy(torderBy string) ApiDetailServicesListRequest { r.torderBy = &torderBy return r } -func (r ApiDetailList_0Request) Execute() (*InfraListDetailServicesResponse, *http.Response, error) { - return r.ApiService.DetailList_1Execute(r) +func (r ApiDetailServicesListRequest) Execute() (*InfraListDetailServicesResponse, *http.Response, error) { + return r.ApiService.DetailServicesListExecute(r) } /* -DetailList_0 List all the Services (applications) along with its associated Hosts. +DetailServicesList List all the Services (applications) along with its associated Hosts. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiDetailList_0Request + @return ApiDetailServicesListRequest */ -func (a *DetailAPIService) DetailList_1(ctx context.Context) ApiDetailList_0Request { - return ApiDetailList_0Request{ +func (a *DetailAPIService) DetailServicesList(ctx context.Context) ApiDetailServicesListRequest { + return ApiDetailServicesListRequest{ ApiService: a, ctx: ctx, } @@ -317,7 +317,7 @@ func (a *DetailAPIService) DetailList_1(ctx context.Context) ApiDetailList_0Requ // Execute executes the request // // @return InfraListDetailServicesResponse -func (a *DetailAPIService) DetailList_1Execute(r ApiDetailList_0Request) (*InfraListDetailServicesResponse, *http.Response, error) { +func (a *DetailAPIService) DetailServicesListExecute(r ApiDetailServicesListRequest) (*InfraListDetailServicesResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -325,7 +325,7 @@ func (a *DetailAPIService) DetailList_1Execute(r ApiDetailList_0Request) (*Infra localVarReturnValue *InfraListDetailServicesResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "DetailAPIService.DetailList_1") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(r.ctx, "DetailAPIService.DetailServicesList") if err != nil { return localVarReturnValue, nil, internal.NewGenericOpenAPIError(err.Error()) } diff --git a/infra_mgmt/docs/DetailAPI.md b/infra_mgmt/docs/DetailAPI.md index 59298e4..a21feb9 100644 --- a/infra_mgmt/docs/DetailAPI.md +++ b/infra_mgmt/docs/DetailAPI.md @@ -4,14 +4,14 @@ All URIs are relative to *http://csp.infoblox.com/api/infra/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DetailList**](DetailAPI.md#DetailList) | **Get** /detail_hosts | List all the Hosts along with its associated Services (applications). -[**DetailList_0**](DetailAPI.md#DetailList_0) | **Get** /detail_services | List all the Services (applications) along with its associated Hosts. +[**DetailHostsList**](DetailAPI.md#DetailHostsList) | **Get** /detail_hosts | List all the Hosts along with its associated Services (applications). +[**DetailServicesList**](DetailAPI.md#DetailServicesList) | **Get** /detail_services | List all the Services (applications) along with its associated Hosts. -## DetailList +## DetailHostsList -> InfraListDetailHostsResponse DetailList(ctx).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() +> InfraListDetailHostsResponse DetailHostsList(ctx).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() List all the Hosts along with its associated Services (applications). @@ -39,13 +39,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DetailAPI.DetailList(context.Background()).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() + resp, r, err := apiClient.DetailAPI.DetailHostsList(context.Background()).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DetailAPI.DetailList``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DetailAPI.DetailHostsList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `DetailList`: InfraListDetailHostsResponse - fmt.Fprintf(os.Stdout, "Response from `DetailAPI.DetailList`: %v\n", resp) + // response from `DetailHostsList`: InfraListDetailHostsResponse + fmt.Fprintf(os.Stdout, "Response from `DetailAPI.DetailHostsList`: %v\n", resp) } ``` @@ -55,7 +55,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiDetailListRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDetailHostsListRequest struct via the builder pattern Name | Type | Description | Notes @@ -87,9 +87,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DetailList_0 +## DetailServicesList -> InfraListDetailServicesResponse DetailList_0(ctx).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() +> InfraListDetailServicesResponse DetailServicesList(ctx).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() List all the Services (applications) along with its associated Hosts. @@ -117,13 +117,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DetailAPI.DetailList_0(context.Background()).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() + resp, r, err := apiClient.DetailAPI.DetailServicesList(context.Background()).Filter(filter).OrderBy(orderBy).Offset(offset).Limit(limit).PageToken(pageToken).Fields(fields).Tfilter(tfilter).TorderBy(torderBy).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DetailAPI.DetailList_0``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DetailAPI.DetailServicesList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `DetailList_0`: InfraListDetailServicesResponse - fmt.Fprintf(os.Stdout, "Response from `DetailAPI.DetailList_0`: %v\n", resp) + // response from `DetailServicesList`: InfraListDetailServicesResponse + fmt.Fprintf(os.Stdout, "Response from `DetailAPI.DetailServicesList`: %v\n", resp) } ``` @@ -133,7 +133,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiDetailList_1Request struct via the builder pattern +Other parameters are passed through a pointer to a apiDetailServicesListRequest struct via the builder pattern Name | Type | Description | Notes diff --git a/infra_mgmt/docs/InfraDetailService.md b/infra_mgmt/docs/InfraDetailService.md index c7e1c05..3fe491f 100644 --- a/infra_mgmt/docs/InfraDetailService.md +++ b/infra_mgmt/docs/InfraDetailService.md @@ -11,7 +11,6 @@ Name | Type | Description | Notes **Description** | Pointer to **string** | The description of the Service. | [optional] **DesiredState** | Pointer to **string** | The desired state of the Service (`\"start\"` or `\"stop\"`). | [optional] **DesiredVersion** | Pointer to **string** | The desired version of the Service. | [optional] -**Destinations** | Pointer to **map[string]interface{}** | Configuration for the interfaces through which this Service can send outgoing traffic. | [optional] **Hosts** | Pointer to [**[]InfraDetailServiceHost**](InfraDetailServiceHost.md) | List of Hosts on which this Service is deployed. | [optional] **Id** | Pointer to **string** | The resource identifier. | [optional] [readonly] **InterfaceLabels** | Pointer to **[]string** | List of interfaces on which this Service can operate. | [optional] @@ -19,7 +18,6 @@ Name | Type | Description | Notes **Name** | Pointer to **string** | The name of the Service. | [optional] **Pool** | Pointer to [**InfraPoolInfo**](InfraPoolInfo.md) | | [optional] **ServiceType** | Pointer to **string** | The type of the Service deployed on the Host (`dns`, `cdc`, etc.). | [optional] -**SourceInterfaces** | Pointer to **map[string]interface{}** | Configuration for the interfaces through which this Service can take incoming traffic. | [optional] **Tags** | Pointer to **map[string]interface{}** | Tags associated with this Service. | [optional] **UpdatedAt** | Pointer to **time.Time** | Timestamp of the latest update on Service. | [optional] @@ -217,31 +215,6 @@ SetDesiredVersion sets DesiredVersion field to given value. HasDesiredVersion returns a boolean if a field has been set. -### GetDestinations - -`func (o *InfraDetailService) GetDestinations() map[string]interface{}` - -GetDestinations returns the Destinations field if non-nil, zero value otherwise. - -### GetDestinationsOk - -`func (o *InfraDetailService) GetDestinationsOk() (*map[string]interface{}, bool)` - -GetDestinationsOk returns a tuple with the Destinations field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDestinations - -`func (o *InfraDetailService) SetDestinations(v map[string]interface{})` - -SetDestinations sets Destinations field to given value. - -### HasDestinations - -`func (o *InfraDetailService) HasDestinations() bool` - -HasDestinations returns a boolean if a field has been set. - ### GetHosts `func (o *InfraDetailService) GetHosts() []InfraDetailServiceHost` @@ -417,31 +390,6 @@ SetServiceType sets ServiceType field to given value. HasServiceType returns a boolean if a field has been set. -### GetSourceInterfaces - -`func (o *InfraDetailService) GetSourceInterfaces() map[string]interface{}` - -GetSourceInterfaces returns the SourceInterfaces field if non-nil, zero value otherwise. - -### GetSourceInterfacesOk - -`func (o *InfraDetailService) GetSourceInterfacesOk() (*map[string]interface{}, bool)` - -GetSourceInterfacesOk returns a tuple with the SourceInterfaces field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceInterfaces - -`func (o *InfraDetailService) SetSourceInterfaces(v map[string]interface{})` - -SetSourceInterfaces sets SourceInterfaces field to given value. - -### HasSourceInterfaces - -`func (o *InfraDetailService) HasSourceInterfaces() bool` - -HasSourceInterfaces returns a boolean if a field has been set. - ### GetTags `func (o *InfraDetailService) GetTags() map[string]interface{}` diff --git a/infra_mgmt/docs/InfraHost.md b/infra_mgmt/docs/InfraHost.md index b293131..b12fb39 100644 --- a/infra_mgmt/docs/InfraHost.md +++ b/infra_mgmt/docs/InfraHost.md @@ -5,28 +5,28 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Configs** | Pointer to [**[]InfraServiceHostConfig**](InfraServiceHostConfig.md) | The list of Host-specific configurations for each Service deployed on this Host. | [optional] [readonly] -**ConnectivityMonitor** | Pointer to **map[string]interface{}** | Represents the connectivity monitor properties of a Host, to enable/disable connectivity monitoring for redundant network interfaces. The \"endpoint_type\" is: - `\"csp\"` for enabling monitoring - `\"\"` for disabling monitoring (default) Note: Currently, all fields except \"endpoint_type\" are read-only, and will be overridden to default values in case they are edited. Example: ``` { \"connectivity_monitor\": { \"cost\":1000000, \"endpoint_type\":\"csp\", \"endpoint\":\"http://csp.infoblox.com\", \"interval\":15, \"failure_threshold\":1, \"success_threshold\":2 } } ``` | [optional] +**ConnectivityMonitor** | Pointer to **map[string]interface{}** | Represents the connectivity monitor properties of a Host, to enable/disable connectivity monitoring for redundant network interfaces. The \"endpoint_type\" is: - `\"csp\"` for enabling monitoring - `\"\"` for disabling monitoring (default) Note: Currently, all fields except \"endpoint_type\" are read-only, and will be overridden to default values in case they are edited. Example: ``` { \"connectivity_monitor\": { \"cost\":1000000, \"endpoint_type\":\"csp\", \"endpoint\":\"http://csp.infoblox.com\", \"interval\":15, \"failure_threshold\":1, \"success_threshold\":2 } } ``` | [optional] [readonly] **CreatedAt** | Pointer to **time.Time** | The timestamp of creation of Host. | [optional] [readonly] **CreatedBy** | Pointer to **string** | The creator of the Host (internal use only). | [optional] [readonly] **Description** | Pointer to **string** | The description of the Host (optional). | [optional] **DisplayName** | **string** | The name of the Host (unique). | -**HostSubtype** | Pointer to **string** | The sub-type of a specific Host type. Example: For Host type BloxOne Appliance, sub-type could be \"B105\" or \"VEP1425\" | [optional] -**HostType** | Pointer to **string** | The type of Host. Should be one of: 1. NIOS , 2. NIOS HA, 3. BloxOne VM , 4. BloxOne Appliance, 5. BloxOne Container, 6. CNIOS | [optional] +**HostSubtype** | Pointer to **string** | The sub-type of a specific Host type. Example: For Host type BloxOne Appliance, sub-type could be \"B105\" or \"VEP1425\" | [optional] [readonly] +**HostType** | Pointer to **string** | The type of Host. Should be one of: 1. NIOS , 2. NIOS HA, 3. BloxOne VM , 4. BloxOne Appliance, 5. BloxOne Container, 6. CNIOS | [optional] [readonly] **HostVersion** | Pointer to **string** | The version of the Host platform services. | [optional] [readonly] **Id** | Pointer to **string** | The resource identifier. | [optional] [readonly] -**IpAddress** | Pointer to **string** | The IP address of the Host. | [optional] +**IpAddress** | Pointer to **string** | The IP address of the Host. | [optional] [readonly] **IpSpace** | Pointer to **string** | The IP Space of the Host. | [optional] **LegacyId** | Pointer to **string** | The legacy Host object identifier. | [optional] [readonly] **LocationId** | Pointer to **string** | The resource identifier. | [optional] -**MacAddress** | Pointer to **string** | The MAC address of the Host. | [optional] +**MacAddress** | Pointer to **string** | The MAC address of the Host. | [optional] [readonly] **MaintenanceMode** | Pointer to **string** | | [optional] -**NatIp** | Pointer to **string** | The NAT IP address of the Host. | [optional] +**NatIp** | Pointer to **string** | The NAT IP address of the Host. | [optional] [readonly] **NoaCluster** | Pointer to **string** | The CSP cluster identifier (internal use only). | [optional] [readonly] **Ophid** | Pointer to **string** | The unique On-Prem Host ID generated by the On-Prem device and assigned to the Host once it is registered and logged into the Infoblox Cloud. | [optional] [readonly] **PoolId** | Pointer to **string** | The resource identifier. | [optional] **SerialNumber** | Pointer to **string** | The unique serial number of the Host. | [optional] **Tags** | Pointer to **map[string]interface{}** | Tags associated with this Host. | [optional] -**Timezone** | Pointer to **string** | The timezone of the Host. | [optional] +**Timezone** | Pointer to **string** | The timezone of the Host. | [optional] [readonly] **UpdatedAt** | Pointer to **time.Time** | The timestamp of the latest update on Host. | [optional] [readonly] ## Methods diff --git a/infra_mgmt/model_infra_detail_service.go b/infra_mgmt/model_infra_detail_service.go index a775faf..95bdf23 100644 --- a/infra_mgmt/model_infra_detail_service.go +++ b/infra_mgmt/model_infra_detail_service.go @@ -34,8 +34,6 @@ type InfraDetailService struct { DesiredState *string `json:"desired_state,omitempty"` // The desired version of the Service. DesiredVersion *string `json:"desired_version,omitempty"` - // Configuration for the interfaces through which this Service can send outgoing traffic. - Destinations map[string]interface{} `json:"destinations,omitempty"` // List of Hosts on which this Service is deployed. Hosts []InfraDetailServiceHost `json:"hosts,omitempty"` // The resource identifier. @@ -48,8 +46,6 @@ type InfraDetailService struct { Pool *InfraPoolInfo `json:"pool,omitempty"` // The type of the Service deployed on the Host (`dns`, `cdc`, etc.). ServiceType *string `json:"service_type,omitempty"` - // Configuration for the interfaces through which this Service can take incoming traffic. - SourceInterfaces map[string]interface{} `json:"source_interfaces,omitempty"` // Tags associated with this Service. Tags map[string]interface{} `json:"tags,omitempty"` // Timestamp of the latest update on Service. @@ -297,38 +293,6 @@ func (o *InfraDetailService) SetDesiredVersion(v string) { o.DesiredVersion = &v } -// GetDestinations returns the Destinations field value if set, zero value otherwise. -func (o *InfraDetailService) GetDestinations() map[string]interface{} { - if o == nil || IsNil(o.Destinations) { - var ret map[string]interface{} - return ret - } - return o.Destinations -} - -// GetDestinationsOk returns a tuple with the Destinations field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InfraDetailService) GetDestinationsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Destinations) { - return map[string]interface{}{}, false - } - return o.Destinations, true -} - -// HasDestinations returns a boolean if a field has been set. -func (o *InfraDetailService) HasDestinations() bool { - if o != nil && !IsNil(o.Destinations) { - return true - } - - return false -} - -// SetDestinations gets a reference to the given map[string]interface{} and assigns it to the Destinations field. -func (o *InfraDetailService) SetDestinations(v map[string]interface{}) { - o.Destinations = v -} - // GetHosts returns the Hosts field value if set, zero value otherwise. func (o *InfraDetailService) GetHosts() []InfraDetailServiceHost { if o == nil || IsNil(o.Hosts) { @@ -553,38 +517,6 @@ func (o *InfraDetailService) SetServiceType(v string) { o.ServiceType = &v } -// GetSourceInterfaces returns the SourceInterfaces field value if set, zero value otherwise. -func (o *InfraDetailService) GetSourceInterfaces() map[string]interface{} { - if o == nil || IsNil(o.SourceInterfaces) { - var ret map[string]interface{} - return ret - } - return o.SourceInterfaces -} - -// GetSourceInterfacesOk returns a tuple with the SourceInterfaces field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InfraDetailService) GetSourceInterfacesOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.SourceInterfaces) { - return map[string]interface{}{}, false - } - return o.SourceInterfaces, true -} - -// HasSourceInterfaces returns a boolean if a field has been set. -func (o *InfraDetailService) HasSourceInterfaces() bool { - if o != nil && !IsNil(o.SourceInterfaces) { - return true - } - - return false -} - -// SetSourceInterfaces gets a reference to the given map[string]interface{} and assigns it to the SourceInterfaces field. -func (o *InfraDetailService) SetSourceInterfaces(v map[string]interface{}) { - o.SourceInterfaces = v -} - // GetTags returns the Tags field value if set, zero value otherwise. func (o *InfraDetailService) GetTags() map[string]interface{} { if o == nil || IsNil(o.Tags) { @@ -680,9 +612,6 @@ func (o InfraDetailService) ToMap() (map[string]interface{}, error) { if !IsNil(o.DesiredVersion) { toSerialize["desired_version"] = o.DesiredVersion } - if !IsNil(o.Destinations) { - toSerialize["destinations"] = o.Destinations - } if !IsNil(o.Hosts) { toSerialize["hosts"] = o.Hosts } @@ -704,9 +633,6 @@ func (o InfraDetailService) ToMap() (map[string]interface{}, error) { if !IsNil(o.ServiceType) { toSerialize["service_type"] = o.ServiceType } - if !IsNil(o.SourceInterfaces) { - toSerialize["source_interfaces"] = o.SourceInterfaces - } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } From 65049f52051989a4ee6f2c830020f17779e3274a Mon Sep 17 00:00:00 2001 From: Ashish Mathew Date: Thu, 4 Jan 2024 22:26:13 -0800 Subject: [PATCH 3/3] fix tests --- infra_mgmt/test/api_detail_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/infra_mgmt/test/api_detail_test.go b/infra_mgmt/test/api_detail_test.go index dade78a..c78318d 100644 --- a/infra_mgmt/test/api_detail_test.go +++ b/infra_mgmt/test/api_detail_test.go @@ -25,11 +25,11 @@ func Test_infra_mgmt_DetailAPIService(t *testing.T) { configuration := internal.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - t.Run("Test DetailAPIService DetailList", func(t *testing.T) { + t.Run("Test DetailAPIService DetailHostsList", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.DetailAPI.DetailList(context.Background()).Execute() + resp, httpRes, err := apiClient.DetailAPI.DetailHostsList(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -37,11 +37,11 @@ func Test_infra_mgmt_DetailAPIService(t *testing.T) { }) - t.Run("Test DetailAPIService DetailList_1", func(t *testing.T) { + t.Run("Test DetailAPIService DetailServicesList", func(t *testing.T) { t.Skip("skip test") // remove to run test - resp, httpRes, err := apiClient.DetailAPI.DetailList(context.Background()).Execute() + resp, httpRes, err := apiClient.DetailAPI.DetailServicesList(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp)