diff --git a/clouddiscovery/api/openapi.yaml b/clouddiscovery/api/openapi.yaml index a7bb103..16903ca 100644 --- a/clouddiscovery/api/openapi.yaml +++ b/clouddiscovery/api/openapi.yaml @@ -901,6 +901,7 @@ components: last_sync: description: Last sync timestamp. format: date-time + readOnly: true type: string name: description: Name of the discovery config. @@ -919,9 +920,11 @@ components: Status of the sync operation. In single account case, Its the combined status of account & all the destinations statuses In auto discover case, Its the status of the account discovery only. + readOnly: true type: string status_message: description: Aggregate status message of the sync operation. + readOnly: true type: string sync_interval: title: "Time between sync jobs in minutes. Default is \"Auto\". Other supported\ @@ -937,7 +940,9 @@ components: readOnly: true type: string required: + - account_preference - name + - provider_type title: DiscoveryConfig type: object ddidnsrickettsIPAMConfig: diff --git a/clouddiscovery/docs/DiscoveryConfig.md b/clouddiscovery/docs/DiscoveryConfig.md index c2eea83..59efe68 100644 --- a/clouddiscovery/docs/DiscoveryConfig.md +++ b/clouddiscovery/docs/DiscoveryConfig.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountPreference** | Pointer to **string** | Account preference. For ex.: single, multiple, auto-discover-multiple. | [optional] +**AccountPreference** | **string** | Account preference. For ex.: single, multiple, auto-discover-multiple. | **AdditionalConfig** | Pointer to [**AdditionalConfig**](AdditionalConfig.md) | Additional configuration. Ex.: '{ \"excluded_object_types\": [], \"exclusion_account_list\": [], \"zone_forwarding\": \"true\" or \"false\" }'. | [optional] **CreatedAt** | Pointer to **time.Time** | Timestamp when the object has been created. | [optional] [readonly] **CredentialPreference** | Pointer to [**CredentialPreference**](CredentialPreference.md) | Credential preference. Ex.: '{ \"type\": \"static\" or \"delegated\", \"access_identifier_type\": \"role_arn\" or \"tenant_id\" or \"project_id\" }'. | [optional] @@ -14,12 +14,12 @@ Name | Type | Description | Notes **DestinationTypesEnabled** | Pointer to **[]string** | Destinations types enabled: Ex.: DNS, IPAM and ACCOUNT. | [optional] **Destinations** | Pointer to [**[]Destination**](Destination.md) | Destinations. | [optional] **Id** | Pointer to **string** | Auto-generated unique discovery config ID. Format BloxID. | [optional] [readonly] -**LastSync** | Pointer to **time.Time** | Last sync timestamp. | [optional] +**LastSync** | Pointer to **time.Time** | Last sync timestamp. | [optional] [readonly] **Name** | **string** | Name of the discovery config. | -**ProviderType** | Pointer to **string** | Provider type. Ex.: Amazon Web Services, Google Cloud Platform, Microsoft Azure. | [optional] +**ProviderType** | **string** | Provider type. Ex.: Amazon Web Services, Google Cloud Platform, Microsoft Azure. | **SourceConfigs** | Pointer to [**[]SourceConfig**](SourceConfig.md) | Source configs. | [optional] -**Status** | Pointer to **string** | Status of the sync operation. In single account case, Its the combined status of account & all the destinations statuses In auto discover case, Its the status of the account discovery only. | [optional] -**StatusMessage** | Pointer to **string** | Aggregate status message of the sync operation. | [optional] +**Status** | Pointer to **string** | Status of the sync operation. In single account case, Its the combined status of account & all the destinations statuses In auto discover case, Its the status of the account discovery only. | [optional] [readonly] +**StatusMessage** | Pointer to **string** | Aggregate status message of the sync operation. | [optional] [readonly] **SyncInterval** | Pointer to **string** | | [optional] **Tags** | Pointer to **map[string]interface{}** | Tagging specifics. | [optional] **UpdatedAt** | Pointer to **time.Time** | Timestamp when the object has been updated. | [optional] [readonly] @@ -28,7 +28,7 @@ Name | Type | Description | Notes ### NewDiscoveryConfig -`func NewDiscoveryConfig(name string, ) *DiscoveryConfig` +`func NewDiscoveryConfig(accountPreference string, name string, providerType string, ) *DiscoveryConfig` NewDiscoveryConfig instantiates a new DiscoveryConfig object This constructor will assign default values to properties that have it defined, @@ -62,11 +62,6 @@ and a boolean to check if the value has been set. SetAccountPreference sets AccountPreference field to given value. -### HasAccountPreference - -`func (o *DiscoveryConfig) HasAccountPreference() bool` - -HasAccountPreference returns a boolean if a field has been set. ### GetAdditionalConfig @@ -357,11 +352,6 @@ and a boolean to check if the value has been set. SetProviderType sets ProviderType field to given value. -### HasProviderType - -`func (o *DiscoveryConfig) HasProviderType() bool` - -HasProviderType returns a boolean if a field has been set. ### GetSourceConfigs diff --git a/clouddiscovery/docs/ProvidersAPI.md b/clouddiscovery/docs/ProvidersAPI.md index 6e13e1a..877e9f6 100644 --- a/clouddiscovery/docs/ProvidersAPI.md +++ b/clouddiscovery/docs/ProvidersAPI.md @@ -34,7 +34,7 @@ import ( ) func main() { - body := *clouddiscovery.NewDiscoveryConfig("Name_example") // DiscoveryConfig | + body := *clouddiscovery.NewDiscoveryConfig("AccountPreference_example", "Name_example", "ProviderType_example") // DiscoveryConfig | apiClient := clouddiscovery.NewAPIClient() resp, r, err := apiClient.ProvidersAPI.Create(context.Background()).Body(body).Execute() @@ -310,7 +310,7 @@ import ( func main() { id := "a5183192-1e00-475f-b334-38e1f0bb1bc7" // string | Auto-generated unique discovery config ID. Format BloxID. - body := *clouddiscovery.NewDiscoveryConfig("Name_example") // DiscoveryConfig | + body := *clouddiscovery.NewDiscoveryConfig("AccountPreference_example", "Name_example", "ProviderType_example") // DiscoveryConfig | apiClient := clouddiscovery.NewAPIClient() resp, r, err := apiClient.ProvidersAPI.Update(context.Background(), id).Body(body).Execute() diff --git a/clouddiscovery/model_discovery_config.go b/clouddiscovery/model_discovery_config.go index d9a6f0f..21236ab 100644 --- a/clouddiscovery/model_discovery_config.go +++ b/clouddiscovery/model_discovery_config.go @@ -22,7 +22,7 @@ var _ MappedNullable = &DiscoveryConfig{} // DiscoveryConfig Discovery configuration type DiscoveryConfig struct { // Account preference. For ex.: single, multiple, auto-discover-multiple. - AccountPreference *string `json:"account_preference,omitempty"` + AccountPreference string `json:"account_preference"` // Additional configuration. Ex.: '{ \"excluded_object_types\": [], \"exclusion_account_list\": [], \"zone_forwarding\": \"true\" or \"false\" }'. AdditionalConfig *AdditionalConfig `json:"additional_config,omitempty"` // Timestamp when the object has been created. @@ -46,7 +46,7 @@ type DiscoveryConfig struct { // Name of the discovery config. Name string `json:"name"` // Provider type. Ex.: Amazon Web Services, Google Cloud Platform, Microsoft Azure. - ProviderType *string `json:"provider_type,omitempty"` + ProviderType string `json:"provider_type"` // Source configs. SourceConfigs []SourceConfig `json:"source_configs,omitempty"` // Status of the sync operation. In single account case, Its the combined status of account & all the destinations statuses In auto discover case, Its the status of the account discovery only. @@ -67,9 +67,11 @@ type _DiscoveryConfig DiscoveryConfig // 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 NewDiscoveryConfig(name string) *DiscoveryConfig { +func NewDiscoveryConfig(accountPreference string, name string, providerType string) *DiscoveryConfig { this := DiscoveryConfig{} + this.AccountPreference = accountPreference this.Name = name + this.ProviderType = providerType return &this } @@ -81,36 +83,28 @@ func NewDiscoveryConfigWithDefaults() *DiscoveryConfig { return &this } -// GetAccountPreference returns the AccountPreference field value if set, zero value otherwise. +// GetAccountPreference returns the AccountPreference field value func (o *DiscoveryConfig) GetAccountPreference() string { - if o == nil || IsNil(o.AccountPreference) { + if o == nil { var ret string return ret } - return *o.AccountPreference + + return o.AccountPreference } -// GetAccountPreferenceOk returns a tuple with the AccountPreference field value if set, nil otherwise +// GetAccountPreferenceOk returns a tuple with the AccountPreference field value // and a boolean to check if the value has been set. func (o *DiscoveryConfig) GetAccountPreferenceOk() (*string, bool) { - if o == nil || IsNil(o.AccountPreference) { + if o == nil { return nil, false } - return o.AccountPreference, true -} - -// HasAccountPreference returns a boolean if a field has been set. -func (o *DiscoveryConfig) HasAccountPreference() bool { - if o != nil && !IsNil(o.AccountPreference) { - return true - } - - return false + return &o.AccountPreference, true } -// SetAccountPreference gets a reference to the given string and assigns it to the AccountPreference field. +// SetAccountPreference sets field value func (o *DiscoveryConfig) SetAccountPreference(v string) { - o.AccountPreference = &v + o.AccountPreference = v } // GetAdditionalConfig returns the AdditionalConfig field value if set, zero value otherwise. @@ -457,36 +451,28 @@ func (o *DiscoveryConfig) SetName(v string) { o.Name = v } -// GetProviderType returns the ProviderType field value if set, zero value otherwise. +// GetProviderType returns the ProviderType field value func (o *DiscoveryConfig) GetProviderType() string { - if o == nil || IsNil(o.ProviderType) { + if o == nil { var ret string return ret } - return *o.ProviderType + + return o.ProviderType } -// GetProviderTypeOk returns a tuple with the ProviderType field value if set, nil otherwise +// GetProviderTypeOk returns a tuple with the ProviderType field value // and a boolean to check if the value has been set. func (o *DiscoveryConfig) GetProviderTypeOk() (*string, bool) { - if o == nil || IsNil(o.ProviderType) { + if o == nil { return nil, false } - return o.ProviderType, true -} - -// HasProviderType returns a boolean if a field has been set. -func (o *DiscoveryConfig) HasProviderType() bool { - if o != nil && !IsNil(o.ProviderType) { - return true - } - - return false + return &o.ProviderType, true } -// SetProviderType gets a reference to the given string and assigns it to the ProviderType field. +// SetProviderType sets field value func (o *DiscoveryConfig) SetProviderType(v string) { - o.ProviderType = &v + o.ProviderType = v } // GetSourceConfigs returns the SourceConfigs field value if set, zero value otherwise. @@ -691,9 +677,7 @@ func (o DiscoveryConfig) MarshalJSON() ([]byte, error) { func (o DiscoveryConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AccountPreference) { - toSerialize["account_preference"] = o.AccountPreference - } + toSerialize["account_preference"] = o.AccountPreference if !IsNil(o.AdditionalConfig) { toSerialize["additional_config"] = o.AdditionalConfig } @@ -725,9 +709,7 @@ func (o DiscoveryConfig) ToMap() (map[string]interface{}, error) { toSerialize["last_sync"] = o.LastSync } toSerialize["name"] = o.Name - if !IsNil(o.ProviderType) { - toSerialize["provider_type"] = o.ProviderType - } + toSerialize["provider_type"] = o.ProviderType if !IsNil(o.SourceConfigs) { toSerialize["source_configs"] = o.SourceConfigs } @@ -759,7 +741,9 @@ func (o *DiscoveryConfig) UnmarshalJSON(data []byte) (err error) { // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ + "account_preference", "name", + "provider_type", } allProperties := make(map[string]interface{}) diff --git a/clouddiscovery/test/api_providers_test.go b/clouddiscovery/test/api_providers_test.go index ae06683..35c35e3 100644 --- a/clouddiscovery/test/api_providers_test.go +++ b/clouddiscovery/test/api_providers_test.go @@ -33,14 +33,14 @@ func TestProvidersAPIService(t *testing.T) { awsresp, httpRes, err := apiClient.DiscoveryConfigurationAPIV2.ProvidersAPI.Create(context.Background()). Body(clouddiscovery.DiscoveryConfig{ - AccountPreference: clouddiscovery.PtrString("single"), + AccountPreference: "single", CredentialPreference: &clouddiscovery.CredentialPreference{ AccessIdentifierType: clouddiscovery.PtrString("role_arn"), CredentialType: clouddiscovery.PtrString("dynamic"), }, Description: clouddiscovery.PtrString("AWS Discovery"), Name: "TestSyncAWS1", - ProviderType: clouddiscovery.PtrString("Amazon Web Services"), + ProviderType: "Amazon Web Services", SourceConfigs: []clouddiscovery.SourceConfig{ { CredentialConfig: &clouddiscovery.CredentialConfig{ @@ -67,7 +67,7 @@ func TestProvidersAPIService(t *testing.T) { azureresp, httpRes, err := apiClient.DiscoveryConfigurationAPIV2.ProvidersAPI.Create(context.Background()). Body(clouddiscovery.DiscoveryConfig{ - AccountPreference: clouddiscovery.PtrString("single"), + AccountPreference: "single", CredentialPreference: &clouddiscovery.CredentialPreference{ AccessIdentifierType: clouddiscovery.PtrString("tenant_id"), CredentialType: clouddiscovery.PtrString("dynamic"), @@ -75,7 +75,7 @@ func TestProvidersAPIService(t *testing.T) { }, Description: clouddiscovery.PtrString("Azure Discovery"), Name: "TestSyncAzure", - ProviderType: clouddiscovery.PtrString("Microsoft Azure"), + ProviderType: "Microsoft Azure", SourceConfigs: []clouddiscovery.SourceConfig{ { CredentialConfig: &clouddiscovery.CredentialConfig{ @@ -107,7 +107,7 @@ func TestProvidersAPIService(t *testing.T) { gcpresp, httpRes, err := apiClient.DiscoveryConfigurationAPIV2.ProvidersAPI.Create(context.Background()). Body(clouddiscovery.DiscoveryConfig{ - AccountPreference: clouddiscovery.PtrString("single"), + AccountPreference: "single", CredentialPreference: &clouddiscovery.CredentialPreference{ AccessIdentifierType: clouddiscovery.PtrString("project_id"), CredentialType: clouddiscovery.PtrString("dynamic"), @@ -115,7 +115,7 @@ func TestProvidersAPIService(t *testing.T) { }, Description: clouddiscovery.PtrString("GCP Discovery"), Name: "TestSyncGCP", - ProviderType: clouddiscovery.PtrString("Google Cloud Platform"), + ProviderType: "Google Cloud Platform", SourceConfigs: []clouddiscovery.SourceConfig{ { CredentialConfig: &clouddiscovery.CredentialConfig{ @@ -171,26 +171,12 @@ func TestProvidersAPIService(t *testing.T) { resp, httpRes, err := apiClient.DiscoveryConfigurationAPIV2.ProvidersAPI.Update(context.Background(), *awsId). Body(clouddiscovery.DiscoveryConfig{ - AccountPreference: clouddiscovery.PtrString("single"), - CredentialPreference: &clouddiscovery.CredentialPreference{ - AccessIdentifierType: clouddiscovery.PtrString("role_arn"), - CredentialType: clouddiscovery.PtrString("dynamic"), - AdditionalProperties: nil, - }, - Description: clouddiscovery.PtrString("AWS Discovery"), - Name: "TestSyncAWS", - ProviderType: clouddiscovery.PtrString("Amazon Web Services"), - SourceConfigs: []clouddiscovery.SourceConfig{ - { - //Id: az, - CredentialConfig: &clouddiscovery.CredentialConfig{ - AccessIdentifier: clouddiscovery.PtrString("arn:aws:iam::111111111111:role/infoblox_discovery"), - }, - AdditionalProperties: nil, - }, - }, - SyncInterval: clouddiscovery.PtrString("Auto"), - Tags: nil, + AccountPreference: "single", + Description: clouddiscovery.PtrString("AWS Discovery Update"), + Name: "TestSyncAWS1", + ProviderType: "Amazon Web Services", + SyncInterval: clouddiscovery.PtrString("Auto"), + Tags: nil, }). Execute() @@ -209,10 +195,10 @@ func TestProvidersAPIService(t *testing.T) { resp, httpRes, err := apiClient.DiscoveryConfigurationAPIV2.ProvidersAPI.Update(context.Background(), *azureId). Body(clouddiscovery.DiscoveryConfig{ - AccountPreference: clouddiscovery.PtrString("single"), - Description: clouddiscovery.PtrString("Azure Discovery meow"), + AccountPreference: "single", + Description: clouddiscovery.PtrString("Azure Discovery Update"), Name: "TestSyncAzure", - ProviderType: clouddiscovery.PtrString("Microsoft Azure"), + ProviderType: "Microsoft Azure", SyncInterval: clouddiscovery.PtrString("Auto"), Tags: nil, }). @@ -233,10 +219,10 @@ func TestProvidersAPIService(t *testing.T) { gcpresp, httpRes, err := apiClient.DiscoveryConfigurationAPIV2.ProvidersAPI.Update(context.Background(), *gcpId). Body(clouddiscovery.DiscoveryConfig{ - AccountPreference: clouddiscovery.PtrString("single"), + AccountPreference: "single", Description: clouddiscovery.PtrString("GCP Discovery update"), Name: "TestSyncGCP", - ProviderType: clouddiscovery.PtrString("Google Cloud Platform"), + ProviderType: "Google Cloud Platform", }). Execute()