diff --git a/projectv1/project_v1.go b/projectv1/project_v1.go index 0ac2b50..6cb0740 100644 --- a/projectv1/project_v1.go +++ b/projectv1/project_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.67.0-df2073a1-20230222-221157 + * IBM OpenAPI SDK Code Generator Version: 3.70.0-7df966bf-20230419-195904 */ // Package projectv1 : Operations and models for the ProjectV1 service @@ -35,7 +35,7 @@ import ( ) // ProjectV1 : This document is the **REST API specification** for the Projects Service. The Projects service provides -// the capability to manage infrastructure as code in IBM Cloud. +// the capability to manage Infrastructure as Code in IBM Cloud. // // API Version: 1.0.0 type ProjectV1 struct { @@ -198,12 +198,8 @@ func (project *ProjectV1) CreateProjectWithContext(ctx context.Context, createPr builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") - if createProjectOptions.ResourceGroup != nil { - builder.AddQuery("resource_group", fmt.Sprint(*createProjectOptions.ResourceGroup)) - } - if createProjectOptions.Location != nil { - builder.AddQuery("location", fmt.Sprint(*createProjectOptions.Location)) - } + builder.AddQuery("resource_group", fmt.Sprint(*createProjectOptions.ResourceGroup)) + builder.AddQuery("location", fmt.Sprint(*createProjectOptions.Location)) body := make(map[string]interface{}) if createProjectOptions.Name != nil { @@ -303,8 +299,8 @@ func (project *ProjectV1) ListProjectsWithContext(ctx context.Context, listProje return } -// GetProject : Get project by ID -// Get a project definition document by the ID. +// GetProject : Get a project +// Get information about a project. func (project *ProjectV1) GetProject(getProjectOptions *GetProjectOptions) (result *Project, response *core.DetailedResponse, err error) { return project.GetProjectWithContext(context.Background(), getProjectOptions) } @@ -506,13 +502,13 @@ func (project *ProjectV1) CreateConfigWithContext(ctx context.Context, createCon } pathParamsMap := map[string]string{ - "id": *createConfigOptions.ID, + "project_id": *createConfigOptions.ProjectID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs`, pathParamsMap) if err != nil { return } @@ -529,26 +525,26 @@ func (project *ProjectV1) CreateConfigWithContext(ctx context.Context, createCon builder.AddHeader("Content-Type", "application/json") body := make(map[string]interface{}) - if createConfigOptions.NewName != nil { - body["name"] = createConfigOptions.NewName + if createConfigOptions.Name != nil { + body["name"] = createConfigOptions.Name } - if createConfigOptions.NewLocatorID != nil { - body["locator_id"] = createConfigOptions.NewLocatorID + if createConfigOptions.LocatorID != nil { + body["locator_id"] = createConfigOptions.LocatorID } - if createConfigOptions.NewID != nil { - body["id"] = createConfigOptions.NewID + if createConfigOptions.ID != nil { + body["id"] = createConfigOptions.ID } - if createConfigOptions.NewLabels != nil { - body["labels"] = createConfigOptions.NewLabels + if createConfigOptions.Labels != nil { + body["labels"] = createConfigOptions.Labels } - if createConfigOptions.NewDescription != nil { - body["description"] = createConfigOptions.NewDescription + if createConfigOptions.Description != nil { + body["description"] = createConfigOptions.Description } - if createConfigOptions.NewInput != nil { - body["input"] = createConfigOptions.NewInput + if createConfigOptions.Input != nil { + body["input"] = createConfigOptions.Input } - if createConfigOptions.NewSetting != nil { - body["setting"] = createConfigOptions.NewSetting + if createConfigOptions.Setting != nil { + body["setting"] = createConfigOptions.Setting } _, err = builder.SetBodyContentJSON(body) if err != nil { @@ -577,7 +573,7 @@ func (project *ProjectV1) CreateConfigWithContext(ctx context.Context, createCon } // ListConfigs : List all project configurations -// Lists all of the project configurations for a specific project. +// The collection of configurations that are returned. func (project *ProjectV1) ListConfigs(listConfigsOptions *ListConfigsOptions) (result *ProjectConfigCollection, response *core.DetailedResponse, err error) { return project.ListConfigsWithContext(context.Background(), listConfigsOptions) } @@ -594,13 +590,13 @@ func (project *ProjectV1) ListConfigsWithContext(ctx context.Context, listConfig } pathParamsMap := map[string]string{ - "id": *listConfigsOptions.ID, + "project_id": *listConfigsOptions.ProjectID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs`, pathParamsMap) if err != nil { return } @@ -661,14 +657,14 @@ func (project *ProjectV1) GetConfigWithContext(ctx context.Context, getConfigOpt } pathParamsMap := map[string]string{ - "id": *getConfigOptions.ID, - "config_id": *getConfigOptions.ConfigID, + "project_id": *getConfigOptions.ProjectID, + "id": *getConfigOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}`, pathParamsMap) if err != nil { return } @@ -729,14 +725,14 @@ func (project *ProjectV1) UpdateConfigWithContext(ctx context.Context, updateCon } pathParamsMap := map[string]string{ - "id": *updateConfigOptions.ID, - "config_id": *updateConfigOptions.ConfigID, + "project_id": *updateConfigOptions.ProjectID, + "id": *updateConfigOptions.ID, } builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}`, pathParamsMap) if err != nil { return } @@ -784,7 +780,7 @@ func (project *ProjectV1) UpdateConfigWithContext(ctx context.Context, updateCon // DeleteConfig : Delete a configuration in a project by ID // Delete a configuration in a project. Deleting the configuration will also destroy all the resources deployed by the -// configuration. +// configuration if the query parameter destroy is specified. func (project *ProjectV1) DeleteConfig(deleteConfigOptions *DeleteConfigOptions) (result *ProjectConfigDelete, response *core.DetailedResponse, err error) { return project.DeleteConfigWithContext(context.Background(), deleteConfigOptions) } @@ -801,14 +797,14 @@ func (project *ProjectV1) DeleteConfigWithContext(ctx context.Context, deleteCon } pathParamsMap := map[string]string{ - "id": *deleteConfigOptions.ID, - "config_id": *deleteConfigOptions.ConfigID, + "project_id": *deleteConfigOptions.ProjectID, + "id": *deleteConfigOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}`, pathParamsMap) if err != nil { return } @@ -870,14 +866,14 @@ func (project *ProjectV1) GetConfigDiffWithContext(ctx context.Context, getConfi } pathParamsMap := map[string]string{ - "id": *getConfigDiffOptions.ID, - "config_id": *getConfigDiffOptions.ConfigID, + "project_id": *getConfigDiffOptions.ProjectID, + "id": *getConfigDiffOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/diff`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/diff`, pathParamsMap) if err != nil { return } @@ -931,14 +927,14 @@ func (project *ProjectV1) ForceApproveWithContext(ctx context.Context, forceAppr } pathParamsMap := map[string]string{ - "id": *forceApproveOptions.ID, - "config_id": *forceApproveOptions.ConfigID, + "project_id": *forceApproveOptions.ProjectID, + "id": *forceApproveOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/force_approve`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/force_approve`, pathParamsMap) if err != nil { return } @@ -1006,14 +1002,14 @@ func (project *ProjectV1) ApproveWithContext(ctx context.Context, approveOptions } pathParamsMap := map[string]string{ - "id": *approveOptions.ID, - "config_id": *approveOptions.ConfigID, + "project_id": *approveOptions.ProjectID, + "id": *approveOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/approve`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/approve`, pathParamsMap) if err != nil { return } @@ -1082,14 +1078,14 @@ func (project *ProjectV1) CheckConfigWithContext(ctx context.Context, checkConfi } pathParamsMap := map[string]string{ - "id": *checkConfigOptions.ID, - "config_id": *checkConfigOptions.ConfigID, + "project_id": *checkConfigOptions.ProjectID, + "id": *checkConfigOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/check`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/check`, pathParamsMap) if err != nil { return } @@ -1107,12 +1103,12 @@ func (project *ProjectV1) CheckConfigWithContext(ctx context.Context, checkConfi builder.AddHeader("X-Auth-Refresh-Token", fmt.Sprint(*checkConfigOptions.XAuthRefreshToken)) } - if checkConfigOptions.Version != nil { - builder.AddQuery("version", fmt.Sprint(*checkConfigOptions.Version)) - } if checkConfigOptions.Complete != nil { builder.AddQuery("complete", fmt.Sprint(*checkConfigOptions.Complete)) } + if checkConfigOptions.Version != nil { + builder.AddQuery("version", fmt.Sprint(*checkConfigOptions.Version)) + } request, err := builder.Build() if err != nil { @@ -1136,7 +1132,8 @@ func (project *ProjectV1) CheckConfigWithContext(ctx context.Context, checkConfi } // InstallConfig : Deploy a configuration -// Deploy a project's configuration. It is an asynchronous operation that can be tracked using the project status API. +// Deploy a project's configuration. It's an asynchronous operation that can be tracked using the get project +// configuration API with full metadata. func (project *ProjectV1) InstallConfig(installConfigOptions *InstallConfigOptions) (result *ProjectConfig, response *core.DetailedResponse, err error) { return project.InstallConfigWithContext(context.Background(), installConfigOptions) } @@ -1153,14 +1150,14 @@ func (project *ProjectV1) InstallConfigWithContext(ctx context.Context, installC } pathParamsMap := map[string]string{ - "id": *installConfigOptions.ID, - "config_id": *installConfigOptions.ConfigID, + "project_id": *installConfigOptions.ProjectID, + "id": *installConfigOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/install`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/install`, pathParamsMap) if err != nil { return } @@ -1202,7 +1199,7 @@ func (project *ProjectV1) InstallConfigWithContext(ctx context.Context, installC // UninstallConfig : Destroy configuration resources // Destroy a project's configuration resources. The operation destroys all the resources that are deployed with the -// specific configuration. You can track it by using the project status API. +// specific configuration. You can track it by using the get project configuration API with full metadata. func (project *ProjectV1) UninstallConfig(uninstallConfigOptions *UninstallConfigOptions) (response *core.DetailedResponse, err error) { return project.UninstallConfigWithContext(context.Background(), uninstallConfigOptions) } @@ -1219,14 +1216,14 @@ func (project *ProjectV1) UninstallConfigWithContext(ctx context.Context, uninst } pathParamsMap := map[string]string{ - "id": *uninstallConfigOptions.ID, - "config_id": *uninstallConfigOptions.ConfigID, + "project_id": *uninstallConfigOptions.ProjectID, + "id": *uninstallConfigOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/uninstall`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/uninstall`, pathParamsMap) if err != nil { return } @@ -1269,15 +1266,15 @@ func (project *ProjectV1) GetSchematicsJobWithContext(ctx context.Context, getSc } pathParamsMap := map[string]string{ - "id": *getSchematicsJobOptions.ID, - "config_id": *getSchematicsJobOptions.ConfigID, - "action": *getSchematicsJobOptions.Action, + "project_id": *getSchematicsJobOptions.ProjectID, + "id": *getSchematicsJobOptions.ID, + "action": *getSchematicsJobOptions.Action, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/job/{action}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/job/{action}`, pathParamsMap) if err != nil { return } @@ -1335,14 +1332,14 @@ func (project *ProjectV1) GetCostEstimateWithContext(ctx context.Context, getCos } pathParamsMap := map[string]string{ - "id": *getCostEstimateOptions.ID, - "config_id": *getCostEstimateOptions.ConfigID, + "project_id": *getCostEstimateOptions.ProjectID, + "id": *getCostEstimateOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/configs/{config_id}/cost_estimate`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{project_id}/configs/{id}/cost_estimate`, pathParamsMap) if err != nil { return } @@ -1572,141 +1569,64 @@ func (project *ProjectV1) GetNotificationsWithContext(ctx context.Context, getNo return } -// ReceivePulsarCatalogEvents : Webhook for catalog events -// This is a webhook for pulsar catalog events. -func (project *ProjectV1) ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptions *ReceivePulsarCatalogEventsOptions) (response *core.DetailedResponse, err error) { - return project.ReceivePulsarCatalogEventsWithContext(context.Background(), receivePulsarCatalogEventsOptions) +// PostEventNotificationsIntegration : Connect to a event notifications instance +// Connects a project instance to an event notifications instance. +func (project *ProjectV1) PostEventNotificationsIntegration(postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions) (result *NotificationsIntegrationPostResponse, response *core.DetailedResponse, err error) { + return project.PostEventNotificationsIntegrationWithContext(context.Background(), postEventNotificationsIntegrationOptions) } -// ReceivePulsarCatalogEventsWithContext is an alternate form of the ReceivePulsarCatalogEvents method which supports a Context parameter -func (project *ProjectV1) ReceivePulsarCatalogEventsWithContext(ctx context.Context, receivePulsarCatalogEventsOptions *ReceivePulsarCatalogEventsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(receivePulsarCatalogEventsOptions, "receivePulsarCatalogEventsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(receivePulsarCatalogEventsOptions, "receivePulsarCatalogEventsOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/pulsar/catalog_events`, nil) - if err != nil { - return - } - - for headerName, headerValue := range receivePulsarCatalogEventsOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "ReceivePulsarCatalogEvents") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Content-Type", "application/json") - - _, err = builder.SetBodyContentJSON(receivePulsarCatalogEventsOptions.PulsarCatalogEvents) +// PostEventNotificationsIntegrationWithContext is an alternate form of the PostEventNotificationsIntegration method which supports a Context parameter +func (project *ProjectV1) PostEventNotificationsIntegrationWithContext(ctx context.Context, postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions) (result *NotificationsIntegrationPostResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(postEventNotificationsIntegrationOptions, "postEventNotificationsIntegrationOptions cannot be nil") if err != nil { return } - - request, err := builder.Build() + err = core.ValidateStruct(postEventNotificationsIntegrationOptions, "postEventNotificationsIntegrationOptions") if err != nil { return } - response, err = project.Service.Request(request, nil) - - return -} - -// ReceivePulsarEventNotificationEvents : Webhook for event notifications events -// This is a webhook for event notifications events. -func (project *ProjectV1) ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptions *ReceivePulsarEventNotificationEventsOptions) (response *core.DetailedResponse, err error) { - return project.ReceivePulsarEventNotificationEventsWithContext(context.Background(), receivePulsarEventNotificationEventsOptions) -} - -// ReceivePulsarEventNotificationEventsWithContext is an alternate form of the ReceivePulsarEventNotificationEvents method which supports a Context parameter -func (project *ProjectV1) ReceivePulsarEventNotificationEventsWithContext(ctx context.Context, receivePulsarEventNotificationEventsOptions *ReceivePulsarEventNotificationEventsOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(receivePulsarEventNotificationEventsOptions, "receivePulsarEventNotificationEventsOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(receivePulsarEventNotificationEventsOptions, "receivePulsarEventNotificationEventsOptions") - if err != nil { - return + pathParamsMap := map[string]string{ + "id": *postEventNotificationsIntegrationOptions.ID, } builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/pulsar/event_notification_events`, nil) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range receivePulsarEventNotificationEventsOptions.Headers { + for headerName, headerValue := range postEventNotificationsIntegrationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("project", "V1", "ReceivePulsarEventNotificationEvents") + sdkHeaders := common.GetSdkHeaders("project", "V1", "PostEventNotificationsIntegration") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") - _, err = builder.SetBodyContentJSON(receivePulsarEventNotificationEventsOptions.PulsarEventNotificationEvents) - if err != nil { - return + body := make(map[string]interface{}) + if postEventNotificationsIntegrationOptions.InstanceCrn != nil { + body["instance_crn"] = postEventNotificationsIntegrationOptions.InstanceCrn } - - request, err := builder.Build() - if err != nil { - return + if postEventNotificationsIntegrationOptions.Description != nil { + body["description"] = postEventNotificationsIntegrationOptions.Description } - - response, err = project.Service.Request(request, nil) - - return -} - -// GetHealth : Get service health information -// Get service health information. -func (project *ProjectV1) GetHealth(getHealthOptions *GetHealthOptions) (result *Health, response *core.DetailedResponse, err error) { - return project.GetHealthWithContext(context.Background(), getHealthOptions) -} - -// GetHealthWithContext is an alternate form of the GetHealth method which supports a Context parameter -func (project *ProjectV1) GetHealthWithContext(ctx context.Context, getHealthOptions *GetHealthOptions) (result *Health, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(getHealthOptions, "getHealthOptions") - if err != nil { - return + if postEventNotificationsIntegrationOptions.EventNotificationsSourceName != nil { + body["event_notifications_source_name"] = postEventNotificationsIntegrationOptions.EventNotificationsSourceName } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/health`, nil) + if postEventNotificationsIntegrationOptions.Enabled != nil { + body["enabled"] = postEventNotificationsIntegrationOptions.Enabled + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } - for headerName, headerValue := range getHealthOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "GetHealth") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - if getHealthOptions.Info != nil { - builder.AddQuery("info", fmt.Sprint(*getHealthOptions.Info)) - } - request, err := builder.Build() if err != nil { return @@ -1718,7 +1638,7 @@ func (project *ProjectV1) GetHealthWithContext(ctx context.Context, getHealthOpt return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalHealth) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNotificationsIntegrationPostResponse) if err != nil { return } @@ -1728,84 +1648,44 @@ func (project *ProjectV1) GetHealthWithContext(ctx context.Context, getHealthOpt return } -// ReplaceServiceInstance : Create a new service instance -// Create a new service instance Create a service instance. When the service broker receives a provision request from -// the IBM Cloud platform, it MUST take whatever action is necessary to create a new resource. When a user creates a -// service instance from the IBM Cloud console or the IBM Cloud CLI, the IBM Cloud platform validates that the user has -// permission to create the service instance by using IBM Cloud IAM. After this validation occurs, your service broker's -// provision endpoint (PUT /v2/resource_instances/:instance_id) will be invoked. When provisioning occurs, the IBM Cloud -// platform provides the following values: -// - The IBM Cloud context is included in the context variable - The X-Broker-API-Originating-Identity will have the IBM -// IAM ID of the user that initiated the request - The parameters section will include the requested location (and -// additional parameters required by your service). -func (project *ProjectV1) ReplaceServiceInstance(replaceServiceInstanceOptions *ReplaceServiceInstanceOptions) (result *ResourceCreateResponse, response *core.DetailedResponse, err error) { - return project.ReplaceServiceInstanceWithContext(context.Background(), replaceServiceInstanceOptions) +// GetEventNotificationsIntegration : Get event notification source details by project ID +// Gets the source details of the project from the connect event notifications instance. +func (project *ProjectV1) GetEventNotificationsIntegration(getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions) (result *NotificationsIntegrationGetResponse, response *core.DetailedResponse, err error) { + return project.GetEventNotificationsIntegrationWithContext(context.Background(), getEventNotificationsIntegrationOptions) } -// ReplaceServiceInstanceWithContext is an alternate form of the ReplaceServiceInstance method which supports a Context parameter -func (project *ProjectV1) ReplaceServiceInstanceWithContext(ctx context.Context, replaceServiceInstanceOptions *ReplaceServiceInstanceOptions) (result *ResourceCreateResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceServiceInstanceOptions, "replaceServiceInstanceOptions cannot be nil") +// GetEventNotificationsIntegrationWithContext is an alternate form of the GetEventNotificationsIntegration method which supports a Context parameter +func (project *ProjectV1) GetEventNotificationsIntegrationWithContext(ctx context.Context, getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions) (result *NotificationsIntegrationGetResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEventNotificationsIntegrationOptions, "getEventNotificationsIntegrationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(replaceServiceInstanceOptions, "replaceServiceInstanceOptions") + err = core.ValidateStruct(getEventNotificationsIntegrationOptions, "getEventNotificationsIntegrationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *replaceServiceInstanceOptions.InstanceID, + "id": *getEventNotificationsIntegrationOptions.ID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v2/service_instances/{instance_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range replaceServiceInstanceOptions.Headers { + for headerName, headerValue := range getEventNotificationsIntegrationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("project", "V1", "ReplaceServiceInstance") + sdkHeaders := common.GetSdkHeaders("project", "V1", "GetEventNotificationsIntegration") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - if replaceServiceInstanceOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*replaceServiceInstanceOptions.XBrokerApiVersion)) - } - if replaceServiceInstanceOptions.XBrokerApiOriginatingIdentity != nil { - builder.AddHeader("X-Broker-Api-Originating-Identity", fmt.Sprint(*replaceServiceInstanceOptions.XBrokerApiOriginatingIdentity)) - } - - if replaceServiceInstanceOptions.AcceptsIncomplete != nil { - builder.AddQuery("accepts_incomplete", fmt.Sprint(*replaceServiceInstanceOptions.AcceptsIncomplete)) - } - - body := make(map[string]interface{}) - if replaceServiceInstanceOptions.ServiceID != nil { - body["service_id"] = replaceServiceInstanceOptions.ServiceID - } - if replaceServiceInstanceOptions.PlanID != nil { - body["plan_id"] = replaceServiceInstanceOptions.PlanID - } - if replaceServiceInstanceOptions.Context != nil { - body["context"] = replaceServiceInstanceOptions.Context - } - if replaceServiceInstanceOptions.Parameters != nil { - body["parameters"] = replaceServiceInstanceOptions.Parameters - } - if replaceServiceInstanceOptions.PreviousValues != nil { - body["previous_values"] = replaceServiceInstanceOptions.PreviousValues - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } request, err := builder.Build() if err != nil { @@ -1818,7 +1698,7 @@ func (project *ProjectV1) ReplaceServiceInstanceWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalResourceCreateResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNotificationsIntegrationGetResponse) if err != nil { return } @@ -1828,131 +1708,102 @@ func (project *ProjectV1) ReplaceServiceInstanceWithContext(ctx context.Context, return } -// DeleteServiceInstance : Delete a project service instance -// Delete (deprovision) a project service instance by GUID. When a service broker receives a delete request from the IBM -// Cloud platform, it MUST delete any resources it created during the provision. Usually this means that all resources -// are immediately reclaimed for future provisions. -func (project *ProjectV1) DeleteServiceInstance(deleteServiceInstanceOptions *DeleteServiceInstanceOptions) (result *ResourceDeleteResponse, response *core.DetailedResponse, err error) { - return project.DeleteServiceInstanceWithContext(context.Background(), deleteServiceInstanceOptions) +// DeleteEventNotificationsIntegration : Delete an event notifications connection +// Deletes the event notifications integration if that is where the project was onboarded to. +func (project *ProjectV1) DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptions *DeleteEventNotificationsIntegrationOptions) (response *core.DetailedResponse, err error) { + return project.DeleteEventNotificationsIntegrationWithContext(context.Background(), deleteEventNotificationsIntegrationOptions) } -// DeleteServiceInstanceWithContext is an alternate form of the DeleteServiceInstance method which supports a Context parameter -func (project *ProjectV1) DeleteServiceInstanceWithContext(ctx context.Context, deleteServiceInstanceOptions *DeleteServiceInstanceOptions) (result *ResourceDeleteResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteServiceInstanceOptions, "deleteServiceInstanceOptions cannot be nil") +// DeleteEventNotificationsIntegrationWithContext is an alternate form of the DeleteEventNotificationsIntegration method which supports a Context parameter +func (project *ProjectV1) DeleteEventNotificationsIntegrationWithContext(ctx context.Context, deleteEventNotificationsIntegrationOptions *DeleteEventNotificationsIntegrationOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteEventNotificationsIntegrationOptions, "deleteEventNotificationsIntegrationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(deleteServiceInstanceOptions, "deleteServiceInstanceOptions") + err = core.ValidateStruct(deleteEventNotificationsIntegrationOptions, "deleteEventNotificationsIntegrationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *deleteServiceInstanceOptions.InstanceID, + "id": *deleteEventNotificationsIntegrationOptions.ID, } builder := core.NewRequestBuilder(core.DELETE) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v2/service_instances/{instance_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range deleteServiceInstanceOptions.Headers { + for headerName, headerValue := range deleteEventNotificationsIntegrationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("project", "V1", "DeleteServiceInstance") + sdkHeaders := common.GetSdkHeaders("project", "V1", "DeleteEventNotificationsIntegration") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - builder.AddHeader("Accept", "application/json") - if deleteServiceInstanceOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*deleteServiceInstanceOptions.XBrokerApiVersion)) - } - if deleteServiceInstanceOptions.XBrokerApiOriginatingIdentity != nil { - builder.AddHeader("X-Broker-Api-Originating-Identity", fmt.Sprint(*deleteServiceInstanceOptions.XBrokerApiOriginatingIdentity)) - } - - builder.AddQuery("plan_id", fmt.Sprint(*deleteServiceInstanceOptions.PlanID)) - builder.AddQuery("service_id", fmt.Sprint(*deleteServiceInstanceOptions.ServiceID)) - if deleteServiceInstanceOptions.AcceptsIncomplete != nil { - builder.AddQuery("accepts_incomplete", fmt.Sprint(*deleteServiceInstanceOptions.AcceptsIncomplete)) - } request, err := builder.Build() if err != nil { return } - var rawResponse map[string]json.RawMessage - response, err = project.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalResourceDeleteResponse) - if err != nil { - return - } - response.Result = result - } + response, err = project.Service.Request(request, nil) return } -// UpdateServiceInstance : Change of plans and service parameters in a provisioned service instance -// Allows an update to the plans and service parameters in a provisioned service instance. -func (project *ProjectV1) UpdateServiceInstance(updateServiceInstanceOptions *UpdateServiceInstanceOptions) (result *ResourceUpdateResult, response *core.DetailedResponse, err error) { - return project.UpdateServiceInstanceWithContext(context.Background(), updateServiceInstanceOptions) +// PostTestEventNotification : Send notification to event notifications instance +// Sends a notification to the event notifications instance. +func (project *ProjectV1) PostTestEventNotification(postTestEventNotificationOptions *PostTestEventNotificationOptions) (result *NotificationsIntegrationTestPostResponse, response *core.DetailedResponse, err error) { + return project.PostTestEventNotificationWithContext(context.Background(), postTestEventNotificationOptions) } -// UpdateServiceInstanceWithContext is an alternate form of the UpdateServiceInstance method which supports a Context parameter -func (project *ProjectV1) UpdateServiceInstanceWithContext(ctx context.Context, updateServiceInstanceOptions *UpdateServiceInstanceOptions) (result *ResourceUpdateResult, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(updateServiceInstanceOptions, "updateServiceInstanceOptions cannot be nil") +// PostTestEventNotificationWithContext is an alternate form of the PostTestEventNotification method which supports a Context parameter +func (project *ProjectV1) PostTestEventNotificationWithContext(ctx context.Context, postTestEventNotificationOptions *PostTestEventNotificationOptions) (result *NotificationsIntegrationTestPostResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(postTestEventNotificationOptions, "postTestEventNotificationOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(updateServiceInstanceOptions, "updateServiceInstanceOptions") + err = core.ValidateStruct(postTestEventNotificationOptions, "postTestEventNotificationOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *updateServiceInstanceOptions.InstanceID, + "id": *postTestEventNotificationOptions.ID, } - builder := core.NewRequestBuilder(core.PATCH) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v2/service_instances/{instance_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications/test`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range updateServiceInstanceOptions.Headers { + for headerName, headerValue := range postTestEventNotificationOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("project", "V1", "UpdateServiceInstance") + sdkHeaders := common.GetSdkHeaders("project", "V1", "PostTestEventNotification") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json-patch+json") - if updateServiceInstanceOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*updateServiceInstanceOptions.XBrokerApiVersion)) - } - if updateServiceInstanceOptions.XBrokerApiOriginatingIdentity != nil { - builder.AddHeader("X-Broker-Api-Originating-Identity", fmt.Sprint(*updateServiceInstanceOptions.XBrokerApiOriginatingIdentity)) - } + builder.AddHeader("Content-Type", "application/json") - if updateServiceInstanceOptions.AcceptsIncomplete != nil { - builder.AddQuery("accepts_incomplete", fmt.Sprint(*updateServiceInstanceOptions.AcceptsIncomplete)) + body := make(map[string]interface{}) + if postTestEventNotificationOptions.Ibmendefaultlong != nil { + body["ibmendefaultlong"] = postTestEventNotificationOptions.Ibmendefaultlong } - - _, err = builder.SetBodyContentJSON(updateServiceInstanceOptions.JSONPatchOperation) + if postTestEventNotificationOptions.Ibmendefaultshort != nil { + body["ibmendefaultshort"] = postTestEventNotificationOptions.Ibmendefaultshort + } + _, err = builder.SetBodyContentJSON(body) if err != nil { return } @@ -1968,7 +1819,7 @@ func (project *ProjectV1) UpdateServiceInstanceWithContext(ctx context.Context, return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalResourceUpdateResult) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNotificationsIntegrationTestPostResponse) if err != nil { return } @@ -1978,56 +1829,56 @@ func (project *ProjectV1) UpdateServiceInstanceWithContext(ctx context.Context, return } -// GetLastOperation : Get last_operation for instance by GUID -// Retrieve previous operation for service instance by GUID (for asynchronous provision calls). -func (project *ProjectV1) GetLastOperation(getLastOperationOptions *GetLastOperationOptions) (result *ResourceLastOperationGetResponse, response *core.DetailedResponse, err error) { - return project.GetLastOperationWithContext(context.Background(), getLastOperationOptions) +// ListComplianceProfiles : Get a list of Security and Compliance profiles for a project +// Get a list of Security and Compliance profiles for a specific project. +func (project *ProjectV1) ListComplianceProfiles(listComplianceProfilesOptions *ListComplianceProfilesOptions) (result *ComplianceProfileCollection, response *core.DetailedResponse, err error) { + return project.ListComplianceProfilesWithContext(context.Background(), listComplianceProfilesOptions) } -// GetLastOperationWithContext is an alternate form of the GetLastOperation method which supports a Context parameter -func (project *ProjectV1) GetLastOperationWithContext(ctx context.Context, getLastOperationOptions *GetLastOperationOptions) (result *ResourceLastOperationGetResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getLastOperationOptions, "getLastOperationOptions cannot be nil") +// ListComplianceProfilesWithContext is an alternate form of the ListComplianceProfiles method which supports a Context parameter +func (project *ProjectV1) ListComplianceProfilesWithContext(ctx context.Context, listComplianceProfilesOptions *ListComplianceProfilesOptions) (result *ComplianceProfileCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listComplianceProfilesOptions, "listComplianceProfilesOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(getLastOperationOptions, "getLastOperationOptions") + err = core.ValidateStruct(listComplianceProfilesOptions, "listComplianceProfilesOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *getLastOperationOptions.InstanceID, + "id": *listComplianceProfilesOptions.ID, } builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v2/service_instances/{instance_id}/last_operation`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/compliance_profiles`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range getLastOperationOptions.Headers { + for headerName, headerValue := range listComplianceProfilesOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("project", "V1", "GetLastOperation") + sdkHeaders := common.GetSdkHeaders("project", "V1", "ListComplianceProfiles") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if getLastOperationOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*getLastOperationOptions.XBrokerApiVersion)) + if listComplianceProfilesOptions.IbmTrustedProfileID != nil { + builder.AddHeader("Ibm-Trusted-Profile-Id", fmt.Sprint(*listComplianceProfilesOptions.IbmTrustedProfileID)) } - - if getLastOperationOptions.Operation != nil { - builder.AddQuery("operation", fmt.Sprint(*getLastOperationOptions.Operation)) + if listComplianceProfilesOptions.IbmCloudApiKey != nil { + builder.AddHeader("Ibm-Cloud-Api-Key", fmt.Sprint(*listComplianceProfilesOptions.IbmCloudApiKey)) } - if getLastOperationOptions.PlanID != nil { - builder.AddQuery("plan_id", fmt.Sprint(*getLastOperationOptions.PlanID)) + + if listComplianceProfilesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listComplianceProfilesOptions.Start)) } - if getLastOperationOptions.ServiceID != nil { - builder.AddQuery("service_id", fmt.Sprint(*getLastOperationOptions.ServiceID)) + if listComplianceProfilesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listComplianceProfilesOptions.Limit)) } request, err := builder.Build() @@ -2041,7 +1892,7 @@ func (project *ProjectV1) GetLastOperationWithContext(ctx context.Context, getLa return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalResourceLastOperationGetResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalComplianceProfileCollection) if err != nil { return } @@ -2051,68 +1902,57 @@ func (project *ProjectV1) GetLastOperationWithContext(ctx context.Context, getLa return } -// ReplaceServiceInstanceState : Update the state of a provisioned service instance -// Update (disable or enable) the state of a provisioned service instance. -func (project *ProjectV1) ReplaceServiceInstanceState(replaceServiceInstanceStateOptions *ReplaceServiceInstanceStateOptions) (result *ResourceStateResponse, response *core.DetailedResponse, err error) { - return project.ReplaceServiceInstanceStateWithContext(context.Background(), replaceServiceInstanceStateOptions) +// ListComplianceProfileAttachments : Get a list of Security and Compliance profiles for a project +// Get a list of Security and Compliance profiles for a specific project. +func (project *ProjectV1) ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptions *ListComplianceProfileAttachmentsOptions) (result *ComplianceProfileAttachmentCollection, response *core.DetailedResponse, err error) { + return project.ListComplianceProfileAttachmentsWithContext(context.Background(), listComplianceProfileAttachmentsOptions) } -// ReplaceServiceInstanceStateWithContext is an alternate form of the ReplaceServiceInstanceState method which supports a Context parameter -func (project *ProjectV1) ReplaceServiceInstanceStateWithContext(ctx context.Context, replaceServiceInstanceStateOptions *ReplaceServiceInstanceStateOptions) (result *ResourceStateResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceServiceInstanceStateOptions, "replaceServiceInstanceStateOptions cannot be nil") +// ListComplianceProfileAttachmentsWithContext is an alternate form of the ListComplianceProfileAttachments method which supports a Context parameter +func (project *ProjectV1) ListComplianceProfileAttachmentsWithContext(ctx context.Context, listComplianceProfileAttachmentsOptions *ListComplianceProfileAttachmentsOptions) (result *ComplianceProfileAttachmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listComplianceProfileAttachmentsOptions, "listComplianceProfileAttachmentsOptions cannot be nil") if err != nil { return } - err = core.ValidateStruct(replaceServiceInstanceStateOptions, "replaceServiceInstanceStateOptions") + err = core.ValidateStruct(listComplianceProfileAttachmentsOptions, "listComplianceProfileAttachmentsOptions") if err != nil { return } pathParamsMap := map[string]string{ - "instance_id": *replaceServiceInstanceStateOptions.InstanceID, + "id": *listComplianceProfileAttachmentsOptions.ID, + "profile_id": *listComplianceProfileAttachmentsOptions.ProfileID, } - builder := core.NewRequestBuilder(core.PUT) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/bluemix_v1/service_instances/{instance_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/compliance_profiles/{profile_id}/attachments`, pathParamsMap) if err != nil { return } - for headerName, headerValue := range replaceServiceInstanceStateOptions.Headers { + for headerName, headerValue := range listComplianceProfileAttachmentsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("project", "V1", "ReplaceServiceInstanceState") + sdkHeaders := common.GetSdkHeaders("project", "V1", "ListComplianceProfileAttachments") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - if replaceServiceInstanceStateOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*replaceServiceInstanceStateOptions.XBrokerApiVersion)) - } - - body := make(map[string]interface{}) - if replaceServiceInstanceStateOptions.Enabled != nil { - body["enabled"] = replaceServiceInstanceStateOptions.Enabled - } - if replaceServiceInstanceStateOptions.InitiatorID != nil { - body["initiator_id"] = replaceServiceInstanceStateOptions.InitiatorID + if listComplianceProfileAttachmentsOptions.IbmTrustedProfileID != nil { + builder.AddHeader("Ibm-Trusted-Profile-Id", fmt.Sprint(*listComplianceProfileAttachmentsOptions.IbmTrustedProfileID)) } - if replaceServiceInstanceStateOptions.ReasonCode != nil { - body["reason_code"] = replaceServiceInstanceStateOptions.ReasonCode + if listComplianceProfileAttachmentsOptions.IbmCloudApiKey != nil { + builder.AddHeader("Ibm-Cloud-Api-Key", fmt.Sprint(*listComplianceProfileAttachmentsOptions.IbmCloudApiKey)) } - if replaceServiceInstanceStateOptions.PlanID != nil { - body["plan_id"] = replaceServiceInstanceStateOptions.PlanID - } - if replaceServiceInstanceStateOptions.PreviousValues != nil { - body["previous_values"] = replaceServiceInstanceStateOptions.PreviousValues + + if listComplianceProfileAttachmentsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listComplianceProfileAttachmentsOptions.Start)) } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return + if listComplianceProfileAttachmentsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listComplianceProfileAttachmentsOptions.Limit)) } request, err := builder.Build() @@ -2126,7 +1966,7 @@ func (project *ProjectV1) ReplaceServiceInstanceStateWithContext(ctx context.Con return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalResourceStateResponse) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalComplianceProfileAttachmentCollection) if err != nil { return } @@ -2136,425 +1976,53 @@ func (project *ProjectV1) ReplaceServiceInstanceStateWithContext(ctx context.Con return } -// GetServiceInstance : Get the current state information -// Retrieve the current state for the specified service instance. -func (project *ProjectV1) GetServiceInstance(getServiceInstanceOptions *GetServiceInstanceOptions) (result *ResourceStateResponse, response *core.DetailedResponse, err error) { - return project.GetServiceInstanceWithContext(context.Background(), getServiceInstanceOptions) +// ActionJob : The response of a fetching an action job. +type ActionJob struct { + // The unique ID of a project. + ID *string `json:"id,omitempty"` } -// GetServiceInstanceWithContext is an alternate form of the GetServiceInstance method which supports a Context parameter -func (project *ProjectV1) GetServiceInstanceWithContext(ctx context.Context, getServiceInstanceOptions *GetServiceInstanceOptions) (result *ResourceStateResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getServiceInstanceOptions, "getServiceInstanceOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getServiceInstanceOptions, "getServiceInstanceOptions") +// UnmarshalActionJob unmarshals an instance of ActionJob from the specified map of raw messages. +func UnmarshalActionJob(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionJob) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - pathParamsMap := map[string]string{ - "instance_id": *getServiceInstanceOptions.InstanceID, - } +// ApproveOptions : The Approve options. +type ApproveOptions struct { + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/bluemix_v1/service_instances/{instance_id}`, pathParamsMap) - if err != nil { - return - } + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` - for headerName, headerValue := range getServiceInstanceOptions.Headers { - builder.AddHeader(headerName, headerValue) - } + // Notes on the project draft action. + Comment *string `json:"comment,omitempty"` - sdkHeaders := common.GetSdkHeaders("project", "V1", "GetServiceInstance") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - if getServiceInstanceOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*getServiceInstanceOptions.XBrokerApiVersion)) - } + // Determines whether the metadata should be returned. Only the metadata for the project is returned. + Complete *bool `json:"complete,omitempty"` - request, err := builder.Build() - if err != nil { - return - } + // Allows users to set headers on API requests + Headers map[string]string +} - var rawResponse map[string]json.RawMessage - response, err = project.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalResourceStateResponse) - if err != nil { - return - } - response.Result = result +// NewApproveOptions : Instantiate ApproveOptions +func (*ProjectV1) NewApproveOptions(projectID string, id string) *ApproveOptions { + return &ApproveOptions{ + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } - - return } -// GetCatalog : Get the catalog metadata -// Fetch the catalog metadata that's stored within the broker. -func (project *ProjectV1) GetCatalog(getCatalogOptions *GetCatalogOptions) (result *CatalogResponse, response *core.DetailedResponse, err error) { - return project.GetCatalogWithContext(context.Background(), getCatalogOptions) -} - -// GetCatalogWithContext is an alternate form of the GetCatalog method which supports a Context parameter -func (project *ProjectV1) GetCatalogWithContext(ctx context.Context, getCatalogOptions *GetCatalogOptions) (result *CatalogResponse, response *core.DetailedResponse, err error) { - err = core.ValidateStruct(getCatalogOptions, "getCatalogOptions") - if err != nil { - return - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v2/catalog`, nil) - if err != nil { - return - } - - for headerName, headerValue := range getCatalogOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "GetCatalog") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - if getCatalogOptions.XBrokerApiVersion != nil { - builder.AddHeader("X-Broker-Api-Version", fmt.Sprint(*getCatalogOptions.XBrokerApiVersion)) - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = project.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCatalogResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// PostEventNotificationsIntegration : Connect to a event notifications instance -// Connects a project instance to an event notifications instance. -func (project *ProjectV1) PostEventNotificationsIntegration(postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions) (result *NotificationsIntegrationPostResponse, response *core.DetailedResponse, err error) { - return project.PostEventNotificationsIntegrationWithContext(context.Background(), postEventNotificationsIntegrationOptions) -} - -// PostEventNotificationsIntegrationWithContext is an alternate form of the PostEventNotificationsIntegration method which supports a Context parameter -func (project *ProjectV1) PostEventNotificationsIntegrationWithContext(ctx context.Context, postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions) (result *NotificationsIntegrationPostResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(postEventNotificationsIntegrationOptions, "postEventNotificationsIntegrationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(postEventNotificationsIntegrationOptions, "postEventNotificationsIntegrationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *postEventNotificationsIntegrationOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range postEventNotificationsIntegrationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "PostEventNotificationsIntegration") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - body := make(map[string]interface{}) - if postEventNotificationsIntegrationOptions.InstanceCrn != nil { - body["instance_crn"] = postEventNotificationsIntegrationOptions.InstanceCrn - } - if postEventNotificationsIntegrationOptions.Description != nil { - body["description"] = postEventNotificationsIntegrationOptions.Description - } - if postEventNotificationsIntegrationOptions.EventNotificationsSourceName != nil { - body["event_notifications_source_name"] = postEventNotificationsIntegrationOptions.EventNotificationsSourceName - } - if postEventNotificationsIntegrationOptions.Enabled != nil { - body["enabled"] = postEventNotificationsIntegrationOptions.Enabled - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = project.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNotificationsIntegrationPostResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// GetEventNotificationsIntegration : Get event notification source details by project ID -// Gets the source details of the project from the connect event notifications instance. -func (project *ProjectV1) GetEventNotificationsIntegration(getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions) (result *NotificationsIntegrationGetResponse, response *core.DetailedResponse, err error) { - return project.GetEventNotificationsIntegrationWithContext(context.Background(), getEventNotificationsIntegrationOptions) -} - -// GetEventNotificationsIntegrationWithContext is an alternate form of the GetEventNotificationsIntegration method which supports a Context parameter -func (project *ProjectV1) GetEventNotificationsIntegrationWithContext(ctx context.Context, getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions) (result *NotificationsIntegrationGetResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getEventNotificationsIntegrationOptions, "getEventNotificationsIntegrationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(getEventNotificationsIntegrationOptions, "getEventNotificationsIntegrationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *getEventNotificationsIntegrationOptions.ID, - } - - builder := core.NewRequestBuilder(core.GET) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range getEventNotificationsIntegrationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "GetEventNotificationsIntegration") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = project.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNotificationsIntegrationGetResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// DeleteEventNotificationsIntegration : Delete an event notifications connection -// Deletes the event notifications integration if that is where the project was onboarded to. -func (project *ProjectV1) DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptions *DeleteEventNotificationsIntegrationOptions) (response *core.DetailedResponse, err error) { - return project.DeleteEventNotificationsIntegrationWithContext(context.Background(), deleteEventNotificationsIntegrationOptions) -} - -// DeleteEventNotificationsIntegrationWithContext is an alternate form of the DeleteEventNotificationsIntegration method which supports a Context parameter -func (project *ProjectV1) DeleteEventNotificationsIntegrationWithContext(ctx context.Context, deleteEventNotificationsIntegrationOptions *DeleteEventNotificationsIntegrationOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteEventNotificationsIntegrationOptions, "deleteEventNotificationsIntegrationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(deleteEventNotificationsIntegrationOptions, "deleteEventNotificationsIntegrationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *deleteEventNotificationsIntegrationOptions.ID, - } - - builder := core.NewRequestBuilder(core.DELETE) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range deleteEventNotificationsIntegrationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "DeleteEventNotificationsIntegration") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - - request, err := builder.Build() - if err != nil { - return - } - - response, err = project.Service.Request(request, nil) - - return -} - -// PostTestEventNotification : Send notification to event notifications instance -// Sends a notification to the event notifications instance. -func (project *ProjectV1) PostTestEventNotification(postTestEventNotificationOptions *PostTestEventNotificationOptions) (result *NotificationsIntegrationTestPostResponse, response *core.DetailedResponse, err error) { - return project.PostTestEventNotificationWithContext(context.Background(), postTestEventNotificationOptions) -} - -// PostTestEventNotificationWithContext is an alternate form of the PostTestEventNotification method which supports a Context parameter -func (project *ProjectV1) PostTestEventNotificationWithContext(ctx context.Context, postTestEventNotificationOptions *PostTestEventNotificationOptions) (result *NotificationsIntegrationTestPostResponse, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(postTestEventNotificationOptions, "postTestEventNotificationOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(postTestEventNotificationOptions, "postTestEventNotificationOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "id": *postTestEventNotificationOptions.ID, - } - - builder := core.NewRequestBuilder(core.POST) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = project.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(project.Service.Options.URL, `/v1/projects/{id}/event_notifications/test`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range postTestEventNotificationOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("project", "V1", "PostTestEventNotification") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - body := make(map[string]interface{}) - if postTestEventNotificationOptions.Ibmendefaultlong != nil { - body["ibmendefaultlong"] = postTestEventNotificationOptions.Ibmendefaultlong - } - if postTestEventNotificationOptions.Ibmendefaultshort != nil { - body["ibmendefaultshort"] = postTestEventNotificationOptions.Ibmendefaultshort - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = project.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalNotificationsIntegrationTestPostResponse) - if err != nil { - return - } - response.Result = result - } - - return -} - -// ActionJob : The response of a fetching an action job. -type ActionJob struct { - // The unique ID of a project. - ID *string `json:"id,omitempty"` -} - -// UnmarshalActionJob unmarshals an instance of ActionJob from the specified map of raw messages. -func UnmarshalActionJob(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionJob) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ApproveOptions : The Approve options. -type ApproveOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` - - // The ID of the configuration, which uniquely identifies it. - ConfigID *string `json:"config_id" validate:"required,ne="` - - // Notes on the project draft action. - Comment *string `json:"comment,omitempty"` - - // The flag to determine if full metadata should be returned. - Complete *bool `json:"complete,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewApproveOptions : Instantiate ApproveOptions -func (*ProjectV1) NewApproveOptions(id string, configID string) *ApproveOptions { - return &ApproveOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), - } +// SetProjectID : Allow user to set ProjectID +func (_options *ApproveOptions) SetProjectID(projectID string) *ApproveOptions { + _options.ProjectID = core.StringPtr(projectID) + return _options } // SetID : Allow user to set ID @@ -2563,12 +2031,6 @@ func (_options *ApproveOptions) SetID(id string) *ApproveOptions { return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *ApproveOptions) SetConfigID(configID string) *ApproveOptions { - _options.ConfigID = core.StringPtr(configID) - return _options -} - // SetComment : Allow user to set Comment func (_options *ApproveOptions) SetComment(comment string) *ApproveOptions { _options.Comment = core.StringPtr(comment) @@ -2581,283 +2043,50 @@ func (_options *ApproveOptions) SetComplete(complete bool) *ApproveOptions { return _options } -// SetHeaders : Allow user to set Headers -func (options *ApproveOptions) SetHeaders(param map[string]string) *ApproveOptions { - options.Headers = param - return options -} - -// CatalogResponse : Response from fetching the catalog metadata stored within the broker. -type CatalogResponse struct { - // The collection of catalog services. - Services []CatalogResponseServices `json:"services,omitempty"` -} - -// UnmarshalCatalogResponse unmarshals an instance of CatalogResponse from the specified map of raw messages. -func UnmarshalCatalogResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogResponse) - err = core.UnmarshalModel(m, "services", &obj.Services, UnmarshalCatalogResponseServices) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogResponseServices : Catalog service structure. -type CatalogResponseServices struct { - // Specifies if your service can be bound to applications in IBM Cloud. If a service is bindable, it must be able to - // return API endpoints and credentials to your service users. - Bindable *bool `json:"bindable,omitempty"` - - // A short description of the service. It must be a non-empty string. This description is not displayed by the IBM - // Cloud console or the IBM Cloud CLI. - Description *string `json:"description,omitempty"` - - // An identifier used to correlate this service in future requests to the broker. This must be globally unique within - // the IBM Cloud platform. It must be a non-empty string, and using a GUID is recommended. If you define your service - // in the Resource Management Console, RMC generates a globally unique GUID service ID that you can use in your service - // broker.". - ID *string `json:"id,omitempty"` - - // The catalog service metadata. - Metadata *CatalogResponseServicesMetadata `json:"metadata,omitempty"` - - // This service name isn't your display name. Your service name must meet the following criteria: It must be all - // lowercase. It can't include spaces but can include hyphens (-). It must be less than 32 characters. Your service - // name should include your company name. If your company has more then one offering, your service name should include - // both the company and offering as part of the name. For example, the Compose company has offerings for Redis and - // Elasticsearch. Sample service names on IBM Cloud for these offerings would be 'compose-redis' and - // 'compose-elasticsearch'. Both service names have associated display names that are shown in the IBM Cloud catalog: - // Compose Redis and Compose Elasticsearch. Another company (e.g. FastJetMail) might only have the single JetMail - // offering, in which case the service name should be 'fastjetmail'. If you define your service in the Resource - // Management Console, you can export a catalog.j-son that includes the service name you defined within the RMC. - Name *string `json:"name,omitempty"` - - // The default is false. This specifies if your support plan changes for provisioned instances. If your offering - // supports multiple plans, and you want users to be able to change plans for a provisioned instance, you must enable - // the ability for users to update their service instances by using /v2/service_instances/{instance_id} PATCH. - PlanUpdateable *bool `json:"plan_updateable,omitempty"` - - // The collection of catalog service tags. - Tags []string `json:"tags,omitempty"` - - // A list of plans for this service that must contain at least one plan. - Plans []CatalogResponseServicesPlans `json:"plans,omitempty"` -} - -// UnmarshalCatalogResponseServices unmarshals an instance of CatalogResponseServices from the specified map of raw messages. -func UnmarshalCatalogResponseServices(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogResponseServices) - err = core.UnmarshalPrimitive(m, "bindable", &obj.Bindable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata", &obj.Metadata, UnmarshalCatalogResponseServicesMetadata) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "plan_updateable", &obj.PlanUpdateable) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "tags", &obj.Tags) - if err != nil { - return - } - err = core.UnmarshalModel(m, "plans", &obj.Plans, UnmarshalCatalogResponseServicesPlans) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogResponseServicesMetadata : The catalog service metadata. -type CatalogResponseServicesMetadata struct { - // The catalog service name. - DisplayName *string `json:"display_name,omitempty"` - - // The catalog service documentation URL. - DocumentationURL *string `json:"documentation_url,omitempty"` - - // The catalog service image URL. - ImageURL *string `json:"image_url,omitempty"` - - // The catalog service instructions URL. - InstructionsURL *string `json:"instructions_url,omitempty"` - - // The catalog service long description. - LongDescription *string `json:"long_description,omitempty"` - - // The catalog service provider display name. - ProviderDisplayName *string `json:"provider_display_name,omitempty"` - - // The catalog service support URL. - SupportURL *string `json:"support_url,omitempty"` - - // The catalog service terms URL. - TermsURL *string `json:"terms_url,omitempty"` -} - -// UnmarshalCatalogResponseServicesMetadata unmarshals an instance of CatalogResponseServicesMetadata from the specified map of raw messages. -func UnmarshalCatalogResponseServicesMetadata(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogResponseServicesMetadata) - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "documentation_url", &obj.DocumentationURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "image_url", &obj.ImageURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "instructions_url", &obj.InstructionsURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "long_description", &obj.LongDescription) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "provider_display_name", &obj.ProviderDisplayName) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "support_url", &obj.SupportURL) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "terms_url", &obj.TermsURL) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogResponseServicesPlans : The catalog service plan. -type CatalogResponseServicesPlans struct { - // The catalog service plan description. - Description *string `json:"description,omitempty"` - - // The catalog service plan subscription level. - Free *bool `json:"free,omitempty"` - - // The catalog service plan subscription ID. - ID *string `json:"id,omitempty"` - - // The catalog service plan metadata. - Metadata *CatalogResponseServicesPlansMetadata `json:"metadata,omitempty"` - - // The catalog service plan name. - Name *string `json:"name,omitempty"` -} - -// UnmarshalCatalogResponseServicesPlans unmarshals an instance of CatalogResponseServicesPlans from the specified map of raw messages. -func UnmarshalCatalogResponseServicesPlans(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogResponseServicesPlans) - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "free", &obj.Free) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata", &obj.Metadata, UnmarshalCatalogResponseServicesPlansMetadata) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// CatalogResponseServicesPlansMetadata : The catalog service plan metadata. -type CatalogResponseServicesPlansMetadata struct { - // The catalog service plan metadata bullets. - Bullets []string `json:"bullets,omitempty"` - - // The catalog service plan metadata name. - DisplayName *string `json:"display_name,omitempty"` -} - -// UnmarshalCatalogResponseServicesPlansMetadata unmarshals an instance of CatalogResponseServicesPlansMetadata from the specified map of raw messages. -func UnmarshalCatalogResponseServicesPlansMetadata(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(CatalogResponseServicesPlansMetadata) - err = core.UnmarshalPrimitive(m, "bullets", &obj.Bullets) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetHeaders : Allow user to set Headers +func (options *ApproveOptions) SetHeaders(param map[string]string) *ApproveOptions { + options.Headers = param + return options } // CheckConfigOptions : The CheckConfig options. type CheckConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration to trigger a validation check. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // The IAM refresh token. XAuthRefreshToken *string `json:"X-Auth-Refresh-Token,omitempty"` + // Determines whether the metadata should be returned. Only the metadata for the project is returned. + Complete *bool `json:"complete,omitempty"` + // The version of the configuration that the validation check should trigger against. Version *string `json:"version,omitempty"` - // The flag to determine if full metadata should be returned. - Complete *bool `json:"complete,omitempty"` - // Allows users to set headers on API requests Headers map[string]string } // NewCheckConfigOptions : Instantiate CheckConfigOptions -func (*ProjectV1) NewCheckConfigOptions(id string, configID string) *CheckConfigOptions { +func (*ProjectV1) NewCheckConfigOptions(projectID string, id string) *CheckConfigOptions { return &CheckConfigOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *CheckConfigOptions) SetID(id string) *CheckConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *CheckConfigOptions) SetProjectID(projectID string) *CheckConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *CheckConfigOptions) SetConfigID(configID string) *CheckConfigOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *CheckConfigOptions) SetID(id string) *CheckConfigOptions { + _options.ID = core.StringPtr(id) return _options } @@ -2867,24 +2096,180 @@ func (_options *CheckConfigOptions) SetXAuthRefreshToken(xAuthRefreshToken strin return _options } -// SetVersion : Allow user to set Version -func (_options *CheckConfigOptions) SetVersion(version string) *CheckConfigOptions { - _options.Version = core.StringPtr(version) - return _options -} - // SetComplete : Allow user to set Complete func (_options *CheckConfigOptions) SetComplete(complete bool) *CheckConfigOptions { _options.Complete = core.BoolPtr(complete) return _options } +// SetVersion : Allow user to set Version +func (_options *CheckConfigOptions) SetVersion(version string) *CheckConfigOptions { + _options.Version = core.StringPtr(version) + return _options +} + // SetHeaders : Allow user to set Headers func (options *CheckConfigOptions) SetHeaders(param map[string]string) *CheckConfigOptions { options.Headers = param return options } +// ComplianceProfile : The profile fetched from Security and Compliance Center. +type ComplianceProfile struct { + + // Allows users to set arbitrary properties + additionalProperties map[string]interface{} +} + +// SetProperty allows the user to set an arbitrary property on an instance of ComplianceProfile +func (o *ComplianceProfile) SetProperty(key string, value interface{}) { + if o.additionalProperties == nil { + o.additionalProperties = make(map[string]interface{}) + } + o.additionalProperties[key] = value +} + +// SetProperties allows the user to set a map of arbitrary properties on an instance of ComplianceProfile +func (o *ComplianceProfile) SetProperties(m map[string]interface{}) { + o.additionalProperties = make(map[string]interface{}) + for k, v := range m { + o.additionalProperties[k] = v + } +} + +// GetProperty allows the user to retrieve an arbitrary property from an instance of ComplianceProfile +func (o *ComplianceProfile) GetProperty(key string) interface{} { + return o.additionalProperties[key] +} + +// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of ComplianceProfile +func (o *ComplianceProfile) GetProperties() map[string]interface{} { + return o.additionalProperties +} + +// MarshalJSON performs custom serialization for instances of ComplianceProfile +func (o *ComplianceProfile) MarshalJSON() (buffer []byte, err error) { + m := make(map[string]interface{}) + if len(o.additionalProperties) > 0 { + for k, v := range o.additionalProperties { + m[k] = v + } + } + buffer, err = json.Marshal(m) + return +} + +// UnmarshalComplianceProfile unmarshals an instance of ComplianceProfile from the specified map of raw messages. +func UnmarshalComplianceProfile(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ComplianceProfile) + for k := range m { + var v interface{} + e := core.UnmarshalPrimitive(m, k, &v) + if e != nil { + err = e + return + } + obj.SetProperty(k, v) + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ComplianceProfileAttachment : The profile attachment fetched from Security and Compliance Center. +type ComplianceProfileAttachment struct { + + // Allows users to set arbitrary properties + additionalProperties map[string]interface{} +} + +// SetProperty allows the user to set an arbitrary property on an instance of ComplianceProfileAttachment +func (o *ComplianceProfileAttachment) SetProperty(key string, value interface{}) { + if o.additionalProperties == nil { + o.additionalProperties = make(map[string]interface{}) + } + o.additionalProperties[key] = value +} + +// SetProperties allows the user to set a map of arbitrary properties on an instance of ComplianceProfileAttachment +func (o *ComplianceProfileAttachment) SetProperties(m map[string]interface{}) { + o.additionalProperties = make(map[string]interface{}) + for k, v := range m { + o.additionalProperties[k] = v + } +} + +// GetProperty allows the user to retrieve an arbitrary property from an instance of ComplianceProfileAttachment +func (o *ComplianceProfileAttachment) GetProperty(key string) interface{} { + return o.additionalProperties[key] +} + +// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of ComplianceProfileAttachment +func (o *ComplianceProfileAttachment) GetProperties() map[string]interface{} { + return o.additionalProperties +} + +// MarshalJSON performs custom serialization for instances of ComplianceProfileAttachment +func (o *ComplianceProfileAttachment) MarshalJSON() (buffer []byte, err error) { + m := make(map[string]interface{}) + if len(o.additionalProperties) > 0 { + for k, v := range o.additionalProperties { + m[k] = v + } + } + buffer, err = json.Marshal(m) + return +} + +// UnmarshalComplianceProfileAttachment unmarshals an instance of ComplianceProfileAttachment from the specified map of raw messages. +func UnmarshalComplianceProfileAttachment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ComplianceProfileAttachment) + for k := range m { + var v interface{} + e := core.UnmarshalPrimitive(m, k, &v) + if e != nil { + err = e + return + } + obj.SetProperty(k, v) + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ComplianceProfileAttachmentCollection : The response of fetching attachments for a given profile from Security and Compliance Center. +type ComplianceProfileAttachmentCollection struct { + // An array of Security and Compliance profile attachments. + Attachments []ComplianceProfileAttachment `json:"attachments,omitempty"` +} + +// UnmarshalComplianceProfileAttachmentCollection unmarshals an instance of ComplianceProfileAttachmentCollection from the specified map of raw messages. +func UnmarshalComplianceProfileAttachmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ComplianceProfileAttachmentCollection) + err = core.UnmarshalModel(m, "attachments", &obj.Attachments, UnmarshalComplianceProfileAttachment) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ComplianceProfileCollection : The response of fetching profiles from Security and Compliance Center. +type ComplianceProfileCollection struct { + // An array of Security and Compliance profiles. + ComplianceProfiles []ComplianceProfile `json:"compliance_profiles,omitempty"` +} + +// UnmarshalComplianceProfileCollection unmarshals an instance of ComplianceProfileCollection from the specified map of raw messages. +func UnmarshalComplianceProfileCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ComplianceProfileCollection) + err = core.UnmarshalModel(m, "compliance_profiles", &obj.ComplianceProfiles, UnmarshalComplianceProfile) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // CostEstimate : The cost estimate for the given configuration. type CostEstimate struct { @@ -2948,88 +2333,88 @@ func UnmarshalCostEstimate(m map[string]json.RawMessage, result interface{}) (er // CreateConfigOptions : The CreateConfig options. type CreateConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"-" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` // The configuration name. - NewName *string `json:"name" validate:"required"` + Name *string `json:"name" validate:"required"` - // The location ID of a project configuration manual property. - NewLocatorID *string `json:"locator_id" validate:"required"` + // A dotted value of catalogID.versionID. + LocatorID *string `json:"locator_id" validate:"required"` - // The unique ID of a project. - NewID *string `json:"id,omitempty"` + // The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration. + ID *string `json:"id,omitempty"` // A collection of configuration labels. - NewLabels []string `json:"labels,omitempty"` + Labels []string `json:"labels,omitempty"` // The project configuration description. - NewDescription *string `json:"description,omitempty"` + Description *string `json:"description,omitempty"` - // The inputs of a Schematics template property. - NewInput []ProjectConfigInputVariable `json:"input,omitempty"` + // The input values to use to deploy the configuration. + Input []ProjectConfigInputVariable `json:"input,omitempty"` - // An optional setting object that's passed to the cart API. - NewSetting []ProjectConfigSettingCollection `json:"setting,omitempty"` + // Schematics environment variables to use to deploy the configuration. + Setting []ProjectConfigSettingCollection `json:"setting,omitempty"` // Allows users to set headers on API requests Headers map[string]string } // NewCreateConfigOptions : Instantiate CreateConfigOptions -func (*ProjectV1) NewCreateConfigOptions(id string, newName string, newLocatorID string) *CreateConfigOptions { +func (*ProjectV1) NewCreateConfigOptions(projectID string, name string, locatorID string) *CreateConfigOptions { return &CreateConfigOptions{ - ID: core.StringPtr(id), - NewName: core.StringPtr(newName), - NewLocatorID: core.StringPtr(newLocatorID), + ProjectID: core.StringPtr(projectID), + Name: core.StringPtr(name), + LocatorID: core.StringPtr(locatorID), } } -// SetID : Allow user to set ID -func (_options *CreateConfigOptions) SetID(id string) *CreateConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *CreateConfigOptions) SetProjectID(projectID string) *CreateConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetNewName : Allow user to set NewName -func (_options *CreateConfigOptions) SetNewName(newName string) *CreateConfigOptions { - _options.NewName = core.StringPtr(newName) +// SetName : Allow user to set Name +func (_options *CreateConfigOptions) SetName(name string) *CreateConfigOptions { + _options.Name = core.StringPtr(name) return _options } -// SetNewLocatorID : Allow user to set NewLocatorID -func (_options *CreateConfigOptions) SetNewLocatorID(newLocatorID string) *CreateConfigOptions { - _options.NewLocatorID = core.StringPtr(newLocatorID) +// SetLocatorID : Allow user to set LocatorID +func (_options *CreateConfigOptions) SetLocatorID(locatorID string) *CreateConfigOptions { + _options.LocatorID = core.StringPtr(locatorID) return _options } -// SetNewID : Allow user to set NewID -func (_options *CreateConfigOptions) SetNewID(newID string) *CreateConfigOptions { - _options.NewID = core.StringPtr(newID) +// SetID : Allow user to set ID +func (_options *CreateConfigOptions) SetID(id string) *CreateConfigOptions { + _options.ID = core.StringPtr(id) return _options } -// SetNewLabels : Allow user to set NewLabels -func (_options *CreateConfigOptions) SetNewLabels(newLabels []string) *CreateConfigOptions { - _options.NewLabels = newLabels +// SetLabels : Allow user to set Labels +func (_options *CreateConfigOptions) SetLabels(labels []string) *CreateConfigOptions { + _options.Labels = labels return _options } -// SetNewDescription : Allow user to set NewDescription -func (_options *CreateConfigOptions) SetNewDescription(newDescription string) *CreateConfigOptions { - _options.NewDescription = core.StringPtr(newDescription) +// SetDescription : Allow user to set Description +func (_options *CreateConfigOptions) SetDescription(description string) *CreateConfigOptions { + _options.Description = core.StringPtr(description) return _options } -// SetNewInput : Allow user to set NewInput -func (_options *CreateConfigOptions) SetNewInput(newInput []ProjectConfigInputVariable) *CreateConfigOptions { - _options.NewInput = newInput +// SetInput : Allow user to set Input +func (_options *CreateConfigOptions) SetInput(input []ProjectConfigInputVariable) *CreateConfigOptions { + _options.Input = input return _options } -// SetNewSetting : Allow user to set NewSetting -func (_options *CreateConfigOptions) SetNewSetting(newSetting []ProjectConfigSettingCollection) *CreateConfigOptions { - _options.NewSetting = newSetting +// SetSetting : Allow user to set Setting +func (_options *CreateConfigOptions) SetSetting(setting []ProjectConfigSettingCollection) *CreateConfigOptions { + _options.Setting = setting return _options } @@ -3041,6 +2426,12 @@ func (options *CreateConfigOptions) SetHeaders(param map[string]string) *CreateC // CreateProjectOptions : The CreateProject options. type CreateProjectOptions struct { + // The resource group where the project's data and tools are created. + ResourceGroup *string `json:"resource_group" validate:"required"` + + // The location where the project's data and tools are created. + Location *string `json:"location" validate:"required"` + // The project name. Name *string `json:"name" validate:"required"` @@ -3050,23 +2441,31 @@ type CreateProjectOptions struct { // The project configurations. Configs []ProjectConfigPrototype `json:"configs,omitempty"` - // Group name of the customized collection of resources. - ResourceGroup *string `json:"resource_group,omitempty"` - - // Data center locations for resource deployment. - Location *string `json:"location,omitempty"` - // Allows users to set headers on API requests Headers map[string]string } // NewCreateProjectOptions : Instantiate CreateProjectOptions -func (*ProjectV1) NewCreateProjectOptions(name string) *CreateProjectOptions { +func (*ProjectV1) NewCreateProjectOptions(resourceGroup string, location string, name string) *CreateProjectOptions { return &CreateProjectOptions{ + ResourceGroup: core.StringPtr(resourceGroup), + Location: core.StringPtr(location), Name: core.StringPtr(name), } } +// SetResourceGroup : Allow user to set ResourceGroup +func (_options *CreateProjectOptions) SetResourceGroup(resourceGroup string) *CreateProjectOptions { + _options.ResourceGroup = core.StringPtr(resourceGroup) + return _options +} + +// SetLocation : Allow user to set Location +func (_options *CreateProjectOptions) SetLocation(location string) *CreateProjectOptions { + _options.Location = core.StringPtr(location) + return _options +} + // SetName : Allow user to set Name func (_options *CreateProjectOptions) SetName(name string) *CreateProjectOptions { _options.Name = core.StringPtr(name) @@ -3085,18 +2484,6 @@ func (_options *CreateProjectOptions) SetConfigs(configs []ProjectConfigPrototyp return _options } -// SetResourceGroup : Allow user to set ResourceGroup -func (_options *CreateProjectOptions) SetResourceGroup(resourceGroup string) *CreateProjectOptions { - _options.ResourceGroup = core.StringPtr(resourceGroup) - return _options -} - -// SetLocation : Allow user to set Location -func (_options *CreateProjectOptions) SetLocation(location string) *CreateProjectOptions { - _options.Location = core.StringPtr(location) - return _options -} - // SetHeaders : Allow user to set Headers func (options *CreateProjectOptions) SetHeaders(param map[string]string) *CreateProjectOptions { options.Headers = param @@ -3143,11 +2530,11 @@ func UnmarshalCumulativeNeedsAttention(m map[string]json.RawMessage, result inte // DeleteConfigOptions : The DeleteConfig options. type DeleteConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration, which uniquely identifies it. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // The flag to determine if only the draft version should be deleted. DraftOnly *bool `json:"draft_only,omitempty"` @@ -3160,22 +2547,22 @@ type DeleteConfigOptions struct { } // NewDeleteConfigOptions : Instantiate DeleteConfigOptions -func (*ProjectV1) NewDeleteConfigOptions(id string, configID string) *DeleteConfigOptions { +func (*ProjectV1) NewDeleteConfigOptions(projectID string, id string) *DeleteConfigOptions { return &DeleteConfigOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *DeleteConfigOptions) SetID(id string) *DeleteConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *DeleteConfigOptions) SetProjectID(projectID string) *DeleteConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *DeleteConfigOptions) SetConfigID(configID string) *DeleteConfigOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *DeleteConfigOptions) SetID(id string) *DeleteConfigOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3199,7 +2586,7 @@ func (options *DeleteConfigOptions) SetHeaders(param map[string]string) *DeleteC // DeleteEventNotificationsIntegrationOptions : The DeleteEventNotificationsIntegration options. type DeleteEventNotificationsIntegrationOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests @@ -3227,7 +2614,7 @@ func (options *DeleteEventNotificationsIntegrationOptions) SetHeaders(param map[ // DeleteProjectOptions : The DeleteProject options. type DeleteProjectOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // The flag that indicates if the resources deployed by schematics should be destroyed. @@ -3241,118 +2628,39 @@ type DeleteProjectOptions struct { func (*ProjectV1) NewDeleteProjectOptions(id string) *DeleteProjectOptions { return &DeleteProjectOptions{ ID: core.StringPtr(id), - } -} - -// SetID : Allow user to set ID -func (_options *DeleteProjectOptions) SetID(id string) *DeleteProjectOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetDestroy : Allow user to set Destroy -func (_options *DeleteProjectOptions) SetDestroy(destroy bool) *DeleteProjectOptions { - _options.Destroy = core.BoolPtr(destroy) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *DeleteProjectOptions) SetHeaders(param map[string]string) *DeleteProjectOptions { - options.Headers = param - return options -} - -// DeleteServiceInstanceOptions : The DeleteServiceInstance options. -type DeleteServiceInstanceOptions struct { - // The ID of a previously provisioned service instance. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The ID of the plan for which the service instance has been requested, which is stored in the catalog.json of your - // broker. This value should be a GUID. It MUST be a non-empty string. - PlanID *string `json:"plan_id" validate:"required"` - - // The ID of the service stored in the catalog.json of your broker. This value should be a GUID. It MUST be a non-empty - // string. - ServiceID *string `json:"service_id" validate:"required"` - - // Broker Api Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // Broker Api Originating Identity. - XBrokerApiOriginatingIdentity *string `json:"X-Broker-Api-Originating-Identity,omitempty"` - - // A value of true indicates that both the IBM Cloud platform and the requesting client support asynchronous - // deprovisioning. If this parameter is not included in the request, and the broker can only deprovision a service - // instance of the requested plan asynchronously, the broker MUST reject the request with a 422 Unprocessable Entity. - AcceptsIncomplete *bool `json:"accepts_incomplete,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewDeleteServiceInstanceOptions : Instantiate DeleteServiceInstanceOptions -func (*ProjectV1) NewDeleteServiceInstanceOptions(instanceID string, planID string, serviceID string) *DeleteServiceInstanceOptions { - return &DeleteServiceInstanceOptions{ - InstanceID: core.StringPtr(instanceID), - PlanID: core.StringPtr(planID), - ServiceID: core.StringPtr(serviceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *DeleteServiceInstanceOptions) SetInstanceID(instanceID string) *DeleteServiceInstanceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetPlanID : Allow user to set PlanID -func (_options *DeleteServiceInstanceOptions) SetPlanID(planID string) *DeleteServiceInstanceOptions { - _options.PlanID = core.StringPtr(planID) - return _options -} - -// SetServiceID : Allow user to set ServiceID -func (_options *DeleteServiceInstanceOptions) SetServiceID(serviceID string) *DeleteServiceInstanceOptions { - _options.ServiceID = core.StringPtr(serviceID) - return _options -} - -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *DeleteServiceInstanceOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *DeleteServiceInstanceOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options + } } -// SetXBrokerApiOriginatingIdentity : Allow user to set XBrokerApiOriginatingIdentity -func (_options *DeleteServiceInstanceOptions) SetXBrokerApiOriginatingIdentity(xBrokerApiOriginatingIdentity string) *DeleteServiceInstanceOptions { - _options.XBrokerApiOriginatingIdentity = core.StringPtr(xBrokerApiOriginatingIdentity) +// SetID : Allow user to set ID +func (_options *DeleteProjectOptions) SetID(id string) *DeleteProjectOptions { + _options.ID = core.StringPtr(id) return _options } -// SetAcceptsIncomplete : Allow user to set AcceptsIncomplete -func (_options *DeleteServiceInstanceOptions) SetAcceptsIncomplete(acceptsIncomplete bool) *DeleteServiceInstanceOptions { - _options.AcceptsIncomplete = core.BoolPtr(acceptsIncomplete) +// SetDestroy : Allow user to set Destroy +func (_options *DeleteProjectOptions) SetDestroy(destroy bool) *DeleteProjectOptions { + _options.Destroy = core.BoolPtr(destroy) return _options } // SetHeaders : Allow user to set Headers -func (options *DeleteServiceInstanceOptions) SetHeaders(param map[string]string) *DeleteServiceInstanceOptions { +func (options *DeleteProjectOptions) SetHeaders(param map[string]string) *DeleteProjectOptions { options.Headers = param return options } // ForceApproveOptions : The ForceApprove options. type ForceApproveOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration, which uniquely identifies it. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // Notes on the project draft action. Comment *string `json:"comment,omitempty"` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` // Allows users to set headers on API requests @@ -3360,22 +2668,22 @@ type ForceApproveOptions struct { } // NewForceApproveOptions : Instantiate ForceApproveOptions -func (*ProjectV1) NewForceApproveOptions(id string, configID string) *ForceApproveOptions { +func (*ProjectV1) NewForceApproveOptions(projectID string, id string) *ForceApproveOptions { return &ForceApproveOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *ForceApproveOptions) SetID(id string) *ForceApproveOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *ForceApproveOptions) SetProjectID(projectID string) *ForceApproveOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *ForceApproveOptions) SetConfigID(configID string) *ForceApproveOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *ForceApproveOptions) SetID(id string) *ForceApproveOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3397,61 +2705,35 @@ func (options *ForceApproveOptions) SetHeaders(param map[string]string) *ForceAp return options } -// GetCatalogOptions : The GetCatalog options. -type GetCatalogOptions struct { - // Broker API Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetCatalogOptions : Instantiate GetCatalogOptions -func (*ProjectV1) NewGetCatalogOptions() *GetCatalogOptions { - return &GetCatalogOptions{} -} - -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *GetCatalogOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *GetCatalogOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetCatalogOptions) SetHeaders(param map[string]string) *GetCatalogOptions { - options.Headers = param - return options -} - // GetConfigDiffOptions : The GetConfigDiff options. type GetConfigDiffOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration, which uniquely identifies it. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } // NewGetConfigDiffOptions : Instantiate GetConfigDiffOptions -func (*ProjectV1) NewGetConfigDiffOptions(id string, configID string) *GetConfigDiffOptions { +func (*ProjectV1) NewGetConfigDiffOptions(projectID string, id string) *GetConfigDiffOptions { return &GetConfigDiffOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *GetConfigDiffOptions) SetID(id string) *GetConfigDiffOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *GetConfigDiffOptions) SetProjectID(projectID string) *GetConfigDiffOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *GetConfigDiffOptions) SetConfigID(configID string) *GetConfigDiffOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *GetConfigDiffOptions) SetID(id string) *GetConfigDiffOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3463,16 +2745,16 @@ func (options *GetConfigDiffOptions) SetHeaders(param map[string]string) *GetCon // GetConfigOptions : The GetConfig options. type GetConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration, which uniquely identifies it. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // The version of the configuration to return. Version *string `json:"version,omitempty"` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` // Allows users to set headers on API requests @@ -3480,22 +2762,22 @@ type GetConfigOptions struct { } // NewGetConfigOptions : Instantiate GetConfigOptions -func (*ProjectV1) NewGetConfigOptions(id string, configID string) *GetConfigOptions { +func (*ProjectV1) NewGetConfigOptions(projectID string, id string) *GetConfigOptions { return &GetConfigOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *GetConfigOptions) SetID(id string) *GetConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *GetConfigOptions) SetProjectID(projectID string) *GetConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *GetConfigOptions) SetConfigID(configID string) *GetConfigOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *GetConfigOptions) SetID(id string) *GetConfigOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3519,11 +2801,11 @@ func (options *GetConfigOptions) SetHeaders(param map[string]string) *GetConfigO // GetCostEstimateOptions : The GetCostEstimate options. type GetCostEstimateOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration of the cost estimate to fetch. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // The version of the configuration that the cost estimate will fetch. Version *string `json:"version,omitempty"` @@ -3533,22 +2815,22 @@ type GetCostEstimateOptions struct { } // NewGetCostEstimateOptions : Instantiate GetCostEstimateOptions -func (*ProjectV1) NewGetCostEstimateOptions(id string, configID string) *GetCostEstimateOptions { +func (*ProjectV1) NewGetCostEstimateOptions(projectID string, id string) *GetCostEstimateOptions { return &GetCostEstimateOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *GetCostEstimateOptions) SetID(id string) *GetCostEstimateOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *GetCostEstimateOptions) SetProjectID(projectID string) *GetCostEstimateOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *GetCostEstimateOptions) SetConfigID(configID string) *GetCostEstimateOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *GetCostEstimateOptions) SetID(id string) *GetCostEstimateOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3566,7 +2848,7 @@ func (options *GetCostEstimateOptions) SetHeaders(param map[string]string) *GetC // GetEventNotificationsIntegrationOptions : The GetEventNotificationsIntegration options. type GetEventNotificationsIntegrationOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests @@ -3592,99 +2874,9 @@ func (options *GetEventNotificationsIntegrationOptions) SetHeaders(param map[str return options } -// GetHealthOptions : The GetHealth options. -type GetHealthOptions struct { - // Set this parameter if you want to get the version information in the output response. - Info *bool `json:"info,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetHealthOptions : Instantiate GetHealthOptions -func (*ProjectV1) NewGetHealthOptions() *GetHealthOptions { - return &GetHealthOptions{} -} - -// SetInfo : Allow user to set Info -func (_options *GetHealthOptions) SetInfo(info bool) *GetHealthOptions { - _options.Info = core.BoolPtr(info) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetHealthOptions) SetHeaders(param map[string]string) *GetHealthOptions { - options.Headers = param - return options -} - -// GetLastOperationOptions : The GetLastOperation options. -type GetLastOperationOptions struct { - // The unique instance ID generated during provisioning by the IBM Cloud platform. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Broker Api Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // A broker-provided identifier for the operation. - Operation *string `json:"operation,omitempty"` - - // ID of the plan from the catalog.json in your broker. - PlanID *string `json:"plan_id,omitempty"` - - // ID of the service from the catalog.json in your service broker. - ServiceID *string `json:"service_id,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetLastOperationOptions : Instantiate GetLastOperationOptions -func (*ProjectV1) NewGetLastOperationOptions(instanceID string) *GetLastOperationOptions { - return &GetLastOperationOptions{ - InstanceID: core.StringPtr(instanceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetLastOperationOptions) SetInstanceID(instanceID string) *GetLastOperationOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *GetLastOperationOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *GetLastOperationOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options -} - -// SetOperation : Allow user to set Operation -func (_options *GetLastOperationOptions) SetOperation(operation string) *GetLastOperationOptions { - _options.Operation = core.StringPtr(operation) - return _options -} - -// SetPlanID : Allow user to set PlanID -func (_options *GetLastOperationOptions) SetPlanID(planID string) *GetLastOperationOptions { - _options.PlanID = core.StringPtr(planID) - return _options -} - -// SetServiceID : Allow user to set ServiceID -func (_options *GetLastOperationOptions) SetServiceID(serviceID string) *GetLastOperationOptions { - _options.ServiceID = core.StringPtr(serviceID) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetLastOperationOptions) SetHeaders(param map[string]string) *GetLastOperationOptions { - options.Headers = param - return options -} - // GetNotificationsOptions : The GetNotifications options. type GetNotificationsOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests @@ -3712,13 +2904,13 @@ func (options *GetNotificationsOptions) SetHeaders(param map[string]string) *Get // GetProjectOptions : The GetProject options. type GetProjectOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` - // Only return with the active configuration, no drafts. + // When set to true, exclude_configs returns only active configurations. Draft configurations are not returned. ExcludeConfigs *bool `json:"exclude_configs,omitempty"` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` // Allows users to set headers on API requests @@ -3758,11 +2950,11 @@ func (options *GetProjectOptions) SetHeaders(param map[string]string) *GetProjec // GetSchematicsJobOptions : The GetSchematicsJob options. type GetSchematicsJobOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration that triggered the action. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // The triggered action. Action *string `json:"action" validate:"required,ne="` @@ -3777,29 +2969,29 @@ type GetSchematicsJobOptions struct { // Constants associated with the GetSchematicsJobOptions.Action property. // The triggered action. const ( - GetSchematicsJobOptions_Action_Install = "install" - GetSchematicsJobOptions_Action_Plan = "plan" + GetSchematicsJobOptions_Action_Install = "install" + GetSchematicsJobOptions_Action_Plan = "plan" GetSchematicsJobOptions_Action_Uninstall = "uninstall" ) // NewGetSchematicsJobOptions : Instantiate GetSchematicsJobOptions -func (*ProjectV1) NewGetSchematicsJobOptions(id string, configID string, action string) *GetSchematicsJobOptions { +func (*ProjectV1) NewGetSchematicsJobOptions(projectID string, id string, action string) *GetSchematicsJobOptions { return &GetSchematicsJobOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), - Action: core.StringPtr(action), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), + Action: core.StringPtr(action), } } -// SetID : Allow user to set ID -func (_options *GetSchematicsJobOptions) SetID(id string) *GetSchematicsJobOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *GetSchematicsJobOptions) SetProjectID(projectID string) *GetSchematicsJobOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *GetSchematicsJobOptions) SetConfigID(configID string) *GetSchematicsJobOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *GetSchematicsJobOptions) SetID(id string) *GetSchematicsJobOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3821,74 +3013,6 @@ func (options *GetSchematicsJobOptions) SetHeaders(param map[string]string) *Get return options } -// GetServiceInstanceOptions : The GetServiceInstance options. -type GetServiceInstanceOptions struct { - // The ID of a previously provisioned service instance. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // Broker API Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewGetServiceInstanceOptions : Instantiate GetServiceInstanceOptions -func (*ProjectV1) NewGetServiceInstanceOptions(instanceID string) *GetServiceInstanceOptions { - return &GetServiceInstanceOptions{ - InstanceID: core.StringPtr(instanceID), - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *GetServiceInstanceOptions) SetInstanceID(instanceID string) *GetServiceInstanceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *GetServiceInstanceOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *GetServiceInstanceOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *GetServiceInstanceOptions) SetHeaders(param map[string]string) *GetServiceInstanceOptions { - options.Headers = param - return options -} - -// Health : Response data from a health check request. -type Health struct { - // The name of the service. - Name *string `json:"name,omitempty"` - - // The running version of the service. - Version *string `json:"version,omitempty"` - - // The status of service dependencies. - Dependencies map[string]interface{} `json:"dependencies,omitempty"` -} - -// UnmarshalHealth unmarshals an instance of Health from the specified map of raw messages. -func UnmarshalHealth(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Health) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "dependencies", &obj.Dependencies) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // InputVariable : InputVariable struct type InputVariable struct { // The variable name. @@ -3897,6 +3021,9 @@ type InputVariable struct { // The variable type. Type *string `json:"type" validate:"required"` + // Can be any value - string, number, boolean, array or object. + Value interface{} `json:"value,omitempty"` + // Whether the variable is required or not. Required *bool `json:"required,omitempty"` } @@ -3904,14 +3031,14 @@ type InputVariable struct { // Constants associated with the InputVariable.Type property. // The variable type. const ( - InputVariable_Type_Array = "array" - InputVariable_Type_Boolean = "boolean" - InputVariable_Type_Float = "float" - InputVariable_Type_Int = "int" - InputVariable_Type_Number = "number" - InputVariable_Type_Object = "object" + InputVariable_Type_Array = "array" + InputVariable_Type_Boolean = "boolean" + InputVariable_Type_Float = "float" + InputVariable_Type_Int = "int" + InputVariable_Type_Number = "number" + InputVariable_Type_Object = "object" InputVariable_Type_Password = "password" - InputVariable_Type_String = "string" + InputVariable_Type_String = "string" ) // UnmarshalInputVariable unmarshals an instance of InputVariable from the specified map of raw messages. @@ -3925,6 +3052,10 @@ func UnmarshalInputVariable(m map[string]json.RawMessage, result interface{}) (e if err != nil { return } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "required", &obj.Required) if err != nil { return @@ -3935,13 +3066,13 @@ func UnmarshalInputVariable(m map[string]json.RawMessage, result interface{}) (e // InstallConfigOptions : The InstallConfig options. type InstallConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration to install. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` // Allows users to set headers on API requests @@ -3949,22 +3080,22 @@ type InstallConfigOptions struct { } // NewInstallConfigOptions : Instantiate InstallConfigOptions -func (*ProjectV1) NewInstallConfigOptions(id string, configID string) *InstallConfigOptions { +func (*ProjectV1) NewInstallConfigOptions(projectID string, id string) *InstallConfigOptions { return &InstallConfigOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *InstallConfigOptions) SetID(id string) *InstallConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *InstallConfigOptions) SetProjectID(projectID string) *InstallConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *InstallConfigOptions) SetConfigID(configID string) *InstallConfigOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *InstallConfigOptions) SetID(id string) *InstallConfigOptions { + _options.ID = core.StringPtr(id) return _options } @@ -3998,18 +3129,18 @@ type JSONPatchOperation struct { // Constants associated with the JSONPatchOperation.Op property. // The operation to be performed. const ( - JSONPatchOperation_Op_Add = "add" - JSONPatchOperation_Op_Copy = "copy" - JSONPatchOperation_Op_Move = "move" - JSONPatchOperation_Op_Remove = "remove" + JSONPatchOperation_Op_Add = "add" + JSONPatchOperation_Op_Copy = "copy" + JSONPatchOperation_Op_Move = "move" + JSONPatchOperation_Op_Remove = "remove" JSONPatchOperation_Op_Replace = "replace" - JSONPatchOperation_Op_Test = "test" + JSONPatchOperation_Op_Test = "test" ) // NewJSONPatchOperation : Instantiate JSONPatchOperation (Generic Model Constructor) func (*ProjectV1) NewJSONPatchOperation(op string, path string) (_model *JSONPatchOperation, err error) { _model = &JSONPatchOperation{ - Op: core.StringPtr(op), + Op: core.StringPtr(op), Path: core.StringPtr(path), } err = core.ValidateStruct(_model, "required parameters") @@ -4039,20 +3170,159 @@ func UnmarshalJSONPatchOperation(m map[string]json.RawMessage, result interface{ return } +// ListComplianceProfileAttachmentsOptions : The ListComplianceProfileAttachments options. +type ListComplianceProfileAttachmentsOptions struct { + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` + + // The ID of the Security and Compliance profile. + ProfileID *string `json:"profile_id" validate:"required,ne="` + + // Marks the last entry that is returned on the page. The server uses this parameter to determine the first entry that + // is returned on the next page. If this parameter is not specified, the logical first page is returned. + Start *string `json:"start,omitempty"` + + // Determine the maximum number of resources to return. The number of resources that are returned is the same, with the + // exception of the last page. + Limit *int64 `json:"limit,omitempty"` + + // The IBM trusted profile ID. + IbmTrustedProfileID *string `json:"Ibm-Trusted-Profile-Id,omitempty"` + + // The IBM Cloud API key. + IbmCloudApiKey *string `json:"Ibm-Cloud-Api-Key,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListComplianceProfileAttachmentsOptions : Instantiate ListComplianceProfileAttachmentsOptions +func (*ProjectV1) NewListComplianceProfileAttachmentsOptions(id string, profileID string) *ListComplianceProfileAttachmentsOptions { + return &ListComplianceProfileAttachmentsOptions{ + ID: core.StringPtr(id), + ProfileID: core.StringPtr(profileID), + } +} + +// SetID : Allow user to set ID +func (_options *ListComplianceProfileAttachmentsOptions) SetID(id string) *ListComplianceProfileAttachmentsOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetProfileID : Allow user to set ProfileID +func (_options *ListComplianceProfileAttachmentsOptions) SetProfileID(profileID string) *ListComplianceProfileAttachmentsOptions { + _options.ProfileID = core.StringPtr(profileID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListComplianceProfileAttachmentsOptions) SetStart(start string) *ListComplianceProfileAttachmentsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListComplianceProfileAttachmentsOptions) SetLimit(limit int64) *ListComplianceProfileAttachmentsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetIbmTrustedProfileID : Allow user to set IbmTrustedProfileID +func (_options *ListComplianceProfileAttachmentsOptions) SetIbmTrustedProfileID(ibmTrustedProfileID string) *ListComplianceProfileAttachmentsOptions { + _options.IbmTrustedProfileID = core.StringPtr(ibmTrustedProfileID) + return _options +} + +// SetIbmCloudApiKey : Allow user to set IbmCloudApiKey +func (_options *ListComplianceProfileAttachmentsOptions) SetIbmCloudApiKey(ibmCloudApiKey string) *ListComplianceProfileAttachmentsOptions { + _options.IbmCloudApiKey = core.StringPtr(ibmCloudApiKey) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListComplianceProfileAttachmentsOptions) SetHeaders(param map[string]string) *ListComplianceProfileAttachmentsOptions { + options.Headers = param + return options +} + +// ListComplianceProfilesOptions : The ListComplianceProfiles options. +type ListComplianceProfilesOptions struct { + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` + + // Marks the last entry that is returned on the page. The server uses this parameter to determine the first entry that + // is returned on the next page. If this parameter is not specified, the logical first page is returned. + Start *string `json:"start,omitempty"` + + // Determine the maximum number of resources to return. The number of resources that are returned is the same, with the + // exception of the last page. + Limit *int64 `json:"limit,omitempty"` + + // The IBM trusted profile ID. + IbmTrustedProfileID *string `json:"Ibm-Trusted-Profile-Id,omitempty"` + + // The IBM Cloud API key. + IbmCloudApiKey *string `json:"Ibm-Cloud-Api-Key,omitempty"` + + // Allows users to set headers on API requests + Headers map[string]string +} + +// NewListComplianceProfilesOptions : Instantiate ListComplianceProfilesOptions +func (*ProjectV1) NewListComplianceProfilesOptions(id string) *ListComplianceProfilesOptions { + return &ListComplianceProfilesOptions{ + ID: core.StringPtr(id), + } +} + +// SetID : Allow user to set ID +func (_options *ListComplianceProfilesOptions) SetID(id string) *ListComplianceProfilesOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListComplianceProfilesOptions) SetStart(start string) *ListComplianceProfilesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListComplianceProfilesOptions) SetLimit(limit int64) *ListComplianceProfilesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetIbmTrustedProfileID : Allow user to set IbmTrustedProfileID +func (_options *ListComplianceProfilesOptions) SetIbmTrustedProfileID(ibmTrustedProfileID string) *ListComplianceProfilesOptions { + _options.IbmTrustedProfileID = core.StringPtr(ibmTrustedProfileID) + return _options +} + +// SetIbmCloudApiKey : Allow user to set IbmCloudApiKey +func (_options *ListComplianceProfilesOptions) SetIbmCloudApiKey(ibmCloudApiKey string) *ListComplianceProfilesOptions { + _options.IbmCloudApiKey = core.StringPtr(ibmCloudApiKey) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListComplianceProfilesOptions) SetHeaders(param map[string]string) *ListComplianceProfilesOptions { + options.Headers = param + return options +} + // ListConfigsOptions : The ListConfigs options. type ListConfigsOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` // The version of configuration to return. Version *string `json:"version,omitempty"` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` - // The project ID. - ProjectID *string `json:"projectId,omitempty"` - // Allows users to set headers on API requests Headers map[string]string } @@ -4061,20 +3331,20 @@ type ListConfigsOptions struct { // The version of configuration to return. const ( ListConfigsOptions_Version_Active = "active" - ListConfigsOptions_Version_Draft = "draft" - ListConfigsOptions_Version_Mixed = "mixed" + ListConfigsOptions_Version_Draft = "draft" + ListConfigsOptions_Version_Mixed = "mixed" ) // NewListConfigsOptions : Instantiate ListConfigsOptions -func (*ProjectV1) NewListConfigsOptions(id string) *ListConfigsOptions { +func (*ProjectV1) NewListConfigsOptions(projectID string) *ListConfigsOptions { return &ListConfigsOptions{ - ID: core.StringPtr(id), + ProjectID: core.StringPtr(projectID), } } -// SetID : Allow user to set ID -func (_options *ListConfigsOptions) SetID(id string) *ListConfigsOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *ListConfigsOptions) SetProjectID(projectID string) *ListConfigsOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } @@ -4090,12 +3360,6 @@ func (_options *ListConfigsOptions) SetComplete(complete bool) *ListConfigsOptio return _options } -// SetProjectID : Allow user to set ProjectID -func (_options *ListConfigsOptions) SetProjectID(projectID string) *ListConfigsOptions { - _options.ProjectID = core.StringPtr(projectID) - return _options -} - // SetHeaders : Allow user to set Headers func (options *ListConfigsOptions) SetHeaders(param map[string]string) *ListConfigsOptions { options.Headers = param @@ -4104,15 +3368,15 @@ func (options *ListConfigsOptions) SetHeaders(param map[string]string) *ListConf // ListProjectsOptions : The ListProjects options. type ListProjectsOptions struct { - // Page token query parameter that is used to determine what resource to start the page after. If not specified, the - // logical first page is returned. + // Marks the last entry that is returned on the page. The server uses this parameter to determine the first entry that + // is returned on the next page. If this parameter is not specified, the logical first page is returned. Start *string `json:"start,omitempty"` - // Determine the maximum number of resources to return. The number of resources returned is the same, with exception of - // the last page. + // Determine the maximum number of resources to return. The number of resources that are returned is the same, with the + // exception of the last page. Limit *int64 `json:"limit,omitempty"` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` // Allows users to set headers on API requests @@ -4172,7 +3436,7 @@ type NotificationEvent struct { // NewNotificationEvent : Instantiate NotificationEvent (Generic Model Constructor) func (*ProjectV1) NewNotificationEvent(event string, target string) (_model *NotificationEvent, err error) { _model = &NotificationEvent{ - Event: core.StringPtr(event), + Event: core.StringPtr(event), Target: core.StringPtr(target), } err = core.ValidateStruct(_model, "required parameters") @@ -4367,7 +3631,7 @@ type NotificationsIntegrationGetResponse struct { // The name of the instance of the event. Name *string `json:"name,omitempty"` - // The status of instance of the event. + // The status of the instance of the event. Enabled *bool `json:"enabled,omitempty"` // A unique ID of the instance of the event. @@ -4376,8 +3640,8 @@ type NotificationsIntegrationGetResponse struct { // The type of the instance of event. Type *string `json:"type,omitempty"` - // A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as - // specified by RFC 3339. + // A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time + // format as specified by RFC 3339. UpdatedAt *strfmt.DateTime `json:"updated_at,omitempty"` // The topic count of the instance of the event. @@ -4426,7 +3690,7 @@ func UnmarshalNotificationsIntegrationGetResponse(m map[string]json.RawMessage, return } -// NotificationsIntegrationPostResponse : The resulting response of connecting a project to a event notifications instance. +// NotificationsIntegrationPostResponse : The resulting response of connecting a project to an event notifications instance. type NotificationsIntegrationPostResponse struct { // A description of the instance of the event. Description *string `json:"description,omitempty"` @@ -4443,8 +3707,8 @@ type NotificationsIntegrationPostResponse struct { // The type of instance of the event. Type *string `json:"type,omitempty"` - // A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as - // specified by RFC 3339. + // A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time + // format as specified by RFC 3339. CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` } @@ -4570,8 +3834,8 @@ type OutputValue struct { // A short explanation of the output value. Description *string `json:"description,omitempty"` - // The output value. - Value []string `json:"value,omitempty"` + // Can be any value - string, number, boolean, array or object. + Value interface{} `json:"value,omitempty"` } // UnmarshalOutputValue unmarshals an instance of OutputValue from the specified map of raw messages. @@ -4619,7 +3883,7 @@ func UnmarshalPaginationLink(m map[string]json.RawMessage, result interface{}) ( // PostCrnTokenOptions : The PostCrnToken options. type PostCrnTokenOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests @@ -4647,7 +3911,7 @@ func (options *PostCrnTokenOptions) SetHeaders(param map[string]string) *PostCrn // PostEventNotificationsIntegrationOptions : The PostEventNotificationsIntegration options. type PostEventNotificationsIntegrationOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // A CRN of the instance of the event. @@ -4669,7 +3933,7 @@ type PostEventNotificationsIntegrationOptions struct { // NewPostEventNotificationsIntegrationOptions : Instantiate PostEventNotificationsIntegrationOptions func (*ProjectV1) NewPostEventNotificationsIntegrationOptions(id string, instanceCrn string) *PostEventNotificationsIntegrationOptions { return &PostEventNotificationsIntegrationOptions{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), InstanceCrn: core.StringPtr(instanceCrn), } } @@ -4712,7 +3976,7 @@ func (options *PostEventNotificationsIntegrationOptions) SetHeaders(param map[st // PostNotificationOptions : The PostNotification options. type PostNotificationOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // Collection of the notification events to post. @@ -4749,7 +4013,7 @@ func (options *PostNotificationOptions) SetHeaders(param map[string]string) *Pos // PostTestEventNotificationOptions : The PostTestEventNotification options. type PostTestEventNotificationOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // The IBM default long message for the instance of an event. @@ -4774,325 +4038,70 @@ func (_options *PostTestEventNotificationOptions) SetID(id string) *PostTestEven _options.ID = core.StringPtr(id) return _options } - -// SetIbmendefaultlong : Allow user to set Ibmendefaultlong -func (_options *PostTestEventNotificationOptions) SetIbmendefaultlong(ibmendefaultlong string) *PostTestEventNotificationOptions { - _options.Ibmendefaultlong = core.StringPtr(ibmendefaultlong) - return _options -} - -// SetIbmendefaultshort : Allow user to set Ibmendefaultshort -func (_options *PostTestEventNotificationOptions) SetIbmendefaultshort(ibmendefaultshort string) *PostTestEventNotificationOptions { - _options.Ibmendefaultshort = core.StringPtr(ibmendefaultshort) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *PostTestEventNotificationOptions) SetHeaders(param map[string]string) *PostTestEventNotificationOptions { - options.Headers = param - return options -} - -// Project : The project returned in the response body. -type Project struct { - // The project name. - Name *string `json:"name" validate:"required"` - - // A project descriptive text. - Description *string `json:"description,omitempty"` - - // The unique ID of a project. - ID *string `json:"id,omitempty"` - - // An IBM Cloud resource name, which uniquely identifies a resource. - Crn *string `json:"crn,omitempty"` - - // The project configurations. - Configs []ProjectConfig `json:"configs,omitempty"` - - // The metadata of the project. - Metadata *ProjectMetadata `json:"metadata,omitempty"` -} - -// UnmarshalProject unmarshals an instance of Project from the specified map of raw messages. -func UnmarshalProject(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Project) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) - if err != nil { - return - } - err = core.UnmarshalModel(m, "configs", &obj.Configs, UnmarshalProjectConfig) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata", &obj.Metadata, UnmarshalProjectMetadata) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -func (*ProjectV1) NewProjectPatch(project *Project) (_patch []JSONPatchOperation) { - if project.Name != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/name"), - Value: project.Name, - }) - } - if project.Description != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/description"), - Value: project.Description, - }) - } - if project.ID != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/id"), - Value: project.ID, - }) - } - if project.Crn != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/crn"), - Value: project.Crn, - }) - } - if project.Configs != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/configs"), - Value: project.Configs, - }) - } - if project.Metadata != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/metadata"), - Value: project.Metadata, - }) - } - return -} - -// ProjectCRNTokenResponse : The project CRN token. -type ProjectCRNTokenResponse struct { - // The IAM access token. - AccesToken *string `json:"acces_token,omitempty"` - - // Number of seconds counted since January 1st, 1970, until the IAM access token will expire. - Expiration *int64 `json:"expiration,omitempty"` -} - -// UnmarshalProjectCRNTokenResponse unmarshals an instance of ProjectCRNTokenResponse from the specified map of raw messages. -func UnmarshalProjectCRNTokenResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectCRNTokenResponse) - err = core.UnmarshalPrimitive(m, "acces_token", &obj.AccesToken) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "expiration", &obj.Expiration) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectCollection : Projects list. -type ProjectCollection struct { - // A pagination limit. - Limit *int64 `json:"limit" validate:"required"` - - // Get the occurrencies of the total projects. - TotalCount *int64 `json:"total_count" validate:"required"` - - // A pagination link. - First *PaginationLink `json:"first" validate:"required"` - - // A pagination link. - Last *PaginationLink `json:"last,omitempty"` - - // A pagination link. - Previous *PaginationLink `json:"previous,omitempty"` - - // A pagination link. - Next *PaginationLink `json:"next,omitempty"` - - // An array of projects. - Projects []ProjectCollectionMemberWithMetadata `json:"projects,omitempty"` -} - -// UnmarshalProjectCollection unmarshals an instance of ProjectCollection from the specified map of raw messages. -func UnmarshalProjectCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) - if err != nil { - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "last", &obj.Last, UnmarshalPaginationLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPaginationLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationLink) - if err != nil { - return - } - err = core.UnmarshalModel(m, "projects", &obj.Projects, UnmarshalProjectCollectionMemberWithMetadata) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ProjectCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - return resp.Next.Start, nil -} - -// ProjectCollectionMemberWithMetadata : ProjectCollectionMemberWithMetadata struct -type ProjectCollectionMemberWithMetadata struct { - // The unique ID of a project. - ID *string `json:"id,omitempty"` - - // The project name. - Name *string `json:"name,omitempty"` - - // The project description. - Description *string `json:"description,omitempty"` - - // The metadata of the project. - Metadata *ProjectMetadata `json:"metadata,omitempty"` -} - -// UnmarshalProjectCollectionMemberWithMetadata unmarshals an instance of ProjectCollectionMemberWithMetadata from the specified map of raw messages. -func UnmarshalProjectCollectionMemberWithMetadata(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectCollectionMemberWithMetadata) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - return - } - err = core.UnmarshalModel(m, "metadata", &obj.Metadata, UnmarshalProjectMetadata) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + +// SetIbmendefaultlong : Allow user to set Ibmendefaultlong +func (_options *PostTestEventNotificationOptions) SetIbmendefaultlong(ibmendefaultlong string) *PostTestEventNotificationOptions { + _options.Ibmendefaultlong = core.StringPtr(ibmendefaultlong) + return _options } -// ProjectConfig : The project configuration. -type ProjectConfig struct { - // The unique ID of a project. - ID *string `json:"id,omitempty"` +// SetIbmendefaultshort : Allow user to set Ibmendefaultshort +func (_options *PostTestEventNotificationOptions) SetIbmendefaultshort(ibmendefaultshort string) *PostTestEventNotificationOptions { + _options.Ibmendefaultshort = core.StringPtr(ibmendefaultshort) + return _options +} - // The configuration name. - Name *string `json:"name" validate:"required"` +// SetHeaders : Allow user to set Headers +func (options *PostTestEventNotificationOptions) SetHeaders(param map[string]string) *PostTestEventNotificationOptions { + options.Headers = param + return options +} - // A collection of configuration labels. - Labels []string `json:"labels,omitempty"` +// Project : The project returned in the response body. +type Project struct { + // The project name. + Name *string `json:"name" validate:"required"` - // The project configuration description. + // A project descriptive text. Description *string `json:"description,omitempty"` - // The location ID of a project configuration manual property. - LocatorID *string `json:"locator_id" validate:"required"` - - // The type of a project configuration manual property. - Type *string `json:"type" validate:"required"` + // The unique ID of a project. + ID *string `json:"id,omitempty"` - // The outputs of a Schematics template property. - Input []InputVariable `json:"input,omitempty"` + // An IBM Cloud resource name, which uniquely identifies a resource. + Crn *string `json:"crn,omitempty"` - // The outputs of a Schematics template property. - Output []OutputValue `json:"output,omitempty"` + // The project configurations. + Configs []ProjectConfig `json:"configs,omitempty"` - // An optional setting object that's passed to the cart API. - Setting []ProjectConfigSettingCollection `json:"setting,omitempty"` + // The metadata of the project. + Metadata *ProjectMetadata `json:"metadata,omitempty"` } -// Constants associated with the ProjectConfig.Type property. -// The type of a project configuration manual property. -const ( - ProjectConfig_Type_SchematicsBlueprint = "schematics_blueprint" - ProjectConfig_Type_TerraformTemplate = "terraform_template" -) - -// UnmarshalProjectConfig unmarshals an instance of ProjectConfig from the specified map of raw messages. -func UnmarshalProjectConfig(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfig) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } +// UnmarshalProject unmarshals an instance of Project from the specified map of raw messages. +func UnmarshalProject(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Project) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "labels", &obj.Labels) - if err != nil { - return - } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { return } - err = core.UnmarshalPrimitive(m, "locator_id", &obj.LocatorID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalInputVariable) + err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) if err != nil { return } - err = core.UnmarshalModel(m, "output", &obj.Output, UnmarshalOutputValue) + err = core.UnmarshalModel(m, "configs", &obj.Configs, UnmarshalProjectConfig) if err != nil { return } - err = core.UnmarshalModel(m, "setting", &obj.Setting, UnmarshalProjectConfigSettingCollection) + err = core.UnmarshalModel(m, "metadata", &obj.Metadata, UnmarshalProjectMetadata) if err != nil { return } @@ -5100,252 +4109,69 @@ func UnmarshalProjectConfig(m map[string]json.RawMessage, result interface{}) (e return } -func (*ProjectV1) NewProjectConfigPatch(projectConfig *ProjectConfig) (_patch []JSONPatchOperation) { - if projectConfig.ID != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/id"), - Value: projectConfig.ID, - }) - } - if projectConfig.Name != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/name"), - Value: projectConfig.Name, - }) - } - if projectConfig.Labels != nil { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/labels"), - Value: projectConfig.Labels, - }) - } - if projectConfig.Description != nil { +func (*ProjectV1) NewProjectPatch(project *Project) (_patch []JSONPatchOperation) { + if (project.Name != nil) { _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/description"), - Value: projectConfig.Description, + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/name"), + Value: project.Name, }) } - if projectConfig.LocatorID != nil { + if (project.Description != nil) { _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/locator_id"), - Value: projectConfig.LocatorID, + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/description"), + Value: project.Description, }) } - if projectConfig.Type != nil { + if (project.ID != nil) { _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/type"), - Value: projectConfig.Type, + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/id"), + Value: project.ID, }) } - if projectConfig.Input != nil { + if (project.Crn != nil) { _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/input"), - Value: projectConfig.Input, + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/crn"), + Value: project.Crn, }) } - if projectConfig.Output != nil { + if (project.Configs != nil) { _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/output"), - Value: projectConfig.Output, + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/configs"), + Value: project.Configs, }) } - if projectConfig.Setting != nil { + if (project.Metadata != nil) { _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/setting"), - Value: projectConfig.Setting, + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/metadata"), + Value: project.Metadata, }) } return } -// ProjectConfigCollection : The project configuration list. -type ProjectConfigCollection struct { - // The collection list operation response schema that should define the array property with the name "configs". - Configs []ProjectConfig `json:"configs,omitempty"` -} - -// UnmarshalProjectConfigCollection unmarshals an instance of ProjectConfigCollection from the specified map of raw messages. -func UnmarshalProjectConfigCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigCollection) - err = core.UnmarshalModel(m, "configs", &obj.Configs, UnmarshalProjectConfig) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigDelete : Deletes the configuration response. -type ProjectConfigDelete struct { - // The unique ID of a project. - ID *string `json:"id,omitempty"` - - // The name of the configuration being deleted. - Name *string `json:"name,omitempty"` -} - -// UnmarshalProjectConfigDelete unmarshals an instance of ProjectConfigDelete from the specified map of raw messages. -func UnmarshalProjectConfigDelete(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigDelete) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigDiff : The project configuration diff summary. -type ProjectConfigDiff struct { - // The additions to configurations in the diff summary. - Added *ProjectConfigDiffAdded `json:"added,omitempty"` - - // The changes to configurations in the diff summary. - Changed *ProjectConfigDiffChanged `json:"changed,omitempty"` - - // The deletions to configurations in the diff summary. - Removed *ProjectConfigDiffRemoved `json:"removed,omitempty"` -} - -// UnmarshalProjectConfigDiff unmarshals an instance of ProjectConfigDiff from the specified map of raw messages. -func UnmarshalProjectConfigDiff(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigDiff) - err = core.UnmarshalModel(m, "added", &obj.Added, UnmarshalProjectConfigDiffAdded) - if err != nil { - return - } - err = core.UnmarshalModel(m, "changed", &obj.Changed, UnmarshalProjectConfigDiffChanged) - if err != nil { - return - } - err = core.UnmarshalModel(m, "removed", &obj.Removed, UnmarshalProjectConfigDiffRemoved) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigDiffAdded : The additions to configurations in the diff summary. -type ProjectConfigDiffAdded struct { - // The collection of additions to the configurations in the diff summary. - Input []ProjectConfigDiffInputVariable `json:"input,omitempty"` -} - -// UnmarshalProjectConfigDiffAdded unmarshals an instance of ProjectConfigDiffAdded from the specified map of raw messages. -func UnmarshalProjectConfigDiffAdded(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigDiffAdded) - err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigDiffInputVariable) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigDiffChanged : The changes to configurations in the diff summary. -type ProjectConfigDiffChanged struct { - // The collection of changes to configurations in the diff summary. - Input []ProjectConfigDiffInputVariable `json:"input,omitempty"` -} - -// UnmarshalProjectConfigDiffChanged unmarshals an instance of ProjectConfigDiffChanged from the specified map of raw messages. -func UnmarshalProjectConfigDiffChanged(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigDiffChanged) - err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigDiffInputVariable) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigDiffInputVariable : ProjectConfigDiffInputVariable struct -type ProjectConfigDiffInputVariable struct { - // The variable name. - Name *string `json:"name" validate:"required"` - - // The variable type. - Type *string `json:"type" validate:"required"` -} - -// Constants associated with the ProjectConfigDiffInputVariable.Type property. -// The variable type. -const ( - ProjectConfigDiffInputVariable_Type_Array = "array" - ProjectConfigDiffInputVariable_Type_Boolean = "boolean" - ProjectConfigDiffInputVariable_Type_Float = "float" - ProjectConfigDiffInputVariable_Type_Int = "int" - ProjectConfigDiffInputVariable_Type_Number = "number" - ProjectConfigDiffInputVariable_Type_Object = "object" - ProjectConfigDiffInputVariable_Type_Password = "password" - ProjectConfigDiffInputVariable_Type_String = "string" -) - -// UnmarshalProjectConfigDiffInputVariable unmarshals an instance of ProjectConfigDiffInputVariable from the specified map of raw messages. -func UnmarshalProjectConfigDiffInputVariable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigDiffInputVariable) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigDiffRemoved : The deletions to configurations in the diff summary. -type ProjectConfigDiffRemoved struct { - // The collection of deletions to configurations in the diff summary. - Input []ProjectConfigDiffInputVariable `json:"input,omitempty"` -} - -// UnmarshalProjectConfigDiffRemoved unmarshals an instance of ProjectConfigDiffRemoved from the specified map of raw messages. -func UnmarshalProjectConfigDiffRemoved(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigDiffRemoved) - err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigDiffInputVariable) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ProjectConfigInputVariable : ProjectConfigInputVariable struct -type ProjectConfigInputVariable struct { - // The variable name. - Name *string `json:"name" validate:"required"` -} +// ProjectCRNTokenResponse : The project CRN token. +type ProjectCRNTokenResponse struct { + // The IAM access token. + AccesToken *string `json:"acces_token,omitempty"` -// NewProjectConfigInputVariable : Instantiate ProjectConfigInputVariable (Generic Model Constructor) -func (*ProjectV1) NewProjectConfigInputVariable(name string) (_model *ProjectConfigInputVariable, err error) { - _model = &ProjectConfigInputVariable{ - Name: core.StringPtr(name), - } - err = core.ValidateStruct(_model, "required parameters") - return + // Number of seconds counted since January 1st, 1970, until the IAM access token will expire. + Expiration *int64 `json:"expiration,omitempty"` } -// UnmarshalProjectConfigInputVariable unmarshals an instance of ProjectConfigInputVariable from the specified map of raw messages. -func UnmarshalProjectConfigInputVariable(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigInputVariable) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalProjectCRNTokenResponse unmarshals an instance of ProjectCRNTokenResponse from the specified map of raw messages. +func UnmarshalProjectCRNTokenResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectCRNTokenResponse) + err = core.UnmarshalPrimitive(m, "acces_token", &obj.AccesToken) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "expiration", &obj.Expiration) if err != nil { return } @@ -5353,68 +4179,58 @@ func UnmarshalProjectConfigInputVariable(m map[string]json.RawMessage, result in return } -// ProjectConfigPrototype : The input of a project configuration. -type ProjectConfigPrototype struct { - // The unique ID of a project. - ID *string `json:"id,omitempty"` - - // The configuration name. - Name *string `json:"name" validate:"required"` +// ProjectCollection : Projects list. +type ProjectCollection struct { + // A pagination limit. + Limit *int64 `json:"limit" validate:"required"` - // A collection of configuration labels. - Labels []string `json:"labels,omitempty"` + // Get the occurrencies of the total projects. + TotalCount *int64 `json:"total_count" validate:"required"` - // The project configuration description. - Description *string `json:"description,omitempty"` + // A pagination link. + First *PaginationLink `json:"first" validate:"required"` - // The location ID of a project configuration manual property. - LocatorID *string `json:"locator_id" validate:"required"` + // A pagination link. + Last *PaginationLink `json:"last,omitempty"` - // The inputs of a Schematics template property. - Input []ProjectConfigInputVariable `json:"input,omitempty"` + // A pagination link. + Previous *PaginationLink `json:"previous,omitempty"` - // An optional setting object that's passed to the cart API. - Setting []ProjectConfigSettingCollection `json:"setting,omitempty"` -} + // A pagination link. + Next *PaginationLink `json:"next,omitempty"` -// NewProjectConfigPrototype : Instantiate ProjectConfigPrototype (Generic Model Constructor) -func (*ProjectV1) NewProjectConfigPrototype(name string, locatorID string) (_model *ProjectConfigPrototype, err error) { - _model = &ProjectConfigPrototype{ - Name: core.StringPtr(name), - LocatorID: core.StringPtr(locatorID), - } - err = core.ValidateStruct(_model, "required parameters") - return + // An array of projects. + Projects []ProjectCollectionMemberWithMetadata `json:"projects,omitempty"` } -// UnmarshalProjectConfigPrototype unmarshals an instance of ProjectConfigPrototype from the specified map of raw messages. -func UnmarshalProjectConfigPrototype(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigPrototype) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// UnmarshalProjectCollection unmarshals an instance of ProjectCollection from the specified map of raw messages. +func UnmarshalProjectCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { return } - err = core.UnmarshalPrimitive(m, "labels", &obj.Labels) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationLink) if err != nil { return } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) + err = core.UnmarshalModel(m, "last", &obj.Last, UnmarshalPaginationLink) if err != nil { return } - err = core.UnmarshalPrimitive(m, "locator_id", &obj.LocatorID) + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPaginationLink) if err != nil { return } - err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigInputVariable) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationLink) if err != nil { return } - err = core.UnmarshalModel(m, "setting", &obj.Setting, UnmarshalProjectConfigSettingCollection) + err = core.UnmarshalModel(m, "projects", &obj.Projects, UnmarshalProjectCollectionMemberWithMetadata) if err != nil { return } @@ -5422,33 +4238,45 @@ func UnmarshalProjectConfigPrototype(m map[string]json.RawMessage, result interf return } -// ProjectConfigSettingCollection : ProjectConfigSettingCollection struct -type ProjectConfigSettingCollection struct { - // The name of the configuration setting. - Name *string `json:"name" validate:"required"` - - // The value of a the configuration setting. - Value *string `json:"value" validate:"required"` +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ProjectCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil } -// NewProjectConfigSettingCollection : Instantiate ProjectConfigSettingCollection (Generic Model Constructor) -func (*ProjectV1) NewProjectConfigSettingCollection(name string, value string) (_model *ProjectConfigSettingCollection, err error) { - _model = &ProjectConfigSettingCollection{ - Name: core.StringPtr(name), - Value: core.StringPtr(value), - } - err = core.ValidateStruct(_model, "required parameters") - return +// ProjectCollectionMemberWithMetadata : ProjectCollectionMemberWithMetadata struct +type ProjectCollectionMemberWithMetadata struct { + // The unique ID of a project. + ID *string `json:"id,omitempty"` + + // The project name. + Name *string `json:"name,omitempty"` + + // The project description. + Description *string `json:"description,omitempty"` + + // The metadata of the project. + Metadata *ProjectMetadata `json:"metadata,omitempty"` } -// UnmarshalProjectConfigSettingCollection unmarshals an instance of ProjectConfigSettingCollection from the specified map of raw messages. -func UnmarshalProjectConfigSettingCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectConfigSettingCollection) +// UnmarshalProjectCollectionMemberWithMetadata unmarshals an instance of ProjectCollectionMemberWithMetadata from the specified map of raw messages. +func UnmarshalProjectCollectionMemberWithMetadata(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectCollectionMemberWithMetadata) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + return + } + err = core.UnmarshalModel(m, "metadata", &obj.Metadata, UnmarshalProjectMetadata) if err != nil { return } @@ -5456,497 +4284,346 @@ func UnmarshalProjectConfigSettingCollection(m map[string]json.RawMessage, resul return } -// ProjectMetadata : The metadata of the project. -type ProjectMetadata struct { - // An IBM Cloud resource name, which uniquely identifies a resource. - Crn *string `json:"crn,omitempty"` +// ProjectConfig : The project configuration. +type ProjectConfig struct { + // The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration. + ID *string `json:"id,omitempty"` - // A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as - // specified by RFC 3339. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + // The configuration name. + Name *string `json:"name" validate:"required"` - // The cumulative list of needs attention items for a project. - CumulativeNeedsAttentionView []CumulativeNeedsAttention `json:"cumulative_needs_attention_view,omitempty"` + // A collection of configuration labels. + Labels []string `json:"labels,omitempty"` - // "True" indicates that the fetch of the needs attention items failed. - CumulativeNeedsAttentionViewErr *string `json:"cumulative_needs_attention_view_err,omitempty"` + // The project configuration description. + Description *string `json:"description,omitempty"` - // The location where the project was created. - Location *string `json:"location,omitempty"` + // A dotted value of catalogID.versionID. + LocatorID *string `json:"locator_id" validate:"required"` - // The resource group where the project was created. - ResourceGroup *string `json:"resource_group,omitempty"` + // The type of a project configuration manual property. + Type *string `json:"type" validate:"required"` - // The project status value. - State *string `json:"state,omitempty"` + // The outputs of a Schematics template property. + Input []InputVariable `json:"input,omitempty"` - // The CRN of the event notifications instance if one is connected to this project. - EventNotificationsCrn *string `json:"event_notifications_crn,omitempty"` + // The outputs of a Schematics template property. + Output []OutputValue `json:"output,omitempty"` + + // Schematics environment variables to use to deploy the configuration. + Setting []ProjectConfigSettingCollection `json:"setting,omitempty"` } -// UnmarshalProjectMetadata unmarshals an instance of ProjectMetadata from the specified map of raw messages. -func UnmarshalProjectMetadata(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ProjectMetadata) - err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) +// Constants associated with the ProjectConfig.Type property. +// The type of a project configuration manual property. +const ( + ProjectConfig_Type_SchematicsBlueprint = "schematics_blueprint" + ProjectConfig_Type_TerraformTemplate = "terraform_template" +) + +// UnmarshalProjectConfig unmarshals an instance of ProjectConfig from the specified map of raw messages. +func UnmarshalProjectConfig(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfig) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalModel(m, "cumulative_needs_attention_view", &obj.CumulativeNeedsAttentionView, UnmarshalCumulativeNeedsAttention) + err = core.UnmarshalPrimitive(m, "labels", &obj.Labels) if err != nil { return } - err = core.UnmarshalPrimitive(m, "cumulative_needs_attention_view_err", &obj.CumulativeNeedsAttentionViewErr) + err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { return } - err = core.UnmarshalPrimitive(m, "location", &obj.Location) + err = core.UnmarshalPrimitive(m, "locator_id", &obj.LocatorID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "resource_group", &obj.ResourceGroup) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { return } - err = core.UnmarshalPrimitive(m, "state", &obj.State) + err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalInputVariable) if err != nil { return } - err = core.UnmarshalPrimitive(m, "event_notifications_crn", &obj.EventNotificationsCrn) + err = core.UnmarshalModel(m, "output", &obj.Output, UnmarshalOutputValue) if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// PulsarEventPrototypeCollection : PulsarEventPrototypeCollection struct -type PulsarEventPrototypeCollection struct { - // The type of the event that is published and written in dot notation. - EventType *string `json:"event_type" validate:"required"` - - // A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as - // specified by RFC 3339. - Timestamp *strfmt.DateTime `json:"timestamp" validate:"required"` - - // The publisher of the events, preferably written as the service's CRN. - Publisher *string `json:"publisher" validate:"required"` - - // The IBMid that the event is scoped to. - AccountID *string `json:"account_id" validate:"required"` - - // The version of the payload. - Version *string `json:"version" validate:"required"` - - // Custom event properties for a specific event. - EventProperties map[string]interface{} `json:"event_properties,omitempty"` - - // A unique identifier for that individual event. - EventID *string `json:"event_id,omitempty"` - - // Allows users to set arbitrary properties - additionalProperties map[string]interface{} -} - -// NewPulsarEventPrototypeCollection : Instantiate PulsarEventPrototypeCollection (Generic Model Constructor) -func (*ProjectV1) NewPulsarEventPrototypeCollection(eventType string, timestamp *strfmt.DateTime, publisher string, accountID string, version string) (_model *PulsarEventPrototypeCollection, err error) { - _model = &PulsarEventPrototypeCollection{ - EventType: core.StringPtr(eventType), - Timestamp: timestamp, - Publisher: core.StringPtr(publisher), - AccountID: core.StringPtr(accountID), - Version: core.StringPtr(version), + err = core.UnmarshalModel(m, "setting", &obj.Setting, UnmarshalProjectConfigSettingCollection) + if err != nil { + return } - err = core.ValidateStruct(_model, "required parameters") + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// SetProperty allows the user to set an arbitrary property on an instance of PulsarEventPrototypeCollection -func (o *PulsarEventPrototypeCollection) SetProperty(key string, value interface{}) { - if o.additionalProperties == nil { - o.additionalProperties = make(map[string]interface{}) - } - o.additionalProperties[key] = value -} - -// SetProperties allows the user to set a map of arbitrary properties on an instance of PulsarEventPrototypeCollection -func (o *PulsarEventPrototypeCollection) SetProperties(m map[string]interface{}) { - o.additionalProperties = make(map[string]interface{}) - for k, v := range m { - o.additionalProperties[k] = v +func (*ProjectV1) NewProjectConfigPatch(projectConfig *ProjectConfig) (_patch []JSONPatchOperation) { + if (projectConfig.ID != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/id"), + Value: projectConfig.ID, + }) } -} - -// GetProperty allows the user to retrieve an arbitrary property from an instance of PulsarEventPrototypeCollection -func (o *PulsarEventPrototypeCollection) GetProperty(key string) interface{} { - return o.additionalProperties[key] -} - -// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of PulsarEventPrototypeCollection -func (o *PulsarEventPrototypeCollection) GetProperties() map[string]interface{} { - return o.additionalProperties -} - -// MarshalJSON performs custom serialization for instances of PulsarEventPrototypeCollection -func (o *PulsarEventPrototypeCollection) MarshalJSON() (buffer []byte, err error) { - m := make(map[string]interface{}) - if len(o.additionalProperties) > 0 { - for k, v := range o.additionalProperties { - m[k] = v - } + if (projectConfig.Name != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/name"), + Value: projectConfig.Name, + }) } - if o.EventType != nil { - m["event_type"] = o.EventType + if (projectConfig.Labels != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/labels"), + Value: projectConfig.Labels, + }) } - if o.Timestamp != nil { - m["timestamp"] = o.Timestamp + if (projectConfig.Description != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/description"), + Value: projectConfig.Description, + }) } - if o.Publisher != nil { - m["publisher"] = o.Publisher + if (projectConfig.LocatorID != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/locator_id"), + Value: projectConfig.LocatorID, + }) } - if o.AccountID != nil { - m["account_id"] = o.AccountID + if (projectConfig.Type != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/type"), + Value: projectConfig.Type, + }) } - if o.Version != nil { - m["version"] = o.Version + if (projectConfig.Input != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/input"), + Value: projectConfig.Input, + }) } - if o.EventProperties != nil { - m["event_properties"] = o.EventProperties + if (projectConfig.Output != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/output"), + Value: projectConfig.Output, + }) } - if o.EventID != nil { - m["event_id"] = o.EventID + if (projectConfig.Setting != nil) { + _patch = append(_patch, JSONPatchOperation{ + Op: core.StringPtr(JSONPatchOperation_Op_Add), + Path: core.StringPtr("/setting"), + Value: projectConfig.Setting, + }) } - buffer, err = json.Marshal(m) return } -// UnmarshalPulsarEventPrototypeCollection unmarshals an instance of PulsarEventPrototypeCollection from the specified map of raw messages. -func UnmarshalPulsarEventPrototypeCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PulsarEventPrototypeCollection) - err = core.UnmarshalPrimitive(m, "event_type", &obj.EventType) - if err != nil { - return - } - delete(m, "event_type") - err = core.UnmarshalPrimitive(m, "timestamp", &obj.Timestamp) +// ProjectConfigCollection : The project configuration list. +type ProjectConfigCollection struct { + // The collection list operation response schema that should define the array property with the name "configs". + Configs []ProjectConfig `json:"configs,omitempty"` +} + +// UnmarshalProjectConfigCollection unmarshals an instance of ProjectConfigCollection from the specified map of raw messages. +func UnmarshalProjectConfigCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigCollection) + err = core.UnmarshalModel(m, "configs", &obj.Configs, UnmarshalProjectConfig) if err != nil { return } - delete(m, "timestamp") - err = core.UnmarshalPrimitive(m, "publisher", &obj.Publisher) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ProjectConfigDelete : Deletes the configuration response. +type ProjectConfigDelete struct { + // The unique ID of a project. + ID *string `json:"id,omitempty"` + + // The name of the configuration being deleted. + Name *string `json:"name,omitempty"` +} + +// UnmarshalProjectConfigDelete unmarshals an instance of ProjectConfigDelete from the specified map of raw messages. +func UnmarshalProjectConfigDelete(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigDelete) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { return } - delete(m, "publisher") - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - delete(m, "account_id") - err = core.UnmarshalPrimitive(m, "version", &obj.Version) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ProjectConfigDiff : The project configuration diff summary. +type ProjectConfigDiff struct { + // The additions to configurations in the diff summary. + Added *ProjectConfigDiffAdded `json:"added,omitempty"` + + // The changes to configurations in the diff summary. + Changed *ProjectConfigDiffChanged `json:"changed,omitempty"` + + // The deletions to configurations in the diff summary. + Removed *ProjectConfigDiffRemoved `json:"removed,omitempty"` +} + +// UnmarshalProjectConfigDiff unmarshals an instance of ProjectConfigDiff from the specified map of raw messages. +func UnmarshalProjectConfigDiff(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigDiff) + err = core.UnmarshalModel(m, "added", &obj.Added, UnmarshalProjectConfigDiffAdded) if err != nil { return } - delete(m, "version") - err = core.UnmarshalPrimitive(m, "event_properties", &obj.EventProperties) + err = core.UnmarshalModel(m, "changed", &obj.Changed, UnmarshalProjectConfigDiffChanged) if err != nil { return } - delete(m, "event_properties") - err = core.UnmarshalPrimitive(m, "event_id", &obj.EventID) + err = core.UnmarshalModel(m, "removed", &obj.Removed, UnmarshalProjectConfigDiffRemoved) if err != nil { return } - delete(m, "event_id") - for k := range m { - var v interface{} - e := core.UnmarshalPrimitive(m, k, &v) - if e != nil { - err = e - return - } - obj.SetProperty(k, v) - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ReceivePulsarCatalogEventsOptions : The ReceivePulsarCatalogEvents options. -type ReceivePulsarCatalogEventsOptions struct { - // A pulsar event. - PulsarCatalogEvents []PulsarEventPrototypeCollection `json:"pulsar_catalog_events" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewReceivePulsarCatalogEventsOptions : Instantiate ReceivePulsarCatalogEventsOptions -func (*ProjectV1) NewReceivePulsarCatalogEventsOptions(pulsarCatalogEvents []PulsarEventPrototypeCollection) *ReceivePulsarCatalogEventsOptions { - return &ReceivePulsarCatalogEventsOptions{ - PulsarCatalogEvents: pulsarCatalogEvents, - } -} - -// SetPulsarCatalogEvents : Allow user to set PulsarCatalogEvents -func (_options *ReceivePulsarCatalogEventsOptions) SetPulsarCatalogEvents(pulsarCatalogEvents []PulsarEventPrototypeCollection) *ReceivePulsarCatalogEventsOptions { - _options.PulsarCatalogEvents = pulsarCatalogEvents - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReceivePulsarCatalogEventsOptions) SetHeaders(param map[string]string) *ReceivePulsarCatalogEventsOptions { - options.Headers = param - return options -} - -// ReceivePulsarEventNotificationEventsOptions : The ReceivePulsarEventNotificationEvents options. -type ReceivePulsarEventNotificationEventsOptions struct { - // A pulsar event. - PulsarEventNotificationEvents []PulsarEventPrototypeCollection `json:"pulsar_event_notification_events" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string +// ProjectConfigDiffAdded : The additions to configurations in the diff summary. +type ProjectConfigDiffAdded struct { + // The collection of additions to the configurations in the diff summary. + Input []ProjectConfigDiffInputVariable `json:"input,omitempty"` } -// NewReceivePulsarEventNotificationEventsOptions : Instantiate ReceivePulsarEventNotificationEventsOptions -func (*ProjectV1) NewReceivePulsarEventNotificationEventsOptions(pulsarEventNotificationEvents []PulsarEventPrototypeCollection) *ReceivePulsarEventNotificationEventsOptions { - return &ReceivePulsarEventNotificationEventsOptions{ - PulsarEventNotificationEvents: pulsarEventNotificationEvents, +// UnmarshalProjectConfigDiffAdded unmarshals an instance of ProjectConfigDiffAdded from the specified map of raw messages. +func UnmarshalProjectConfigDiffAdded(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigDiffAdded) + err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigDiffInputVariable) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPulsarEventNotificationEvents : Allow user to set PulsarEventNotificationEvents -func (_options *ReceivePulsarEventNotificationEventsOptions) SetPulsarEventNotificationEvents(pulsarEventNotificationEvents []PulsarEventPrototypeCollection) *ReceivePulsarEventNotificationEventsOptions { - _options.PulsarEventNotificationEvents = pulsarEventNotificationEvents - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReceivePulsarEventNotificationEventsOptions) SetHeaders(param map[string]string) *ReceivePulsarEventNotificationEventsOptions { - options.Headers = param - return options -} - -// ReplaceServiceInstanceOptions : The ReplaceServiceInstance options. -type ReplaceServiceInstanceOptions struct { - // The instance_id of a service instance is provided by the IBM Cloud platform. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The ID of the service stored in the catalog.j-son of your broker. This value should be a GUID and it MUST be a - // non-empty string. - ServiceID *string `json:"service_id" validate:"required"` - - // The ID of the plan for which the service instance has been requested, which is stored in the catalog.j-son of your - // broker. - PlanID *string `json:"plan_id" validate:"required"` - - // Platform specific contextual information where the service instance will be provisioned. - Context []string `json:"context,omitempty"` - - // Configuration options for the service instance. An opaque object, controller treats this as a blob. Brokers should - // ensure that the client has provided valid configuration parameters and values for the operation. If this field is - // not present in the request message, then the broker MUST NOT change the parameters of the instance as a result of - // this request. - Parameters map[string]interface{} `json:"parameters,omitempty"` - - // Information about the service instance prior to the update. - PreviousValues []string `json:"previous_values,omitempty"` - - // Broker Api Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // Broker Api Originating Identity. - XBrokerApiOriginatingIdentity *string `json:"X-Broker-Api-Originating-Identity,omitempty"` - - // A value of true indicates that both the IBM Cloud platform and the requesting client support asynchronous - // deprovisioning. If this parameter is not included in the request, and the broker can only deprovision a service - // instance of the requested plan asynchronously, the broker MUST reject the request with a 422 Unprocessable Entity. - AcceptsIncomplete *bool `json:"accepts_incomplete,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string +// ProjectConfigDiffChanged : The changes to configurations in the diff summary. +type ProjectConfigDiffChanged struct { + // The collection of changes to configurations in the diff summary. + Input []ProjectConfigDiffInputVariable `json:"input,omitempty"` } -// NewReplaceServiceInstanceOptions : Instantiate ReplaceServiceInstanceOptions -func (*ProjectV1) NewReplaceServiceInstanceOptions(instanceID string, serviceID string, planID string) *ReplaceServiceInstanceOptions { - return &ReplaceServiceInstanceOptions{ - InstanceID: core.StringPtr(instanceID), - ServiceID: core.StringPtr(serviceID), - PlanID: core.StringPtr(planID), +// UnmarshalProjectConfigDiffChanged unmarshals an instance of ProjectConfigDiffChanged from the specified map of raw messages. +func UnmarshalProjectConfigDiffChanged(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigDiffChanged) + err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigDiffInputVariable) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ReplaceServiceInstanceOptions) SetInstanceID(instanceID string) *ReplaceServiceInstanceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetServiceID : Allow user to set ServiceID -func (_options *ReplaceServiceInstanceOptions) SetServiceID(serviceID string) *ReplaceServiceInstanceOptions { - _options.ServiceID = core.StringPtr(serviceID) - return _options -} - -// SetPlanID : Allow user to set PlanID -func (_options *ReplaceServiceInstanceOptions) SetPlanID(planID string) *ReplaceServiceInstanceOptions { - _options.PlanID = core.StringPtr(planID) - return _options -} - -// SetContext : Allow user to set Context -func (_options *ReplaceServiceInstanceOptions) SetContext(context []string) *ReplaceServiceInstanceOptions { - _options.Context = context - return _options -} - -// SetParameters : Allow user to set Parameters -func (_options *ReplaceServiceInstanceOptions) SetParameters(parameters map[string]interface{}) *ReplaceServiceInstanceOptions { - _options.Parameters = parameters - return _options -} - -// SetPreviousValues : Allow user to set PreviousValues -func (_options *ReplaceServiceInstanceOptions) SetPreviousValues(previousValues []string) *ReplaceServiceInstanceOptions { - _options.PreviousValues = previousValues - return _options -} - -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *ReplaceServiceInstanceOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *ReplaceServiceInstanceOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options -} - -// SetXBrokerApiOriginatingIdentity : Allow user to set XBrokerApiOriginatingIdentity -func (_options *ReplaceServiceInstanceOptions) SetXBrokerApiOriginatingIdentity(xBrokerApiOriginatingIdentity string) *ReplaceServiceInstanceOptions { - _options.XBrokerApiOriginatingIdentity = core.StringPtr(xBrokerApiOriginatingIdentity) - return _options -} +// ProjectConfigDiffInputVariable : ProjectConfigDiffInputVariable struct +type ProjectConfigDiffInputVariable struct { + // The variable name. + Name *string `json:"name" validate:"required"` -// SetAcceptsIncomplete : Allow user to set AcceptsIncomplete -func (_options *ReplaceServiceInstanceOptions) SetAcceptsIncomplete(acceptsIncomplete bool) *ReplaceServiceInstanceOptions { - _options.AcceptsIncomplete = core.BoolPtr(acceptsIncomplete) - return _options -} + // The variable type. + Type *string `json:"type" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ReplaceServiceInstanceOptions) SetHeaders(param map[string]string) *ReplaceServiceInstanceOptions { - options.Headers = param - return options + // Can be any value - string, number, boolean, array or object. + Value interface{} `json:"value,omitempty"` } -// ReplaceServiceInstanceStateOptions : The ReplaceServiceInstanceState options. -type ReplaceServiceInstanceStateOptions struct { - // The instance_id of a service instance is provided by the IBM Cloud platform. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // The ID of the service stored in the catalog.j-son of your broker. This value should be a GUID. It MUST be a - // non-empty string. - Enabled *bool `json:"enabled" validate:"required"` - - // Optional string that shows the user ID that is initiating the call. - InitiatorID *string `json:"initiator_id,omitempty"` - - // Optional string that states the reason code for the service instance state change. Valid values are - // IBMCLOUD_ACCT_ACTIVATE, IBMCLOUD_RECLAMATION_RESTORE, or IBMCLOUD_SERVICE_INSTANCE_BELOW_CAP for enable calls; - // IBMCLOUD_ACCT_SUSPEND, IBMCLOUD_RECLAMATION_SCHEDULE, or IBMCLOUD_SERVICE_INSTANCE_ABOVE_CAP for disable calls; and - // IBMCLOUD_ADMIN_REQUEST for enable and disable calls. - ReasonCode map[string]interface{} `json:"reason_code,omitempty"` - - // The ID of the plan for which the service instance has been requested, which is stored in the catalog.j-son of your - // broker. - PlanID *string `json:"plan_id,omitempty"` - - // Information about the service instance prior to the update. - PreviousValues []string `json:"previous_values,omitempty"` - - // Broker Api Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} +// Constants associated with the ProjectConfigDiffInputVariable.Type property. +// The variable type. +const ( + ProjectConfigDiffInputVariable_Type_Array = "array" + ProjectConfigDiffInputVariable_Type_Boolean = "boolean" + ProjectConfigDiffInputVariable_Type_Float = "float" + ProjectConfigDiffInputVariable_Type_Int = "int" + ProjectConfigDiffInputVariable_Type_Number = "number" + ProjectConfigDiffInputVariable_Type_Object = "object" + ProjectConfigDiffInputVariable_Type_Password = "password" + ProjectConfigDiffInputVariable_Type_String = "string" +) -// NewReplaceServiceInstanceStateOptions : Instantiate ReplaceServiceInstanceStateOptions -func (*ProjectV1) NewReplaceServiceInstanceStateOptions(instanceID string, enabled bool) *ReplaceServiceInstanceStateOptions { - return &ReplaceServiceInstanceStateOptions{ - InstanceID: core.StringPtr(instanceID), - Enabled: core.BoolPtr(enabled), +// UnmarshalProjectConfigDiffInputVariable unmarshals an instance of ProjectConfigDiffInputVariable from the specified map of raw messages. +func UnmarshalProjectConfigDiffInputVariable(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigDiffInputVariable) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetInstanceID : Allow user to set InstanceID -func (_options *ReplaceServiceInstanceStateOptions) SetInstanceID(instanceID string) *ReplaceServiceInstanceStateOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetEnabled : Allow user to set Enabled -func (_options *ReplaceServiceInstanceStateOptions) SetEnabled(enabled bool) *ReplaceServiceInstanceStateOptions { - _options.Enabled = core.BoolPtr(enabled) - return _options -} - -// SetInitiatorID : Allow user to set InitiatorID -func (_options *ReplaceServiceInstanceStateOptions) SetInitiatorID(initiatorID string) *ReplaceServiceInstanceStateOptions { - _options.InitiatorID = core.StringPtr(initiatorID) - return _options -} - -// SetReasonCode : Allow user to set ReasonCode -func (_options *ReplaceServiceInstanceStateOptions) SetReasonCode(reasonCode map[string]interface{}) *ReplaceServiceInstanceStateOptions { - _options.ReasonCode = reasonCode - return _options -} - -// SetPlanID : Allow user to set PlanID -func (_options *ReplaceServiceInstanceStateOptions) SetPlanID(planID string) *ReplaceServiceInstanceStateOptions { - _options.PlanID = core.StringPtr(planID) - return _options +// ProjectConfigDiffRemoved : The deletions to configurations in the diff summary. +type ProjectConfigDiffRemoved struct { + // The collection of deletions to configurations in the diff summary. + Input []ProjectConfigDiffInputVariable `json:"input,omitempty"` } -// SetPreviousValues : Allow user to set PreviousValues -func (_options *ReplaceServiceInstanceStateOptions) SetPreviousValues(previousValues []string) *ReplaceServiceInstanceStateOptions { - _options.PreviousValues = previousValues - return _options +// UnmarshalProjectConfigDiffRemoved unmarshals an instance of ProjectConfigDiffRemoved from the specified map of raw messages. +func UnmarshalProjectConfigDiffRemoved(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigDiffRemoved) + err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigDiffInputVariable) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *ReplaceServiceInstanceStateOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *ReplaceServiceInstanceStateOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options -} +// ProjectConfigInputVariable : ProjectConfigInputVariable struct +type ProjectConfigInputVariable struct { + // The variable name. + Name *string `json:"name" validate:"required"` -// SetHeaders : Allow user to set Headers -func (options *ReplaceServiceInstanceStateOptions) SetHeaders(param map[string]string) *ReplaceServiceInstanceStateOptions { - options.Headers = param - return options + // Can be any value - string, number, boolean, array or object. + Value interface{} `json:"value,omitempty"` } -// ResourceCreateResponse : Result of the provision call. -type ResourceCreateResponse struct { - // The URL of a web-based management user interface for the service instance. The URL MUST contain enough information - // for the dashboard to identify the resource being accessed. - DashboardURL *string `json:"dashboard_url,omitempty"` - - // For asynchronous responses, service brokers can return an identifier representing the operation. The value of this - // field MUST be provided by the platform with requests to the last_operation endpoint in a URL encoded query - // parameter. If present, it MUST be a non-empty string. - Operation *string `json:"operation,omitempty"` +// NewProjectConfigInputVariable : Instantiate ProjectConfigInputVariable (Generic Model Constructor) +func (*ProjectV1) NewProjectConfigInputVariable(name string) (_model *ProjectConfigInputVariable, err error) { + _model = &ProjectConfigInputVariable{ + Name: core.StringPtr(name), + } + err = core.ValidateStruct(_model, "required parameters") + return } -// UnmarshalResourceCreateResponse unmarshals an instance of ResourceCreateResponse from the specified map of raw messages. -func UnmarshalResourceCreateResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceCreateResponse) - err = core.UnmarshalPrimitive(m, "dashboard_url", &obj.DashboardURL) +// UnmarshalProjectConfigInputVariable unmarshals an instance of ProjectConfigInputVariable from the specified map of raw messages. +func UnmarshalProjectConfigInputVariable(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigInputVariable) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { return } - err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) + err = core.UnmarshalPrimitive(m, "value", &obj.Value) if err != nil { return } @@ -5954,81 +4631,52 @@ func UnmarshalResourceCreateResponse(m map[string]json.RawMessage, result interf return } -// ResourceDeleteResponse : The result of deprovisioning a service instance. -type ResourceDeleteResponse struct { +// ProjectConfigPrototype : The input of a project configuration. +type ProjectConfigPrototype struct { + // The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration. + ID *string `json:"id,omitempty"` - // Allows users to set arbitrary properties - additionalProperties map[string]interface{} -} + // The configuration name. + Name *string `json:"name" validate:"required"` -// SetProperty allows the user to set an arbitrary property on an instance of ResourceDeleteResponse -func (o *ResourceDeleteResponse) SetProperty(key string, value interface{}) { - if o.additionalProperties == nil { - o.additionalProperties = make(map[string]interface{}) - } - o.additionalProperties[key] = value -} + // A collection of configuration labels. + Labels []string `json:"labels,omitempty"` -// SetProperties allows the user to set a map of arbitrary properties on an instance of ResourceDeleteResponse -func (o *ResourceDeleteResponse) SetProperties(m map[string]interface{}) { - o.additionalProperties = make(map[string]interface{}) - for k, v := range m { - o.additionalProperties[k] = v - } -} + // The project configuration description. + Description *string `json:"description,omitempty"` -// GetProperty allows the user to retrieve an arbitrary property from an instance of ResourceDeleteResponse -func (o *ResourceDeleteResponse) GetProperty(key string) interface{} { - return o.additionalProperties[key] -} + // A dotted value of catalogID.versionID. + LocatorID *string `json:"locator_id" validate:"required"` -// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of ResourceDeleteResponse -func (o *ResourceDeleteResponse) GetProperties() map[string]interface{} { - return o.additionalProperties -} + // The input values to use to deploy the configuration. + Input []ProjectConfigInputVariable `json:"input,omitempty"` -// MarshalJSON performs custom serialization for instances of ResourceDeleteResponse -func (o *ResourceDeleteResponse) MarshalJSON() (buffer []byte, err error) { - m := make(map[string]interface{}) - if len(o.additionalProperties) > 0 { - for k, v := range o.additionalProperties { - m[k] = v - } - } - buffer, err = json.Marshal(m) - return + // Schematics environment variables to use to deploy the configuration. + Setting []ProjectConfigSettingCollection `json:"setting,omitempty"` } -// UnmarshalResourceDeleteResponse unmarshals an instance of ResourceDeleteResponse from the specified map of raw messages. -func UnmarshalResourceDeleteResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceDeleteResponse) - for k := range m { - var v interface{} - e := core.UnmarshalPrimitive(m, k, &v) - if e != nil { - err = e - return - } - obj.SetProperty(k, v) +// NewProjectConfigPrototype : Instantiate ProjectConfigPrototype (Generic Model Constructor) +func (*ProjectV1) NewProjectConfigPrototype(name string, locatorID string) (_model *ProjectConfigPrototype, err error) { + _model = &ProjectConfigPrototype{ + Name: core.StringPtr(name), + LocatorID: core.StringPtr(locatorID), } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + err = core.ValidateStruct(_model, "required parameters") return } -// ResourceLastOperationGetResponse : The result of get_last_operation call. -type ResourceLastOperationGetResponse struct { - // Valid values are in progress, succeeded, and failed. - State *string `json:"state,omitempty"` - - // A user-facing message displayed to the platform API client. Can be used to tell the user details about the status of - // the operation. - Description *string `json:"description,omitempty"` -} - -// UnmarshalResourceLastOperationGetResponse unmarshals an instance of ResourceLastOperationGetResponse from the specified map of raw messages. -func UnmarshalResourceLastOperationGetResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceLastOperationGetResponse) - err = core.UnmarshalPrimitive(m, "state", &obj.State) +// UnmarshalProjectConfigPrototype unmarshals an instance of ProjectConfigPrototype from the specified map of raw messages. +func UnmarshalProjectConfigPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigPrototype) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "labels", &obj.Labels) if err != nil { return } @@ -6036,36 +4684,15 @@ func UnmarshalResourceLastOperationGetResponse(m map[string]json.RawMessage, res if err != nil { return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ResourceStateResponse : The result of Get instance status call. -type ResourceStateResponse struct { - // Indicates whether the service instance is active and is meaningful if enabled is true. The default value is true if - // not specified. - Active *string `json:"active,omitempty"` - - // Indicates the current state of the service instance. - Enabled *string `json:"enabled,omitempty"` - - // Indicates when the service instance was last accessed/modified/etc., and it is meaningful if enabled is true and - // active is false. Represented as milliseconds since the epoch, but does not need to be accurate to the second/hour. - LastActive *string `json:"last_active,omitempty"` -} - -// UnmarshalResourceStateResponse unmarshals an instance of ResourceStateResponse from the specified map of raw messages. -func UnmarshalResourceStateResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceStateResponse) - err = core.UnmarshalPrimitive(m, "active", &obj.Active) + err = core.UnmarshalPrimitive(m, "locator_id", &obj.LocatorID) if err != nil { return } - err = core.UnmarshalPrimitive(m, "enabled", &obj.Enabled) + err = core.UnmarshalModel(m, "input", &obj.Input, UnmarshalProjectConfigInputVariable) if err != nil { return } - err = core.UnmarshalPrimitive(m, "last_active", &obj.LastActive) + err = core.UnmarshalModel(m, "setting", &obj.Setting, UnmarshalProjectConfigSettingCollection) if err != nil { return } @@ -6073,107 +4700,136 @@ func UnmarshalResourceStateResponse(m map[string]json.RawMessage, result interfa return } -// ResourceUpdateResult : The result of deprovisioning service instance. -type ResourceUpdateResult struct { +// ProjectConfigSettingCollection : ProjectConfigSettingCollection struct +type ProjectConfigSettingCollection struct { + // The name of the configuration setting. + Name *string `json:"name" validate:"required"` - // Allows users to set arbitrary properties - additionalProperties map[string]interface{} + // The value of the configuration setting. + Value *string `json:"value" validate:"required"` } -// SetProperty allows the user to set an arbitrary property on an instance of ResourceUpdateResult -func (o *ResourceUpdateResult) SetProperty(key string, value interface{}) { - if o.additionalProperties == nil { - o.additionalProperties = make(map[string]interface{}) +// NewProjectConfigSettingCollection : Instantiate ProjectConfigSettingCollection (Generic Model Constructor) +func (*ProjectV1) NewProjectConfigSettingCollection(name string, value string) (_model *ProjectConfigSettingCollection, err error) { + _model = &ProjectConfigSettingCollection{ + Name: core.StringPtr(name), + Value: core.StringPtr(value), } - o.additionalProperties[key] = value + err = core.ValidateStruct(_model, "required parameters") + return } -// SetProperties allows the user to set a map of arbitrary properties on an instance of ResourceUpdateResult -func (o *ResourceUpdateResult) SetProperties(m map[string]interface{}) { - o.additionalProperties = make(map[string]interface{}) - for k, v := range m { - o.additionalProperties[k] = v +// UnmarshalProjectConfigSettingCollection unmarshals an instance of ProjectConfigSettingCollection from the specified map of raw messages. +func UnmarshalProjectConfigSettingCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectConfigSettingCollection) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// GetProperty allows the user to retrieve an arbitrary property from an instance of ResourceUpdateResult -func (o *ResourceUpdateResult) GetProperty(key string) interface{} { - return o.additionalProperties[key] -} +// ProjectMetadata : The metadata of the project. +type ProjectMetadata struct { + // An IBM Cloud resource name, which uniquely identifies a resource. + Crn *string `json:"crn,omitempty"` -// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of ResourceUpdateResult -func (o *ResourceUpdateResult) GetProperties() map[string]interface{} { - return o.additionalProperties -} + // A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time + // format as specified by RFC 3339. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` -// MarshalJSON performs custom serialization for instances of ResourceUpdateResult -func (o *ResourceUpdateResult) MarshalJSON() (buffer []byte, err error) { - m := make(map[string]interface{}) - if len(o.additionalProperties) > 0 { - for k, v := range o.additionalProperties { - m[k] = v - } - } - buffer, err = json.Marshal(m) - return -} + // The cumulative list of needs attention items for a project. + CumulativeNeedsAttentionView []CumulativeNeedsAttention `json:"cumulative_needs_attention_view,omitempty"` -// UnmarshalResourceUpdateResult unmarshals an instance of ResourceUpdateResult from the specified map of raw messages. -func UnmarshalResourceUpdateResult(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceUpdateResult) - for k := range m { - var v interface{} - e := core.UnmarshalPrimitive(m, k, &v) - if e != nil { - err = e - return - } - obj.SetProperty(k, v) - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + // "True" indicates that the fetch of the needs attention items failed. + CumulativeNeedsAttentionViewErr *string `json:"cumulative_needs_attention_view_err,omitempty"` + + // The IBM Cloud location where a resource is deployed. + Location *string `json:"location,omitempty"` + + // The resource group where the project's data and tools are created. + ResourceGroup *string `json:"resource_group,omitempty"` + + // The project status value. + State *string `json:"state,omitempty"` + + // The CRN of the event notifications instance if one is connected to this project. + EventNotificationsCrn *string `json:"event_notifications_crn,omitempty"` } -func (*ProjectV1) NewResourceUpdateResultPatch(resourceUpdateResult *ResourceUpdateResult) (_patch []JSONPatchOperation) { - for key, value := range resourceUpdateResult.additionalProperties { - _patch = append(_patch, JSONPatchOperation{ - Op: core.StringPtr(JSONPatchOperation_Op_Add), - Path: core.StringPtr("/" + key), - Value: value, - }) +// UnmarshalProjectMetadata unmarshals an instance of ProjectMetadata from the specified map of raw messages. +func UnmarshalProjectMetadata(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ProjectMetadata) + err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + return + } + err = core.UnmarshalModel(m, "cumulative_needs_attention_view", &obj.CumulativeNeedsAttentionView, UnmarshalCumulativeNeedsAttention) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "cumulative_needs_attention_view_err", &obj.CumulativeNeedsAttentionViewErr) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "location", &obj.Location) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "resource_group", &obj.ResourceGroup) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "event_notifications_crn", &obj.EventNotificationsCrn) + if err != nil { + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } // UninstallConfigOptions : The UninstallConfig options. type UninstallConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration to destroy configuration resources. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string } // NewUninstallConfigOptions : Instantiate UninstallConfigOptions -func (*ProjectV1) NewUninstallConfigOptions(id string, configID string) *UninstallConfigOptions { +func (*ProjectV1) NewUninstallConfigOptions(projectID string, id string) *UninstallConfigOptions { return &UninstallConfigOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), } } -// SetID : Allow user to set ID -func (_options *UninstallConfigOptions) SetID(id string) *UninstallConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *UninstallConfigOptions) SetProjectID(projectID string) *UninstallConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *UninstallConfigOptions) SetConfigID(configID string) *UninstallConfigOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *UninstallConfigOptions) SetID(id string) *UninstallConfigOptions { + _options.ID = core.StringPtr(id) return _options } @@ -6185,16 +4841,16 @@ func (options *UninstallConfigOptions) SetHeaders(param map[string]string) *Unin // UpdateConfigOptions : The UpdateConfig options. type UpdateConfigOptions struct { - // The ID of the project, which uniquely identifies it. - ID *string `json:"id" validate:"required,ne="` + // The unique project ID. + ProjectID *string `json:"project_id" validate:"required,ne="` - // The ID of the configuration, which uniquely identifies it. - ConfigID *string `json:"config_id" validate:"required,ne="` + // The unique identifier. + ID *string `json:"id" validate:"required,ne="` // The change delta of the project configuration to update. ProjectConfig []JSONPatchOperation `json:"project_config" validate:"required"` - // The flag to determine if full metadata should be returned. + // Determines whether the metadata should be returned. Only the metadata for the project is returned. Complete *bool `json:"complete,omitempty"` // Allows users to set headers on API requests @@ -6202,23 +4858,23 @@ type UpdateConfigOptions struct { } // NewUpdateConfigOptions : Instantiate UpdateConfigOptions -func (*ProjectV1) NewUpdateConfigOptions(id string, configID string, projectConfig []JSONPatchOperation) *UpdateConfigOptions { +func (*ProjectV1) NewUpdateConfigOptions(projectID string, id string, projectConfig []JSONPatchOperation) *UpdateConfigOptions { return &UpdateConfigOptions{ - ID: core.StringPtr(id), - ConfigID: core.StringPtr(configID), + ProjectID: core.StringPtr(projectID), + ID: core.StringPtr(id), ProjectConfig: projectConfig, } } -// SetID : Allow user to set ID -func (_options *UpdateConfigOptions) SetID(id string) *UpdateConfigOptions { - _options.ID = core.StringPtr(id) +// SetProjectID : Allow user to set ProjectID +func (_options *UpdateConfigOptions) SetProjectID(projectID string) *UpdateConfigOptions { + _options.ProjectID = core.StringPtr(projectID) return _options } -// SetConfigID : Allow user to set ConfigID -func (_options *UpdateConfigOptions) SetConfigID(configID string) *UpdateConfigOptions { - _options.ConfigID = core.StringPtr(configID) +// SetID : Allow user to set ID +func (_options *UpdateConfigOptions) SetID(id string) *UpdateConfigOptions { + _options.ID = core.StringPtr(id) return _options } @@ -6242,7 +4898,7 @@ func (options *UpdateConfigOptions) SetHeaders(param map[string]string) *UpdateC // UpdateProjectOptions : The UpdateProject options. type UpdateProjectOptions struct { - // The ID of the project, which uniquely identifies it. + // The unique identifier. ID *string `json:"id" validate:"required,ne="` // The new project definition document. @@ -6255,7 +4911,7 @@ type UpdateProjectOptions struct { // NewUpdateProjectOptions : Instantiate UpdateProjectOptions func (*ProjectV1) NewUpdateProjectOptions(id string, jsonPatchOperation []JSONPatchOperation) *UpdateProjectOptions { return &UpdateProjectOptions{ - ID: core.StringPtr(id), + ID: core.StringPtr(id), JSONPatchOperation: jsonPatchOperation, } } @@ -6278,78 +4934,13 @@ func (options *UpdateProjectOptions) SetHeaders(param map[string]string) *Update return options } -// UpdateServiceInstanceOptions : The UpdateServiceInstance options. -type UpdateServiceInstanceOptions struct { - // The ID of a previously provisioned service instance. - InstanceID *string `json:"instance_id" validate:"required,ne="` - - // It contains the query filters and the search token that is initally set to null or undefined. - JSONPatchOperation []JSONPatchOperation `json:"JsonPatchOperation" validate:"required"` - - // Broker API Version. - XBrokerApiVersion *string `json:"X-Broker-Api-Version,omitempty"` - - // Broker Api Originating Identity. - XBrokerApiOriginatingIdentity *string `json:"X-Broker-Api-Originating-Identity,omitempty"` - - // A value of true indicates that both the IBM Cloud platform and the requesting client support asynchronous - // deprovisioning. If this parameter is not included in the request, and the broker can only deprovision a service - // instance of the requested plan asynchronously, the broker MUST reject the request with a 422 Unprocessable Entity. - AcceptsIncomplete *bool `json:"accepts_incomplete,omitempty"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewUpdateServiceInstanceOptions : Instantiate UpdateServiceInstanceOptions -func (*ProjectV1) NewUpdateServiceInstanceOptions(instanceID string, jsonPatchOperation []JSONPatchOperation) *UpdateServiceInstanceOptions { - return &UpdateServiceInstanceOptions{ - InstanceID: core.StringPtr(instanceID), - JSONPatchOperation: jsonPatchOperation, - } -} - -// SetInstanceID : Allow user to set InstanceID -func (_options *UpdateServiceInstanceOptions) SetInstanceID(instanceID string) *UpdateServiceInstanceOptions { - _options.InstanceID = core.StringPtr(instanceID) - return _options -} - -// SetJSONPatchOperation : Allow user to set JSONPatchOperation -func (_options *UpdateServiceInstanceOptions) SetJSONPatchOperation(jsonPatchOperation []JSONPatchOperation) *UpdateServiceInstanceOptions { - _options.JSONPatchOperation = jsonPatchOperation - return _options -} - -// SetXBrokerApiVersion : Allow user to set XBrokerApiVersion -func (_options *UpdateServiceInstanceOptions) SetXBrokerApiVersion(xBrokerApiVersion string) *UpdateServiceInstanceOptions { - _options.XBrokerApiVersion = core.StringPtr(xBrokerApiVersion) - return _options -} - -// SetXBrokerApiOriginatingIdentity : Allow user to set XBrokerApiOriginatingIdentity -func (_options *UpdateServiceInstanceOptions) SetXBrokerApiOriginatingIdentity(xBrokerApiOriginatingIdentity string) *UpdateServiceInstanceOptions { - _options.XBrokerApiOriginatingIdentity = core.StringPtr(xBrokerApiOriginatingIdentity) - return _options -} - -// SetAcceptsIncomplete : Allow user to set AcceptsIncomplete -func (_options *UpdateServiceInstanceOptions) SetAcceptsIncomplete(acceptsIncomplete bool) *UpdateServiceInstanceOptions { - _options.AcceptsIncomplete = core.BoolPtr(acceptsIncomplete) - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *UpdateServiceInstanceOptions) SetHeaders(param map[string]string) *UpdateServiceInstanceOptions { - options.Headers = param - return options -} - +// // ProjectsPager can be used to simplify the use of the "ListProjects" method. +// type ProjectsPager struct { - hasNext bool - options *ListProjectsOptions - client *ProjectV1 + hasNext bool + options *ListProjectsOptions + client *ProjectV1 pageContext struct { next *string } diff --git a/projectv1/project_v1_examples_test.go b/projectv1/project_v1_examples_test.go index 91a1ad3..c25a4da 100644 --- a/projectv1/project_v1_examples_test.go +++ b/projectv1/project_v1_examples_test.go @@ -50,8 +50,8 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { config map[string]string // Variables to hold link values - projectIdLink string configIdLink string + projectIdLink string ) var shouldSkipTest = func() { @@ -115,6 +115,8 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { } createProjectOptions := projectService.NewCreateProjectOptions( + "Default", + "us-south", "acme-microservice", ) createProjectOptions.SetDescription("A microservice to deploy on top of ACME infrastructure.") @@ -214,7 +216,8 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { // begin-create_config projectConfigInputVariableModel := &projectv1.ProjectConfigInputVariable{ - Name: core.StringPtr("account_id"), + Name: core.StringPtr("account_id"), + Value: core.StringPtr(`$configs[].name["account-stage"].input.account_id`), } projectConfigSettingCollectionModel := &projectv1.ProjectConfigSettingCollection{ @@ -227,10 +230,10 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { "env-stage", "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", ) - createConfigOptions.SetNewLabels([]string{"env:stage", "governance:test", "build:0"}) - createConfigOptions.SetNewDescription("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptions.SetNewInput([]projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel}) - createConfigOptions.SetNewSetting([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel}) + createConfigOptions.SetLabels([]string{"env:stage", "governance:test", "build:0"}) + createConfigOptions.SetDescription("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptions.SetInput([]projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel}) + createConfigOptions.SetSetting([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel}) projectConfig, response, err := projectService.CreateConfig(createConfigOptions) if err != nil { @@ -255,7 +258,6 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { listConfigsOptions := projectService.NewListConfigsOptions( projectIdLink, ) - listConfigsOptions.SetProjectID(projectIdLink) projectConfigCollection, response, err := projectService.ListConfigs(listConfigsOptions) if err != nil { @@ -570,227 +572,6 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) Expect(notificationsGetResponse).ToNot(BeNil()) }) - It(`ReceivePulsarCatalogEvents request example`, func() { - // begin-receive_pulsar_catalog_events - - pulsarEventPrototypeCollectionModel := &projectv1.PulsarEventPrototypeCollection{ - EventType: core.StringPtr("create"), - Timestamp: CreateMockDateTime("2019-01-01T12:00:00.000Z"), - Publisher: core.StringPtr("provider"), - AccountID: core.StringPtr("accountId"), - Version: core.StringPtr("v1"), - } - - receivePulsarCatalogEventsOptions := projectService.NewReceivePulsarCatalogEventsOptions( - []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel}, - ) - - response, err := projectService.ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptions) - if err != nil { - panic(err) - } - if response.StatusCode != 202 { - fmt.Printf("\nUnexpected response status code received from ReceivePulsarCatalogEvents(): %d\n", response.StatusCode) - } - - // end-receive_pulsar_catalog_events - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(202)) - }) - It(`ReceivePulsarEventNotificationEvents request example`, func() { - // begin-receive_pulsar_event_notification_events - - pulsarEventPrototypeCollectionModel := &projectv1.PulsarEventPrototypeCollection{ - EventType: core.StringPtr("testString"), - Timestamp: CreateMockDateTime("2019-01-01T12:00:00.000Z"), - Publisher: core.StringPtr("provider"), - AccountID: core.StringPtr("accountid"), - Version: core.StringPtr("v1"), - } - - receivePulsarEventNotificationEventsOptions := projectService.NewReceivePulsarEventNotificationEventsOptions( - []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel}, - ) - - response, err := projectService.ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptions) - if err != nil { - panic(err) - } - if response.StatusCode != 202 { - fmt.Printf("\nUnexpected response status code received from ReceivePulsarEventNotificationEvents(): %d\n", response.StatusCode) - } - - // end-receive_pulsar_event_notification_events - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(202)) - }) - It(`GetHealth request example`, func() { - fmt.Println("\nGetHealth() result:") - // begin-get_health - - getHealthOptions := projectService.NewGetHealthOptions() - - health, response, err := projectService.GetHealth(getHealthOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(health, "", " ") - fmt.Println(string(b)) - - // end-get_health - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(health).ToNot(BeNil()) - }) - It(`ReplaceServiceInstance request example`, func() { - fmt.Println("\nReplaceServiceInstance() result:") - // begin-replace_service_instance - - replaceServiceInstanceOptions := projectService.NewReplaceServiceInstanceOptions( - "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", - projectIdLink, - configIdLink, - ) - replaceServiceInstanceOptions.SetXBrokerApiVersion("1.0") - replaceServiceInstanceOptions.SetXBrokerApiOriginatingIdentity("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0=") - replaceServiceInstanceOptions.SetAcceptsIncomplete(false) - - resourceCreateResponse, response, err := projectService.ReplaceServiceInstance(replaceServiceInstanceOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(resourceCreateResponse, "", " ") - fmt.Println(string(b)) - - // end-replace_service_instance - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceCreateResponse).ToNot(BeNil()) - }) - It(`UpdateServiceInstance request example`, func() { - fmt.Println("\nUpdateServiceInstance() result:") - // begin-update_service_instance - - jsonPatchOperationModel := &projectv1.JSONPatchOperation{ - Op: core.StringPtr("add"), - Path: core.StringPtr("testString"), - } - - updateServiceInstanceOptions := projectService.NewUpdateServiceInstanceOptions( - "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", - []projectv1.JSONPatchOperation{*jsonPatchOperationModel}, - ) - updateServiceInstanceOptions.SetXBrokerApiVersion("1.0") - updateServiceInstanceOptions.SetXBrokerApiOriginatingIdentity("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0=") - updateServiceInstanceOptions.SetAcceptsIncomplete(false) - - resourceUpdateResult, response, err := projectService.UpdateServiceInstance(updateServiceInstanceOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(resourceUpdateResult, "", " ") - fmt.Println(string(b)) - - // end-update_service_instance - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceUpdateResult).ToNot(BeNil()) - }) - It(`GetLastOperation request example`, func() { - fmt.Println("\nGetLastOperation() result:") - // begin-get_last_operation - - getLastOperationOptions := projectService.NewGetLastOperationOptions( - "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", - ) - getLastOperationOptions.SetXBrokerApiVersion("1.0") - getLastOperationOptions.SetOperation("ABCD") - getLastOperationOptions.SetPlanID("cb54391b-3316-4943-a5a6-a541678c1924") - getLastOperationOptions.SetServiceID("cb54391b-3316-4943-a5a6-a541678c1924") - - resourceLastOperationGetResponse, response, err := projectService.GetLastOperation(getLastOperationOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(resourceLastOperationGetResponse, "", " ") - fmt.Println(string(b)) - - // end-get_last_operation - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceLastOperationGetResponse).ToNot(BeNil()) - }) - It(`ReplaceServiceInstanceState request example`, func() { - fmt.Println("\nReplaceServiceInstanceState() result:") - // begin-replace_service_instance_state - - replaceServiceInstanceStateOptions := projectService.NewReplaceServiceInstanceStateOptions( - "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", - true, - ) - replaceServiceInstanceStateOptions.SetXBrokerApiVersion("1.0") - - resourceStateResponse, response, err := projectService.ReplaceServiceInstanceState(replaceServiceInstanceStateOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(resourceStateResponse, "", " ") - fmt.Println(string(b)) - - // end-replace_service_instance_state - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceStateResponse).ToNot(BeNil()) - }) - It(`GetServiceInstance request example`, func() { - fmt.Println("\nGetServiceInstance() result:") - // begin-get_service_instance - - getServiceInstanceOptions := projectService.NewGetServiceInstanceOptions( - "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", - ) - getServiceInstanceOptions.SetXBrokerApiVersion("1.0") - - resourceStateResponse, response, err := projectService.GetServiceInstance(getServiceInstanceOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(resourceStateResponse, "", " ") - fmt.Println(string(b)) - - // end-get_service_instance - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceStateResponse).ToNot(BeNil()) - }) - It(`GetCatalog request example`, func() { - fmt.Println("\nGetCatalog() result:") - // begin-get_catalog - - getCatalogOptions := projectService.NewGetCatalogOptions() - getCatalogOptions.SetXBrokerApiVersion("1.0") - - catalogResponse, response, err := projectService.GetCatalog(getCatalogOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(catalogResponse, "", " ") - fmt.Println(string(b)) - - // end-get_catalog - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(catalogResponse).ToNot(BeNil()) - }) It(`PostEventNotificationsIntegration request example`, func() { fmt.Println("\nPostEventNotificationsIntegration() result:") // begin-post_event_notifications_integration @@ -864,7 +645,7 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { // begin-delete_project deleteProjectOptions := projectService.NewDeleteProjectOptions( - projectIdLink, + "testString", ) response, err := projectService.DeleteProject(deleteProjectOptions) @@ -885,8 +666,8 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { // begin-delete_config deleteConfigOptions := projectService.NewDeleteConfigOptions( - projectIdLink, - configIdLink, + "testString", + "testString", ) projectConfigDelete, response, err := projectService.DeleteConfig(deleteConfigOptions) @@ -902,37 +683,11 @@ var _ = Describe(`ProjectV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) Expect(projectConfigDelete).ToNot(BeNil()) }) - It(`DeleteServiceInstance request example`, func() { - fmt.Println("\nDeleteServiceInstance() result:") - // begin-delete_service_instance - - deleteServiceInstanceOptions := projectService.NewDeleteServiceInstanceOptions( - "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", - "cb54391b-3316-4943-a5a6-a541678c1924", - "cb54391b-3316-4943-a5a6-a541678c1924", - ) - deleteServiceInstanceOptions.SetXBrokerApiVersion("1.0") - deleteServiceInstanceOptions.SetXBrokerApiOriginatingIdentity("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0=") - deleteServiceInstanceOptions.SetAcceptsIncomplete(false) - - resourceDeleteResponse, response, err := projectService.DeleteServiceInstance(deleteServiceInstanceOptions) - if err != nil { - panic(err) - } - b, _ := json.MarshalIndent(resourceDeleteResponse, "", " ") - fmt.Println(string(b)) - - // end-delete_service_instance - - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceDeleteResponse).ToNot(BeNil()) - }) It(`DeleteEventNotificationsIntegration request example`, func() { // begin-delete_event_notifications_integration deleteEventNotificationsIntegrationOptions := projectService.NewDeleteEventNotificationsIntegrationOptions( - projectIdLink, + "testString", ) response, err := projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptions) diff --git a/projectv1/project_v1_integration_test.go b/projectv1/project_v1_integration_test.go index 4765826..2a17642 100644 --- a/projectv1/project_v1_integration_test.go +++ b/projectv1/project_v1_integration_test.go @@ -49,8 +49,8 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { config map[string]string // Variables to hold link values - projectIdLink string configIdLink string + projectIdLink string ) var shouldSkipTest = func() { @@ -102,16 +102,16 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`CreateProject(createProjectOptions *CreateProjectOptions)`, func() { projectConfigInputVariableModel := &projectv1.ProjectConfigInputVariable{ - Name: core.StringPtr("testString"), + Name: core.StringPtr("configVar1"), + Value: core.StringPtr("configValue1"), } projectConfigSettingCollectionModel := &projectv1.ProjectConfigSettingCollection{ - Name: core.StringPtr("testString"), - Value: core.StringPtr("testString"), + Name: core.StringPtr("setting1"), + Value: core.StringPtr("value1"), } projectConfigPrototypeModel := &projectv1.ProjectConfigPrototype{ - ID: core.StringPtr("testString"), Name: core.StringPtr("common-variables"), Labels: []string{"testString"}, Description: core.StringPtr("testString"), @@ -202,7 +202,7 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) }) - Describe(`GetProject - Get project by ID`, func() { + Describe(`GetProject - Get a project`, func() { BeforeEach(func() { shouldSkipTest() }) @@ -250,7 +250,8 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`CreateConfig(createConfigOptions *CreateConfigOptions)`, func() { projectConfigInputVariableModel := &projectv1.ProjectConfigInputVariable{ - Name: core.StringPtr("account_id"), + Name: core.StringPtr("account_id"), + Value: core.StringPtr(`$configs[].name[\"account-stage\"].input.account_id`), } projectConfigSettingCollectionModel := &projectv1.ProjectConfigSettingCollection{ @@ -259,13 +260,13 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { } createConfigOptions := &projectv1.CreateConfigOptions{ - ID: &projectIdLink, - NewName: core.StringPtr("env-stage"), - NewLocatorID: core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"), - NewLabels: []string{"env:stage", "governance:test", "build:0"}, - NewDescription: core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace."), - NewInput: []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel}, - NewSetting: []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel}, + ProjectID: &projectIdLink, + Name: core.StringPtr("env-stage"), + LocatorID: core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"), + Labels: []string{"env:stage", "governance:test", "build:0"}, + Description: core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace."), + Input: []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel}, + Setting: []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel}, } projectConfig, response, err := projectService.CreateConfig(createConfigOptions) @@ -284,9 +285,9 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`ListConfigs(listConfigsOptions *ListConfigsOptions)`, func() { listConfigsOptions := &projectv1.ListConfigsOptions{ - ID: &projectIdLink, - Version: core.StringPtr("active"), - Complete: core.BoolPtr(false), + ProjectID: &projectIdLink, + Version: core.StringPtr("active"), + Complete: core.BoolPtr(false), } projectConfigCollection, response, err := projectService.ListConfigs(listConfigsOptions) @@ -302,10 +303,10 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`GetConfig(getConfigOptions *GetConfigOptions)`, func() { getConfigOptions := &projectv1.GetConfigOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, - Version: core.StringPtr("active"), - Complete: core.BoolPtr(false), + ProjectID: &projectIdLink, + ID: &configIdLink, + Version: core.StringPtr("active"), + Complete: core.BoolPtr(false), } projectConfig, response, err := projectService.GetConfig(getConfigOptions) @@ -328,8 +329,8 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { } updateConfigOptions := &projectv1.UpdateConfigOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, + ProjectID: &projectIdLink, + ID: &configIdLink, ProjectConfig: []projectv1.JSONPatchOperation{*jsonPatchOperationModel}, Complete: core.BoolPtr(false), } @@ -347,8 +348,8 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`GetConfigDiff(getConfigDiffOptions *GetConfigDiffOptions)`, func() { getConfigDiffOptions := &projectv1.GetConfigDiffOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, + ProjectID: &projectIdLink, + ID: &configIdLink, } projectConfigDiff, response, err := projectService.GetConfigDiff(getConfigDiffOptions) @@ -364,10 +365,10 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`ForceApprove(forceApproveOptions *ForceApproveOptions)`, func() { forceApproveOptions := &projectv1.ForceApproveOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, - Comment: core.StringPtr("Approving the changes"), - Complete: core.BoolPtr(false), + ProjectID: &projectIdLink, + ID: &configIdLink, + Comment: core.StringPtr("Approving the changes"), + Complete: core.BoolPtr(false), } projectConfig, response, err := projectService.ForceApprove(forceApproveOptions) @@ -383,10 +384,10 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`Approve(approveOptions *ApproveOptions)`, func() { approveOptions := &projectv1.ApproveOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, - Comment: core.StringPtr("Approving the changes"), - Complete: core.BoolPtr(false), + ProjectID: &projectIdLink, + ID: &configIdLink, + Comment: core.StringPtr("Approving the changes"), + Complete: core.BoolPtr(false), } projectConfig, response, err := projectService.Approve(approveOptions) @@ -402,11 +403,11 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`CheckConfig(checkConfigOptions *CheckConfigOptions)`, func() { checkConfigOptions := &projectv1.CheckConfigOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, + ProjectID: &projectIdLink, + ID: &configIdLink, XAuthRefreshToken: core.StringPtr("token"), - Version: core.StringPtr("active"), Complete: core.BoolPtr(false), + Version: core.StringPtr("active"), } projectConfig, response, err := projectService.CheckConfig(checkConfigOptions) @@ -422,9 +423,9 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`InstallConfig(installConfigOptions *InstallConfigOptions)`, func() { installConfigOptions := &projectv1.InstallConfigOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, - Complete: core.BoolPtr(false), + ProjectID: &projectIdLink, + ID: &configIdLink, + Complete: core.BoolPtr(false), } projectConfig, response, err := projectService.InstallConfig(installConfigOptions) @@ -440,8 +441,8 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`UninstallConfig(uninstallConfigOptions *UninstallConfigOptions)`, func() { uninstallConfigOptions := &projectv1.UninstallConfigOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, + ProjectID: &projectIdLink, + ID: &configIdLink, } response, err := projectService.UninstallConfig(uninstallConfigOptions) @@ -456,10 +457,10 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`GetSchematicsJob(getSchematicsJobOptions *GetSchematicsJobOptions)`, func() { getSchematicsJobOptions := &projectv1.GetSchematicsJobOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, - Action: core.StringPtr("plan"), - Since: core.Int64Ptr(int64(38)), + ProjectID: &projectIdLink, + ID: &configIdLink, + Action: core.StringPtr("plan"), + Since: core.Int64Ptr(int64(38)), } actionJob, response, err := projectService.GetSchematicsJob(getSchematicsJobOptions) @@ -475,9 +476,9 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`GetCostEstimate(getCostEstimateOptions *GetCostEstimateOptions)`, func() { getCostEstimateOptions := &projectv1.GetCostEstimateOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, - Version: core.StringPtr("active"), + ProjectID: &projectIdLink, + ID: &configIdLink, + Version: core.StringPtr("active"), } costEstimate, response, err := projectService.GetCostEstimate(getCostEstimateOptions) @@ -545,200 +546,6 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) }) - Describe(`ReceivePulsarCatalogEvents - Webhook for catalog events`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptions *ReceivePulsarCatalogEventsOptions)`, func() { - pulsarEventPrototypeCollectionModel := &projectv1.PulsarEventPrototypeCollection{ - EventType: core.StringPtr("testString"), - Timestamp: CreateMockDateTime("2019-01-01T12:00:00.000Z"), - Publisher: core.StringPtr("testString"), - AccountID: core.StringPtr("testString"), - Version: core.StringPtr("testString"), - EventProperties: map[string]interface{}{"anyKey": "anyValue"}, - EventID: core.StringPtr("testString"), - } - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - - receivePulsarCatalogEventsOptions := &projectv1.ReceivePulsarCatalogEventsOptions{ - PulsarCatalogEvents: []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel}, - } - - response, err := projectService.ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(202)) - }) - }) - - Describe(`ReceivePulsarEventNotificationEvents - Webhook for event notifications events`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptions *ReceivePulsarEventNotificationEventsOptions)`, func() { - pulsarEventPrototypeCollectionModel := &projectv1.PulsarEventPrototypeCollection{ - EventType: core.StringPtr("testString"), - Timestamp: CreateMockDateTime("2019-01-01T12:00:00.000Z"), - Publisher: core.StringPtr("testString"), - AccountID: core.StringPtr("testString"), - Version: core.StringPtr("testString"), - EventProperties: map[string]interface{}{"anyKey": "anyValue"}, - EventID: core.StringPtr("testString"), - } - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - - receivePulsarEventNotificationEventsOptions := &projectv1.ReceivePulsarEventNotificationEventsOptions{ - PulsarEventNotificationEvents: []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel}, - } - - response, err := projectService.ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(202)) - }) - }) - - Describe(`GetHealth - Get service health information`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`GetHealth(getHealthOptions *GetHealthOptions)`, func() { - getHealthOptions := &projectv1.GetHealthOptions{ - Info: core.BoolPtr(false), - } - - health, response, err := projectService.GetHealth(getHealthOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(health).ToNot(BeNil()) - }) - }) - - Describe(`ReplaceServiceInstance - Create a new service instance`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`ReplaceServiceInstance(replaceServiceInstanceOptions *ReplaceServiceInstanceOptions)`, func() { - replaceServiceInstanceOptions := &projectv1.ReplaceServiceInstanceOptions{ - InstanceID: core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"), - ServiceID: core.StringPtr("testString"), - PlanID: core.StringPtr("testString"), - Context: []string{"testString"}, - Parameters: map[string]interface{}{"anyKey": "anyValue"}, - PreviousValues: []string{"testString"}, - XBrokerApiVersion: core.StringPtr("1.0"), - XBrokerApiOriginatingIdentity: core.StringPtr("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0="), - AcceptsIncomplete: core.BoolPtr(false), - } - - resourceCreateResponse, response, err := projectService.ReplaceServiceInstance(replaceServiceInstanceOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceCreateResponse).ToNot(BeNil()) - }) - }) - - Describe(`UpdateServiceInstance - Change of plans and service parameters in a provisioned service instance`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`UpdateServiceInstance(updateServiceInstanceOptions *UpdateServiceInstanceOptions)`, func() { - jsonPatchOperationModel := &projectv1.JSONPatchOperation{ - Op: core.StringPtr("add"), - Path: core.StringPtr("testString"), - From: core.StringPtr("testString"), - Value: core.StringPtr("testString"), - } - - updateServiceInstanceOptions := &projectv1.UpdateServiceInstanceOptions{ - InstanceID: core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"), - JSONPatchOperation: []projectv1.JSONPatchOperation{*jsonPatchOperationModel}, - XBrokerApiVersion: core.StringPtr("1.0"), - XBrokerApiOriginatingIdentity: core.StringPtr("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0="), - AcceptsIncomplete: core.BoolPtr(false), - } - - resourceUpdateResult, response, err := projectService.UpdateServiceInstance(updateServiceInstanceOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceUpdateResult).ToNot(BeNil()) - }) - }) - - Describe(`GetLastOperation - Get last_operation for instance by GUID`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`GetLastOperation(getLastOperationOptions *GetLastOperationOptions)`, func() { - getLastOperationOptions := &projectv1.GetLastOperationOptions{ - InstanceID: core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"), - XBrokerApiVersion: core.StringPtr("1.0"), - Operation: core.StringPtr("ABCD"), - PlanID: core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"), - ServiceID: core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"), - } - - resourceLastOperationGetResponse, response, err := projectService.GetLastOperation(getLastOperationOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceLastOperationGetResponse).ToNot(BeNil()) - }) - }) - - Describe(`ReplaceServiceInstanceState - Update the state of a provisioned service instance`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`ReplaceServiceInstanceState(replaceServiceInstanceStateOptions *ReplaceServiceInstanceStateOptions)`, func() { - replaceServiceInstanceStateOptions := &projectv1.ReplaceServiceInstanceStateOptions{ - InstanceID: core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"), - Enabled: core.BoolPtr(true), - InitiatorID: core.StringPtr("testString"), - ReasonCode: map[string]interface{}{"anyKey": "anyValue"}, - PlanID: core.StringPtr("testString"), - PreviousValues: []string{"testString"}, - XBrokerApiVersion: core.StringPtr("1.0"), - } - - resourceStateResponse, response, err := projectService.ReplaceServiceInstanceState(replaceServiceInstanceStateOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceStateResponse).ToNot(BeNil()) - }) - }) - - Describe(`GetServiceInstance - Get the current state information`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`GetServiceInstance(getServiceInstanceOptions *GetServiceInstanceOptions)`, func() { - getServiceInstanceOptions := &projectv1.GetServiceInstanceOptions{ - InstanceID: core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"), - XBrokerApiVersion: core.StringPtr("1.0"), - } - - resourceStateResponse, response, err := projectService.GetServiceInstance(getServiceInstanceOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceStateResponse).ToNot(BeNil()) - }) - }) - - Describe(`GetCatalog - Get the catalog metadata`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`GetCatalog(getCatalogOptions *GetCatalogOptions)`, func() { - getCatalogOptions := &projectv1.GetCatalogOptions{ - XBrokerApiVersion: core.StringPtr("1.0"), - } - - catalogResponse, response, err := projectService.GetCatalog(getCatalogOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(catalogResponse).ToNot(BeNil()) - }) - }) - Describe(`PostEventNotificationsIntegration - Connect to a event notifications instance`, func() { BeforeEach(func() { shouldSkipTest() @@ -815,8 +622,8 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) It(`DeleteConfig(deleteConfigOptions *DeleteConfigOptions)`, func() { deleteConfigOptions := &projectv1.DeleteConfigOptions{ - ID: &projectIdLink, - ConfigID: &configIdLink, + ProjectID: &projectIdLink, + ID: &configIdLink, DraftOnly: core.BoolPtr(false), Destroy: core.BoolPtr(false), } @@ -828,27 +635,6 @@ var _ = Describe(`ProjectV1 Integration Tests`, func() { }) }) - Describe(`DeleteServiceInstance - Delete a project service instance`, func() { - BeforeEach(func() { - shouldSkipTest() - }) - It(`DeleteServiceInstance(deleteServiceInstanceOptions *DeleteServiceInstanceOptions)`, func() { - deleteServiceInstanceOptions := &projectv1.DeleteServiceInstanceOptions{ - InstanceID: core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"), - PlanID: core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"), - ServiceID: core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"), - XBrokerApiVersion: core.StringPtr("1.0"), - XBrokerApiOriginatingIdentity: core.StringPtr("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0="), - AcceptsIncomplete: core.BoolPtr(false), - } - - resourceDeleteResponse, response, err := projectService.DeleteServiceInstance(deleteServiceInstanceOptions) - Expect(err).To(BeNil()) - Expect(response.StatusCode).To(Equal(200)) - Expect(resourceDeleteResponse).ToNot(BeNil()) - }) - }) - Describe(`DeleteEventNotificationsIntegration - Delete an event notifications connection`, func() { BeforeEach(func() { shouldSkipTest() diff --git a/projectv1/project_v1_test.go b/projectv1/project_v1_test.go index c6241c0..70c2416 100644 --- a/projectv1/project_v1_test.go +++ b/projectv1/project_v1_test.go @@ -67,13 +67,14 @@ var _ = Describe(`ProjectV1`, func() { Context(`Using external config, construct service client instances`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "PROJECT_URL": "https://projectv1/api", + "PROJECT_URL": "https://projectv1/api", "PROJECT_AUTH_TYPE": "noauth", } It(`Create service client using external config successfully`, func() { SetTestEnvironment(testEnvironment) - projectService, serviceErr := projectv1.NewProjectV1UsingExternalConfig(&projectv1.ProjectV1Options{}) + projectService, serviceErr := projectv1.NewProjectV1UsingExternalConfig(&projectv1.ProjectV1Options{ + }) Expect(projectService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) @@ -102,7 +103,8 @@ var _ = Describe(`ProjectV1`, func() { }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) - projectService, serviceErr := projectv1.NewProjectV1UsingExternalConfig(&projectv1.ProjectV1Options{}) + projectService, serviceErr := projectv1.NewProjectV1UsingExternalConfig(&projectv1.ProjectV1Options{ + }) err := projectService.SetServiceURL("https://testService/api") Expect(err).To(BeNil()) Expect(projectService).ToNot(BeNil()) @@ -120,12 +122,13 @@ var _ = Describe(`ProjectV1`, func() { Context(`Using external config, construct service client instances with error: Invalid Auth`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "PROJECT_URL": "https://projectv1/api", + "PROJECT_URL": "https://projectv1/api", "PROJECT_AUTH_TYPE": "someOtherAuth", } SetTestEnvironment(testEnvironment) - projectService, serviceErr := projectv1.NewProjectV1UsingExternalConfig(&projectv1.ProjectV1Options{}) + projectService, serviceErr := projectv1.NewProjectV1UsingExternalConfig(&projectv1.ProjectV1Options{ + }) It(`Instantiate service client with error`, func() { Expect(projectService).To(BeNil()) @@ -136,7 +139,7 @@ var _ = Describe(`ProjectV1`, func() { Context(`Using external config, construct service client instances with error: Invalid URL`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "PROJECT_AUTH_TYPE": "NOAuth", + "PROJECT_AUTH_TYPE": "NOAuth", } SetTestEnvironment(testEnvironment) @@ -171,8 +174,8 @@ var _ = Describe(`ProjectV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(createProjectPath)) Expect(req.Method).To(Equal("POST")) - Expect(req.URL.Query()["resource_group"]).To(Equal([]string{"Default"})) - Expect(req.URL.Query()["location"]).To(Equal([]string{"us-south"})) + Expect(req.URL.Query()["resource_group"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["location"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(201) fmt.Fprint(res, `} this is not valid json {`) @@ -189,6 +192,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("testString") + projectConfigInputVariableModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -207,11 +211,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateProjectOptions model createProjectOptionsModel := new(projectv1.CreateProjectOptions) + createProjectOptionsModel.ResourceGroup = core.StringPtr("testString") + createProjectOptionsModel.Location = core.StringPtr("testString") createProjectOptionsModel.Name = core.StringPtr("acme-microservice") createProjectOptionsModel.Description = core.StringPtr("A microservice to deploy on top of ACME infrastructure.") createProjectOptionsModel.Configs = []projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel} - createProjectOptionsModel.ResourceGroup = core.StringPtr("Default") - createProjectOptionsModel.Location = core.StringPtr("us-south") createProjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := projectService.CreateProject(createProjectOptionsModel) @@ -258,15 +262,15 @@ var _ = Describe(`ProjectV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) - Expect(req.URL.Query()["resource_group"]).To(Equal([]string{"Default"})) - Expect(req.URL.Query()["location"]).To(Equal([]string{"us-south"})) + Expect(req.URL.Query()["resource_group"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["location"]).To(Equal([]string{"testString"})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) + fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) })) }) It(`Invoke CreateProject successfully with retries`, func() { @@ -281,6 +285,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("testString") + projectConfigInputVariableModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -299,11 +304,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateProjectOptions model createProjectOptionsModel := new(projectv1.CreateProjectOptions) + createProjectOptionsModel.ResourceGroup = core.StringPtr("testString") + createProjectOptionsModel.Location = core.StringPtr("testString") createProjectOptionsModel.Name = core.StringPtr("acme-microservice") createProjectOptionsModel.Description = core.StringPtr("A microservice to deploy on top of ACME infrastructure.") createProjectOptionsModel.Configs = []projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel} - createProjectOptionsModel.ResourceGroup = core.StringPtr("Default") - createProjectOptionsModel.Location = core.StringPtr("us-south") createProjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -356,12 +361,12 @@ var _ = Describe(`ProjectV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) - Expect(req.URL.Query()["resource_group"]).To(Equal([]string{"Default"})) - Expect(req.URL.Query()["location"]).To(Equal([]string{"us-south"})) + Expect(req.URL.Query()["resource_group"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["location"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) + fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) })) }) It(`Invoke CreateProject successfully`, func() { @@ -381,6 +386,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("testString") + projectConfigInputVariableModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -399,11 +405,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateProjectOptions model createProjectOptionsModel := new(projectv1.CreateProjectOptions) + createProjectOptionsModel.ResourceGroup = core.StringPtr("testString") + createProjectOptionsModel.Location = core.StringPtr("testString") createProjectOptionsModel.Name = core.StringPtr("acme-microservice") createProjectOptionsModel.Description = core.StringPtr("A microservice to deploy on top of ACME infrastructure.") createProjectOptionsModel.Configs = []projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel} - createProjectOptionsModel.ResourceGroup = core.StringPtr("Default") - createProjectOptionsModel.Location = core.StringPtr("us-south") createProjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -424,6 +430,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("testString") + projectConfigInputVariableModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -442,11 +449,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateProjectOptions model createProjectOptionsModel := new(projectv1.CreateProjectOptions) + createProjectOptionsModel.ResourceGroup = core.StringPtr("testString") + createProjectOptionsModel.Location = core.StringPtr("testString") createProjectOptionsModel.Name = core.StringPtr("acme-microservice") createProjectOptionsModel.Description = core.StringPtr("A microservice to deploy on top of ACME infrastructure.") createProjectOptionsModel.Configs = []projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel} - createProjectOptionsModel.ResourceGroup = core.StringPtr("Default") - createProjectOptionsModel.Location = core.StringPtr("us-south") createProjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") @@ -488,6 +495,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("testString") + projectConfigInputVariableModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -506,11 +514,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateProjectOptions model createProjectOptionsModel := new(projectv1.CreateProjectOptions) + createProjectOptionsModel.ResourceGroup = core.StringPtr("testString") + createProjectOptionsModel.Location = core.StringPtr("testString") createProjectOptionsModel.Name = core.StringPtr("acme-microservice") createProjectOptionsModel.Description = core.StringPtr("A microservice to deploy on top of ACME infrastructure.") createProjectOptionsModel.Configs = []projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel} - createProjectOptionsModel.ResourceGroup = core.StringPtr("Default") - createProjectOptionsModel.Location = core.StringPtr("us-south") createProjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -755,14 +763,14 @@ var _ = Describe(`ProjectV1`, func() { nextObject := new(projectv1.PaginationLink) nextObject.Start = core.StringPtr("abc-123") responseObject.Next = nextObject - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "Next" property in the response`, func() { responseObject := new(projectv1.ProjectCollection) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -800,7 +808,7 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) listProjectsOptionsModel := &projectv1.ListProjectsOptions{ - Limit: core.Int64Ptr(int64(10)), + Limit: core.Int64Ptr(int64(10)), Complete: core.BoolPtr(false), } @@ -826,7 +834,7 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) listProjectsOptionsModel := &projectv1.ListProjectsOptions{ - Limit: core.Int64Ptr(int64(10)), + Limit: core.Int64Ptr(int64(10)), Complete: core.BoolPtr(false), } @@ -909,7 +917,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) + fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) })) }) It(`Invoke GetProject successfully with retries`, func() { @@ -967,7 +975,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) + fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) })) }) It(`Invoke GetProject successfully`, func() { @@ -1155,7 +1163,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) + fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) })) }) It(`Invoke UpdateProject successfully with retries`, func() { @@ -1233,7 +1241,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) + fmt.Fprintf(res, "%s", `{"name": "Name", "description": "Description", "id": "ID", "crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}], "metadata": {"crn": "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::", "created_at": "2019-01-01T12:00:00.000Z", "cumulative_needs_attention_view": [{"event": "Event", "event_id": "EventID", "config_id": "ConfigID", "config_version": 13}], "cumulative_needs_attention_view_err": "CumulativeNeedsAttentionViewErr", "location": "Location", "resource_group": "ResourceGroup", "state": "State", "event_notifications_crn": "EventNotificationsCrn"}}`) })) }) It(`Invoke UpdateProject successfully`, func() { @@ -1450,6 +1458,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("account_id") + projectConfigInputVariableModel.Value = core.StringPtr(`$configs[].name["account-stage"].input.account_id`) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -1458,14 +1467,14 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateConfigOptions model createConfigOptionsModel := new(projectv1.CreateConfigOptions) + createConfigOptionsModel.ProjectID = core.StringPtr("testString") + createConfigOptionsModel.Name = core.StringPtr("env-stage") + createConfigOptionsModel.LocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") createConfigOptionsModel.ID = core.StringPtr("testString") - createConfigOptionsModel.NewName = core.StringPtr("env-stage") - createConfigOptionsModel.NewLocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") - createConfigOptionsModel.NewID = core.StringPtr("testString") - createConfigOptionsModel.NewLabels = []string{"env:stage", "governance:test", "build:0"} - createConfigOptionsModel.NewDescription = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptionsModel.NewInput = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} - createConfigOptionsModel.NewSetting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} + createConfigOptionsModel.Labels = []string{"env:stage", "governance:test", "build:0"} + createConfigOptionsModel.Description = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptionsModel.Input = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} + createConfigOptionsModel.Setting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} createConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := projectService.CreateConfig(createConfigOptionsModel) @@ -1518,7 +1527,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke CreateConfig successfully with retries`, func() { @@ -1533,6 +1542,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("account_id") + projectConfigInputVariableModel.Value = core.StringPtr(`$configs[].name["account-stage"].input.account_id`) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -1541,14 +1551,14 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateConfigOptions model createConfigOptionsModel := new(projectv1.CreateConfigOptions) + createConfigOptionsModel.ProjectID = core.StringPtr("testString") + createConfigOptionsModel.Name = core.StringPtr("env-stage") + createConfigOptionsModel.LocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") createConfigOptionsModel.ID = core.StringPtr("testString") - createConfigOptionsModel.NewName = core.StringPtr("env-stage") - createConfigOptionsModel.NewLocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") - createConfigOptionsModel.NewID = core.StringPtr("testString") - createConfigOptionsModel.NewLabels = []string{"env:stage", "governance:test", "build:0"} - createConfigOptionsModel.NewDescription = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptionsModel.NewInput = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} - createConfigOptionsModel.NewSetting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} + createConfigOptionsModel.Labels = []string{"env:stage", "governance:test", "build:0"} + createConfigOptionsModel.Description = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptionsModel.Input = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} + createConfigOptionsModel.Setting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} createConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -1604,7 +1614,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke CreateConfig successfully`, func() { @@ -1624,6 +1634,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("account_id") + projectConfigInputVariableModel.Value = core.StringPtr(`$configs[].name["account-stage"].input.account_id`) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -1632,14 +1643,14 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateConfigOptions model createConfigOptionsModel := new(projectv1.CreateConfigOptions) + createConfigOptionsModel.ProjectID = core.StringPtr("testString") + createConfigOptionsModel.Name = core.StringPtr("env-stage") + createConfigOptionsModel.LocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") createConfigOptionsModel.ID = core.StringPtr("testString") - createConfigOptionsModel.NewName = core.StringPtr("env-stage") - createConfigOptionsModel.NewLocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") - createConfigOptionsModel.NewID = core.StringPtr("testString") - createConfigOptionsModel.NewLabels = []string{"env:stage", "governance:test", "build:0"} - createConfigOptionsModel.NewDescription = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptionsModel.NewInput = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} - createConfigOptionsModel.NewSetting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} + createConfigOptionsModel.Labels = []string{"env:stage", "governance:test", "build:0"} + createConfigOptionsModel.Description = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptionsModel.Input = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} + createConfigOptionsModel.Setting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} createConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -1660,6 +1671,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("account_id") + projectConfigInputVariableModel.Value = core.StringPtr(`$configs[].name["account-stage"].input.account_id`) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -1668,14 +1680,14 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateConfigOptions model createConfigOptionsModel := new(projectv1.CreateConfigOptions) + createConfigOptionsModel.ProjectID = core.StringPtr("testString") + createConfigOptionsModel.Name = core.StringPtr("env-stage") + createConfigOptionsModel.LocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") createConfigOptionsModel.ID = core.StringPtr("testString") - createConfigOptionsModel.NewName = core.StringPtr("env-stage") - createConfigOptionsModel.NewLocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") - createConfigOptionsModel.NewID = core.StringPtr("testString") - createConfigOptionsModel.NewLabels = []string{"env:stage", "governance:test", "build:0"} - createConfigOptionsModel.NewDescription = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptionsModel.NewInput = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} - createConfigOptionsModel.NewSetting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} + createConfigOptionsModel.Labels = []string{"env:stage", "governance:test", "build:0"} + createConfigOptionsModel.Description = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptionsModel.Input = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} + createConfigOptionsModel.Setting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} createConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") @@ -1717,6 +1729,7 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ProjectConfigInputVariable model projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) projectConfigInputVariableModel.Name = core.StringPtr("account_id") + projectConfigInputVariableModel.Value = core.StringPtr(`$configs[].name["account-stage"].input.account_id`) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -1725,14 +1738,14 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CreateConfigOptions model createConfigOptionsModel := new(projectv1.CreateConfigOptions) + createConfigOptionsModel.ProjectID = core.StringPtr("testString") + createConfigOptionsModel.Name = core.StringPtr("env-stage") + createConfigOptionsModel.LocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") createConfigOptionsModel.ID = core.StringPtr("testString") - createConfigOptionsModel.NewName = core.StringPtr("env-stage") - createConfigOptionsModel.NewLocatorID = core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") - createConfigOptionsModel.NewID = core.StringPtr("testString") - createConfigOptionsModel.NewLabels = []string{"env:stage", "governance:test", "build:0"} - createConfigOptionsModel.NewDescription = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptionsModel.NewInput = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} - createConfigOptionsModel.NewSetting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} + createConfigOptionsModel.Labels = []string{"env:stage", "governance:test", "build:0"} + createConfigOptionsModel.Description = core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptionsModel.Input = []projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel} + createConfigOptionsModel.Setting = []projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel} createConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -1775,7 +1788,6 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ListConfigsOptions model listConfigsOptionsModel := new(projectv1.ListConfigsOptions) - listConfigsOptionsModel.ID = core.StringPtr("testString") listConfigsOptionsModel.ProjectID = core.StringPtr("testString") listConfigsOptionsModel.Version = core.StringPtr("active") listConfigsOptionsModel.Complete = core.BoolPtr(false) @@ -1817,7 +1829,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}]}`) + fmt.Fprintf(res, "%s", `{"configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}]}`) })) }) It(`Invoke ListConfigs successfully with retries`, func() { @@ -1831,7 +1843,6 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ListConfigsOptions model listConfigsOptionsModel := new(projectv1.ListConfigsOptions) - listConfigsOptionsModel.ID = core.StringPtr("testString") listConfigsOptionsModel.ProjectID = core.StringPtr("testString") listConfigsOptionsModel.Version = core.StringPtr("active") listConfigsOptionsModel.Complete = core.BoolPtr(false) @@ -1876,7 +1887,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}]}`) + fmt.Fprintf(res, "%s", `{"configs": [{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}]}`) })) }) It(`Invoke ListConfigs successfully`, func() { @@ -1895,7 +1906,6 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ListConfigsOptions model listConfigsOptionsModel := new(projectv1.ListConfigsOptions) - listConfigsOptionsModel.ID = core.StringPtr("testString") listConfigsOptionsModel.ProjectID = core.StringPtr("testString") listConfigsOptionsModel.Version = core.StringPtr("active") listConfigsOptionsModel.Complete = core.BoolPtr(false) @@ -1918,7 +1928,6 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ListConfigsOptions model listConfigsOptionsModel := new(projectv1.ListConfigsOptions) - listConfigsOptionsModel.ID = core.StringPtr("testString") listConfigsOptionsModel.ProjectID = core.StringPtr("testString") listConfigsOptionsModel.Version = core.StringPtr("active") listConfigsOptionsModel.Complete = core.BoolPtr(false) @@ -1962,7 +1971,6 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ListConfigsOptions model listConfigsOptionsModel := new(projectv1.ListConfigsOptions) - listConfigsOptionsModel.ID = core.StringPtr("testString") listConfigsOptionsModel.ProjectID = core.StringPtr("testString") listConfigsOptionsModel.Version = core.StringPtr("active") listConfigsOptionsModel.Complete = core.BoolPtr(false) @@ -2008,8 +2016,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigOptions model getConfigOptionsModel := new(projectv1.GetConfigOptions) + getConfigOptionsModel.ProjectID = core.StringPtr("testString") getConfigOptionsModel.ID = core.StringPtr("testString") - getConfigOptionsModel.ConfigID = core.StringPtr("testString") getConfigOptionsModel.Version = core.StringPtr("active") getConfigOptionsModel.Complete = core.BoolPtr(false) getConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2050,7 +2058,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke GetConfig successfully with retries`, func() { @@ -2064,8 +2072,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigOptions model getConfigOptionsModel := new(projectv1.GetConfigOptions) + getConfigOptionsModel.ProjectID = core.StringPtr("testString") getConfigOptionsModel.ID = core.StringPtr("testString") - getConfigOptionsModel.ConfigID = core.StringPtr("testString") getConfigOptionsModel.Version = core.StringPtr("active") getConfigOptionsModel.Complete = core.BoolPtr(false) getConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2109,7 +2117,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke GetConfig successfully`, func() { @@ -2128,8 +2136,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigOptions model getConfigOptionsModel := new(projectv1.GetConfigOptions) + getConfigOptionsModel.ProjectID = core.StringPtr("testString") getConfigOptionsModel.ID = core.StringPtr("testString") - getConfigOptionsModel.ConfigID = core.StringPtr("testString") getConfigOptionsModel.Version = core.StringPtr("active") getConfigOptionsModel.Complete = core.BoolPtr(false) getConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2151,8 +2159,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigOptions model getConfigOptionsModel := new(projectv1.GetConfigOptions) + getConfigOptionsModel.ProjectID = core.StringPtr("testString") getConfigOptionsModel.ID = core.StringPtr("testString") - getConfigOptionsModel.ConfigID = core.StringPtr("testString") getConfigOptionsModel.Version = core.StringPtr("active") getConfigOptionsModel.Complete = core.BoolPtr(false) getConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2195,8 +2203,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigOptions model getConfigOptionsModel := new(projectv1.GetConfigOptions) + getConfigOptionsModel.ProjectID = core.StringPtr("testString") getConfigOptionsModel.ID = core.StringPtr("testString") - getConfigOptionsModel.ConfigID = core.StringPtr("testString") getConfigOptionsModel.Version = core.StringPtr("active") getConfigOptionsModel.Complete = core.BoolPtr(false) getConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2247,8 +2255,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UpdateConfigOptions model updateConfigOptionsModel := new(projectv1.UpdateConfigOptions) + updateConfigOptionsModel.ProjectID = core.StringPtr("testString") updateConfigOptionsModel.ID = core.StringPtr("testString") - updateConfigOptionsModel.ConfigID = core.StringPtr("testString") updateConfigOptionsModel.ProjectConfig = []projectv1.JSONPatchOperation{*jsonPatchOperationModel} updateConfigOptionsModel.Complete = core.BoolPtr(false) updateConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2304,7 +2312,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke UpdateConfig successfully with retries`, func() { @@ -2325,8 +2333,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UpdateConfigOptions model updateConfigOptionsModel := new(projectv1.UpdateConfigOptions) + updateConfigOptionsModel.ProjectID = core.StringPtr("testString") updateConfigOptionsModel.ID = core.StringPtr("testString") - updateConfigOptionsModel.ConfigID = core.StringPtr("testString") updateConfigOptionsModel.ProjectConfig = []projectv1.JSONPatchOperation{*jsonPatchOperationModel} updateConfigOptionsModel.Complete = core.BoolPtr(false) updateConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2385,7 +2393,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke UpdateConfig successfully`, func() { @@ -2411,8 +2419,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UpdateConfigOptions model updateConfigOptionsModel := new(projectv1.UpdateConfigOptions) + updateConfigOptionsModel.ProjectID = core.StringPtr("testString") updateConfigOptionsModel.ID = core.StringPtr("testString") - updateConfigOptionsModel.ConfigID = core.StringPtr("testString") updateConfigOptionsModel.ProjectConfig = []projectv1.JSONPatchOperation{*jsonPatchOperationModel} updateConfigOptionsModel.Complete = core.BoolPtr(false) updateConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2441,8 +2449,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UpdateConfigOptions model updateConfigOptionsModel := new(projectv1.UpdateConfigOptions) + updateConfigOptionsModel.ProjectID = core.StringPtr("testString") updateConfigOptionsModel.ID = core.StringPtr("testString") - updateConfigOptionsModel.ConfigID = core.StringPtr("testString") updateConfigOptionsModel.ProjectConfig = []projectv1.JSONPatchOperation{*jsonPatchOperationModel} updateConfigOptionsModel.Complete = core.BoolPtr(false) updateConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2492,8 +2500,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UpdateConfigOptions model updateConfigOptionsModel := new(projectv1.UpdateConfigOptions) + updateConfigOptionsModel.ProjectID = core.StringPtr("testString") updateConfigOptionsModel.ID = core.StringPtr("testString") - updateConfigOptionsModel.ConfigID = core.StringPtr("testString") updateConfigOptionsModel.ProjectConfig = []projectv1.JSONPatchOperation{*jsonPatchOperationModel} updateConfigOptionsModel.Complete = core.BoolPtr(false) updateConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2538,8 +2546,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the DeleteConfigOptions model deleteConfigOptionsModel := new(projectv1.DeleteConfigOptions) + deleteConfigOptionsModel.ProjectID = core.StringPtr("testString") deleteConfigOptionsModel.ID = core.StringPtr("testString") - deleteConfigOptionsModel.ConfigID = core.StringPtr("testString") deleteConfigOptionsModel.DraftOnly = core.BoolPtr(false) deleteConfigOptionsModel.Destroy = core.BoolPtr(false) deleteConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2594,8 +2602,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the DeleteConfigOptions model deleteConfigOptionsModel := new(projectv1.DeleteConfigOptions) + deleteConfigOptionsModel.ProjectID = core.StringPtr("testString") deleteConfigOptionsModel.ID = core.StringPtr("testString") - deleteConfigOptionsModel.ConfigID = core.StringPtr("testString") deleteConfigOptionsModel.DraftOnly = core.BoolPtr(false) deleteConfigOptionsModel.Destroy = core.BoolPtr(false) deleteConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2658,8 +2666,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the DeleteConfigOptions model deleteConfigOptionsModel := new(projectv1.DeleteConfigOptions) + deleteConfigOptionsModel.ProjectID = core.StringPtr("testString") deleteConfigOptionsModel.ID = core.StringPtr("testString") - deleteConfigOptionsModel.ConfigID = core.StringPtr("testString") deleteConfigOptionsModel.DraftOnly = core.BoolPtr(false) deleteConfigOptionsModel.Destroy = core.BoolPtr(false) deleteConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2681,8 +2689,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the DeleteConfigOptions model deleteConfigOptionsModel := new(projectv1.DeleteConfigOptions) + deleteConfigOptionsModel.ProjectID = core.StringPtr("testString") deleteConfigOptionsModel.ID = core.StringPtr("testString") - deleteConfigOptionsModel.ConfigID = core.StringPtr("testString") deleteConfigOptionsModel.DraftOnly = core.BoolPtr(false) deleteConfigOptionsModel.Destroy = core.BoolPtr(false) deleteConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2725,8 +2733,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the DeleteConfigOptions model deleteConfigOptionsModel := new(projectv1.DeleteConfigOptions) + deleteConfigOptionsModel.ProjectID = core.StringPtr("testString") deleteConfigOptionsModel.ID = core.StringPtr("testString") - deleteConfigOptionsModel.ConfigID = core.StringPtr("testString") deleteConfigOptionsModel.DraftOnly = core.BoolPtr(false) deleteConfigOptionsModel.Destroy = core.BoolPtr(false) deleteConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -2769,8 +2777,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigDiffOptions model getConfigDiffOptionsModel := new(projectv1.GetConfigDiffOptions) + getConfigDiffOptionsModel.ProjectID = core.StringPtr("testString") getConfigDiffOptionsModel.ID = core.StringPtr("testString") - getConfigDiffOptionsModel.ConfigID = core.StringPtr("testString") getConfigDiffOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := projectService.GetConfigDiff(getConfigDiffOptionsModel) @@ -2807,7 +2815,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"added": {"input": [{"name": "Name", "type": "array"}]}, "changed": {"input": [{"name": "Name", "type": "array"}]}, "removed": {"input": [{"name": "Name", "type": "array"}]}}`) + fmt.Fprintf(res, "%s", `{"added": {"input": [{"name": "Name", "type": "array", "value": "anyValue"}]}, "changed": {"input": [{"name": "Name", "type": "array", "value": "anyValue"}]}, "removed": {"input": [{"name": "Name", "type": "array", "value": "anyValue"}]}}`) })) }) It(`Invoke GetConfigDiff successfully with retries`, func() { @@ -2821,8 +2829,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigDiffOptions model getConfigDiffOptionsModel := new(projectv1.GetConfigDiffOptions) + getConfigDiffOptionsModel.ProjectID = core.StringPtr("testString") getConfigDiffOptionsModel.ID = core.StringPtr("testString") - getConfigDiffOptionsModel.ConfigID = core.StringPtr("testString") getConfigDiffOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -2862,7 +2870,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"added": {"input": [{"name": "Name", "type": "array"}]}, "changed": {"input": [{"name": "Name", "type": "array"}]}, "removed": {"input": [{"name": "Name", "type": "array"}]}}`) + fmt.Fprintf(res, "%s", `{"added": {"input": [{"name": "Name", "type": "array", "value": "anyValue"}]}, "changed": {"input": [{"name": "Name", "type": "array", "value": "anyValue"}]}, "removed": {"input": [{"name": "Name", "type": "array", "value": "anyValue"}]}}`) })) }) It(`Invoke GetConfigDiff successfully`, func() { @@ -2881,8 +2889,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigDiffOptions model getConfigDiffOptionsModel := new(projectv1.GetConfigDiffOptions) + getConfigDiffOptionsModel.ProjectID = core.StringPtr("testString") getConfigDiffOptionsModel.ID = core.StringPtr("testString") - getConfigDiffOptionsModel.ConfigID = core.StringPtr("testString") getConfigDiffOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -2902,8 +2910,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigDiffOptions model getConfigDiffOptionsModel := new(projectv1.GetConfigDiffOptions) + getConfigDiffOptionsModel.ProjectID = core.StringPtr("testString") getConfigDiffOptionsModel.ID = core.StringPtr("testString") - getConfigDiffOptionsModel.ConfigID = core.StringPtr("testString") getConfigDiffOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") @@ -2944,8 +2952,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetConfigDiffOptions model getConfigDiffOptionsModel := new(projectv1.GetConfigDiffOptions) + getConfigDiffOptionsModel.ProjectID = core.StringPtr("testString") getConfigDiffOptionsModel.ID = core.StringPtr("testString") - getConfigDiffOptionsModel.ConfigID = core.StringPtr("testString") getConfigDiffOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -2987,8 +2995,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ForceApproveOptions model forceApproveOptionsModel := new(projectv1.ForceApproveOptions) + forceApproveOptionsModel.ProjectID = core.StringPtr("testString") forceApproveOptionsModel.ID = core.StringPtr("testString") - forceApproveOptionsModel.ConfigID = core.StringPtr("testString") forceApproveOptionsModel.Comment = core.StringPtr("Approving the changes") forceApproveOptionsModel.Complete = core.BoolPtr(false) forceApproveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3044,7 +3052,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke ForceApprove successfully with retries`, func() { @@ -3058,8 +3066,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ForceApproveOptions model forceApproveOptionsModel := new(projectv1.ForceApproveOptions) + forceApproveOptionsModel.ProjectID = core.StringPtr("testString") forceApproveOptionsModel.ID = core.StringPtr("testString") - forceApproveOptionsModel.ConfigID = core.StringPtr("testString") forceApproveOptionsModel.Comment = core.StringPtr("Approving the changes") forceApproveOptionsModel.Complete = core.BoolPtr(false) forceApproveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3118,7 +3126,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke ForceApprove successfully`, func() { @@ -3137,8 +3145,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ForceApproveOptions model forceApproveOptionsModel := new(projectv1.ForceApproveOptions) + forceApproveOptionsModel.ProjectID = core.StringPtr("testString") forceApproveOptionsModel.ID = core.StringPtr("testString") - forceApproveOptionsModel.ConfigID = core.StringPtr("testString") forceApproveOptionsModel.Comment = core.StringPtr("Approving the changes") forceApproveOptionsModel.Complete = core.BoolPtr(false) forceApproveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3160,8 +3168,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ForceApproveOptions model forceApproveOptionsModel := new(projectv1.ForceApproveOptions) + forceApproveOptionsModel.ProjectID = core.StringPtr("testString") forceApproveOptionsModel.ID = core.StringPtr("testString") - forceApproveOptionsModel.ConfigID = core.StringPtr("testString") forceApproveOptionsModel.Comment = core.StringPtr("Approving the changes") forceApproveOptionsModel.Complete = core.BoolPtr(false) forceApproveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3204,8 +3212,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ForceApproveOptions model forceApproveOptionsModel := new(projectv1.ForceApproveOptions) + forceApproveOptionsModel.ProjectID = core.StringPtr("testString") forceApproveOptionsModel.ID = core.StringPtr("testString") - forceApproveOptionsModel.ConfigID = core.StringPtr("testString") forceApproveOptionsModel.Comment = core.StringPtr("Approving the changes") forceApproveOptionsModel.Complete = core.BoolPtr(false) forceApproveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3249,8 +3257,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ApproveOptions model approveOptionsModel := new(projectv1.ApproveOptions) + approveOptionsModel.ProjectID = core.StringPtr("testString") approveOptionsModel.ID = core.StringPtr("testString") - approveOptionsModel.ConfigID = core.StringPtr("testString") approveOptionsModel.Comment = core.StringPtr("Approving the changes") approveOptionsModel.Complete = core.BoolPtr(false) approveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3306,7 +3314,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke Approve successfully with retries`, func() { @@ -3320,8 +3328,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ApproveOptions model approveOptionsModel := new(projectv1.ApproveOptions) + approveOptionsModel.ProjectID = core.StringPtr("testString") approveOptionsModel.ID = core.StringPtr("testString") - approveOptionsModel.ConfigID = core.StringPtr("testString") approveOptionsModel.Comment = core.StringPtr("Approving the changes") approveOptionsModel.Complete = core.BoolPtr(false) approveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3380,7 +3388,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke Approve successfully`, func() { @@ -3399,8 +3407,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ApproveOptions model approveOptionsModel := new(projectv1.ApproveOptions) + approveOptionsModel.ProjectID = core.StringPtr("testString") approveOptionsModel.ID = core.StringPtr("testString") - approveOptionsModel.ConfigID = core.StringPtr("testString") approveOptionsModel.Comment = core.StringPtr("Approving the changes") approveOptionsModel.Complete = core.BoolPtr(false) approveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3422,8 +3430,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ApproveOptions model approveOptionsModel := new(projectv1.ApproveOptions) + approveOptionsModel.ProjectID = core.StringPtr("testString") approveOptionsModel.ID = core.StringPtr("testString") - approveOptionsModel.ConfigID = core.StringPtr("testString") approveOptionsModel.Comment = core.StringPtr("Approving the changes") approveOptionsModel.Complete = core.BoolPtr(false) approveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3466,8 +3474,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the ApproveOptions model approveOptionsModel := new(projectv1.ApproveOptions) + approveOptionsModel.ProjectID = core.StringPtr("testString") approveOptionsModel.ID = core.StringPtr("testString") - approveOptionsModel.ConfigID = core.StringPtr("testString") approveOptionsModel.Comment = core.StringPtr("Approving the changes") approveOptionsModel.Complete = core.BoolPtr(false) approveOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3497,8 +3505,8 @@ var _ = Describe(`ProjectV1`, func() { Expect(req.Method).To(Equal("POST")) Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.URL.Query()["version"]).To(Equal([]string{"active"})) // TODO: Add check for complete query parameter + Expect(req.URL.Query()["version"]).To(Equal([]string{"active"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(202) fmt.Fprint(res, `} this is not valid json {`) @@ -3514,11 +3522,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CheckConfigOptions model checkConfigOptionsModel := new(projectv1.CheckConfigOptions) + checkConfigOptionsModel.ProjectID = core.StringPtr("testString") checkConfigOptionsModel.ID = core.StringPtr("testString") - checkConfigOptionsModel.ConfigID = core.StringPtr("testString") checkConfigOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Complete = core.BoolPtr(false) + checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := projectService.CheckConfig(checkConfigOptionsModel) @@ -3551,15 +3559,15 @@ var _ = Describe(`ProjectV1`, func() { Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.URL.Query()["version"]).To(Equal([]string{"active"})) // TODO: Add check for complete query parameter + Expect(req.URL.Query()["version"]).To(Equal([]string{"active"})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(202) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke CheckConfig successfully with retries`, func() { @@ -3573,11 +3581,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CheckConfigOptions model checkConfigOptionsModel := new(projectv1.CheckConfigOptions) + checkConfigOptionsModel.ProjectID = core.StringPtr("testString") checkConfigOptionsModel.ID = core.StringPtr("testString") - checkConfigOptionsModel.ConfigID = core.StringPtr("testString") checkConfigOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Complete = core.BoolPtr(false) + checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -3616,12 +3624,12 @@ var _ = Describe(`ProjectV1`, func() { Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.URL.Query()["version"]).To(Equal([]string{"active"})) // TODO: Add check for complete query parameter + Expect(req.URL.Query()["version"]).To(Equal([]string{"active"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(202) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke CheckConfig successfully`, func() { @@ -3640,11 +3648,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CheckConfigOptions model checkConfigOptionsModel := new(projectv1.CheckConfigOptions) + checkConfigOptionsModel.ProjectID = core.StringPtr("testString") checkConfigOptionsModel.ID = core.StringPtr("testString") - checkConfigOptionsModel.ConfigID = core.StringPtr("testString") checkConfigOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Complete = core.BoolPtr(false) + checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -3664,11 +3672,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CheckConfigOptions model checkConfigOptionsModel := new(projectv1.CheckConfigOptions) + checkConfigOptionsModel.ProjectID = core.StringPtr("testString") checkConfigOptionsModel.ID = core.StringPtr("testString") - checkConfigOptionsModel.ConfigID = core.StringPtr("testString") checkConfigOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Complete = core.BoolPtr(false) + checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") @@ -3709,11 +3717,11 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the CheckConfigOptions model checkConfigOptionsModel := new(projectv1.CheckConfigOptions) + checkConfigOptionsModel.ProjectID = core.StringPtr("testString") checkConfigOptionsModel.ID = core.StringPtr("testString") - checkConfigOptionsModel.ConfigID = core.StringPtr("testString") checkConfigOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Complete = core.BoolPtr(false) + checkConfigOptionsModel.Version = core.StringPtr("active") checkConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -3755,8 +3763,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the InstallConfigOptions model installConfigOptionsModel := new(projectv1.InstallConfigOptions) + installConfigOptionsModel.ProjectID = core.StringPtr("testString") installConfigOptionsModel.ID = core.StringPtr("testString") - installConfigOptionsModel.ConfigID = core.StringPtr("testString") installConfigOptionsModel.Complete = core.BoolPtr(false) installConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response @@ -3795,7 +3803,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(202) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke InstallConfig successfully with retries`, func() { @@ -3809,8 +3817,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the InstallConfigOptions model installConfigOptionsModel := new(projectv1.InstallConfigOptions) + installConfigOptionsModel.ProjectID = core.StringPtr("testString") installConfigOptionsModel.ID = core.StringPtr("testString") - installConfigOptionsModel.ConfigID = core.StringPtr("testString") installConfigOptionsModel.Complete = core.BoolPtr(false) installConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3852,7 +3860,7 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(202) - fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "required": true}], "output": [{"name": "Name", "description": "Description", "value": ["Value"]}], "setting": [{"name": "Name", "value": "Value"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "name": "Name", "labels": ["Labels"], "description": "Description", "locator_id": "LocatorID", "type": "terraform_template", "input": [{"name": "Name", "type": "array", "value": "anyValue", "required": true}], "output": [{"name": "Name", "description": "Description", "value": "anyValue"}], "setting": [{"name": "Name", "value": "Value"}]}`) })) }) It(`Invoke InstallConfig successfully`, func() { @@ -3871,8 +3879,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the InstallConfigOptions model installConfigOptionsModel := new(projectv1.InstallConfigOptions) + installConfigOptionsModel.ProjectID = core.StringPtr("testString") installConfigOptionsModel.ID = core.StringPtr("testString") - installConfigOptionsModel.ConfigID = core.StringPtr("testString") installConfigOptionsModel.Complete = core.BoolPtr(false) installConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3893,8 +3901,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the InstallConfigOptions model installConfigOptionsModel := new(projectv1.InstallConfigOptions) + installConfigOptionsModel.ProjectID = core.StringPtr("testString") installConfigOptionsModel.ID = core.StringPtr("testString") - installConfigOptionsModel.ConfigID = core.StringPtr("testString") installConfigOptionsModel.Complete = core.BoolPtr(false) installConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) @@ -3936,8 +3944,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the InstallConfigOptions model installConfigOptionsModel := new(projectv1.InstallConfigOptions) + installConfigOptionsModel.ProjectID = core.StringPtr("testString") installConfigOptionsModel.ID = core.StringPtr("testString") - installConfigOptionsModel.ConfigID = core.StringPtr("testString") installConfigOptionsModel.Complete = core.BoolPtr(false) installConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -3983,8 +3991,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UninstallConfigOptions model uninstallConfigOptionsModel := new(projectv1.UninstallConfigOptions) + uninstallConfigOptionsModel.ProjectID = core.StringPtr("testString") uninstallConfigOptionsModel.ID = core.StringPtr("testString") - uninstallConfigOptionsModel.ConfigID = core.StringPtr("testString") uninstallConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -4002,8 +4010,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the UninstallConfigOptions model uninstallConfigOptionsModel := new(projectv1.UninstallConfigOptions) + uninstallConfigOptionsModel.ProjectID = core.StringPtr("testString") uninstallConfigOptionsModel.ID = core.StringPtr("testString") - uninstallConfigOptionsModel.ConfigID = core.StringPtr("testString") uninstallConfigOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") @@ -4050,8 +4058,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetSchematicsJobOptions model getSchematicsJobOptionsModel := new(projectv1.GetSchematicsJobOptions) + getSchematicsJobOptionsModel.ProjectID = core.StringPtr("testString") getSchematicsJobOptionsModel.ID = core.StringPtr("testString") - getSchematicsJobOptionsModel.ConfigID = core.StringPtr("testString") getSchematicsJobOptionsModel.Action = core.StringPtr("plan") getSchematicsJobOptionsModel.Since = core.Int64Ptr(int64(38)) getSchematicsJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4105,8 +4113,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetSchematicsJobOptions model getSchematicsJobOptionsModel := new(projectv1.GetSchematicsJobOptions) + getSchematicsJobOptionsModel.ProjectID = core.StringPtr("testString") getSchematicsJobOptionsModel.ID = core.StringPtr("testString") - getSchematicsJobOptionsModel.ConfigID = core.StringPtr("testString") getSchematicsJobOptionsModel.Action = core.StringPtr("plan") getSchematicsJobOptionsModel.Since = core.Int64Ptr(int64(38)) getSchematicsJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4168,8 +4176,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetSchematicsJobOptions model getSchematicsJobOptionsModel := new(projectv1.GetSchematicsJobOptions) + getSchematicsJobOptionsModel.ProjectID = core.StringPtr("testString") getSchematicsJobOptionsModel.ID = core.StringPtr("testString") - getSchematicsJobOptionsModel.ConfigID = core.StringPtr("testString") getSchematicsJobOptionsModel.Action = core.StringPtr("plan") getSchematicsJobOptionsModel.Since = core.Int64Ptr(int64(38)) getSchematicsJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4191,8 +4199,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetSchematicsJobOptions model getSchematicsJobOptionsModel := new(projectv1.GetSchematicsJobOptions) + getSchematicsJobOptionsModel.ProjectID = core.StringPtr("testString") getSchematicsJobOptionsModel.ID = core.StringPtr("testString") - getSchematicsJobOptionsModel.ConfigID = core.StringPtr("testString") getSchematicsJobOptionsModel.Action = core.StringPtr("plan") getSchematicsJobOptionsModel.Since = core.Int64Ptr(int64(38)) getSchematicsJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4235,8 +4243,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetSchematicsJobOptions model getSchematicsJobOptionsModel := new(projectv1.GetSchematicsJobOptions) + getSchematicsJobOptionsModel.ProjectID = core.StringPtr("testString") getSchematicsJobOptionsModel.ID = core.StringPtr("testString") - getSchematicsJobOptionsModel.ConfigID = core.StringPtr("testString") getSchematicsJobOptionsModel.Action = core.StringPtr("plan") getSchematicsJobOptionsModel.Since = core.Int64Ptr(int64(38)) getSchematicsJobOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4280,8 +4288,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetCostEstimateOptions model getCostEstimateOptionsModel := new(projectv1.GetCostEstimateOptions) + getCostEstimateOptionsModel.ProjectID = core.StringPtr("testString") getCostEstimateOptionsModel.ID = core.StringPtr("testString") - getCostEstimateOptionsModel.ConfigID = core.StringPtr("testString") getCostEstimateOptionsModel.Version = core.StringPtr("active") getCostEstimateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response @@ -4334,8 +4342,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetCostEstimateOptions model getCostEstimateOptionsModel := new(projectv1.GetCostEstimateOptions) + getCostEstimateOptionsModel.ProjectID = core.StringPtr("testString") getCostEstimateOptionsModel.ID = core.StringPtr("testString") - getCostEstimateOptionsModel.ConfigID = core.StringPtr("testString") getCostEstimateOptionsModel.Version = core.StringPtr("active") getCostEstimateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4396,8 +4404,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetCostEstimateOptions model getCostEstimateOptionsModel := new(projectv1.GetCostEstimateOptions) + getCostEstimateOptionsModel.ProjectID = core.StringPtr("testString") getCostEstimateOptionsModel.ID = core.StringPtr("testString") - getCostEstimateOptionsModel.ConfigID = core.StringPtr("testString") getCostEstimateOptionsModel.Version = core.StringPtr("active") getCostEstimateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -4418,8 +4426,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetCostEstimateOptions model getCostEstimateOptionsModel := new(projectv1.GetCostEstimateOptions) + getCostEstimateOptionsModel.ProjectID = core.StringPtr("testString") getCostEstimateOptionsModel.ID = core.StringPtr("testString") - getCostEstimateOptionsModel.ConfigID = core.StringPtr("testString") getCostEstimateOptionsModel.Version = core.StringPtr("active") getCostEstimateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) @@ -4461,8 +4469,8 @@ var _ = Describe(`ProjectV1`, func() { // Construct an instance of the GetCostEstimateOptions model getCostEstimateOptionsModel := new(projectv1.GetCostEstimateOptions) + getCostEstimateOptionsModel.ProjectID = core.StringPtr("testString") getCostEstimateOptionsModel.ID = core.StringPtr("testString") - getCostEstimateOptionsModel.ConfigID = core.StringPtr("testString") getCostEstimateOptionsModel.Version = core.StringPtr("active") getCostEstimateOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -5197,15 +5205,64 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptions *ReceivePulsarCatalogEventsOptions)`, func() { - receivePulsarCatalogEventsPath := "/v1/pulsar/catalog_events" - Context(`Using mock server endpoint`, func() { + Describe(`PostEventNotificationsIntegration(postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions) - Operation response error`, func() { + postEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" + Context(`Using mock server endpoint with invalid JSON response`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() + + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(postEventNotificationsIntegrationPath)) + Expect(req.Method).To(Equal("POST")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke PostEventNotificationsIntegration with error: Operation response processing error`, func() { + projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(projectService).ToNot(BeNil()) + + // Construct an instance of the PostEventNotificationsIntegrationOptions model + postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) + postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") + postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") + postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") + postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) + postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Expect response parsing to fail since we are receiving a text/plain response + result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + projectService.EnableRetries(0, 0) + result, response, operationErr = projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`PostEventNotificationsIntegration(postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions)`, func() { + postEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" + Context(`Using mock server endpoint with timeout`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(receivePulsarCatalogEventsPath)) + Expect(req.URL.EscapedPath()).To(Equal(postEventNotificationsIntegrationPath)) Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -5224,94 +5281,65 @@ var _ = Describe(`ProjectV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) - res.WriteHeader(202) + // Sleep a short time to support a timeout test + time.Sleep(100 * time.Millisecond) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "created_at": "2019-01-01T12:00:00.000Z"}`) })) }) - It(`Invoke ReceivePulsarCatalogEvents successfully`, func() { + It(`Invoke PostEventNotificationsIntegration successfully with retries`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) + projectService.EnableRetries(0, 0) - // Invoke operation with nil options model (negative test) - response, operationErr := projectService.ReceivePulsarCatalogEvents(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) + // Construct an instance of the PostEventNotificationsIntegrationOptions model + postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) + postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") + postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") + postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") + postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) + postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the PulsarEventPrototypeCollection model - pulsarEventPrototypeCollectionModel := new(projectv1.PulsarEventPrototypeCollection) - pulsarEventPrototypeCollectionModel.EventType = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Timestamp = CreateMockDateTime("2019-01-01T12:00:00.000Z") - pulsarEventPrototypeCollectionModel.Publisher = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.AccountID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Version = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.EventProperties = map[string]interface{}{"anyKey": "anyValue"} - pulsarEventPrototypeCollectionModel.EventID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - - // Construct an instance of the ReceivePulsarCatalogEventsOptions model - receivePulsarCatalogEventsOptionsModel := new(projectv1.ReceivePulsarCatalogEventsOptions) - receivePulsarCatalogEventsOptionsModel.PulsarCatalogEvents = []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel} - receivePulsarCatalogEventsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with a Context to test a timeout error + ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc() + _, _, operationErr := projectService.PostEventNotificationsIntegrationWithContext(ctx, postEventNotificationsIntegrationOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - // Invoke operation with valid options model (positive test) - response, operationErr = projectService.ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptionsModel) + // Disable retries and test again + projectService.DisableRetries() + result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) - }) - It(`Invoke ReceivePulsarCatalogEvents with error: Operation validation and request error`, func() { - projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(projectService).ToNot(BeNil()) - - // Construct an instance of the PulsarEventPrototypeCollection model - pulsarEventPrototypeCollectionModel := new(projectv1.PulsarEventPrototypeCollection) - pulsarEventPrototypeCollectionModel.EventType = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Timestamp = CreateMockDateTime("2019-01-01T12:00:00.000Z") - pulsarEventPrototypeCollectionModel.Publisher = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.AccountID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Version = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.EventProperties = map[string]interface{}{"anyKey": "anyValue"} - pulsarEventPrototypeCollectionModel.EventID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) + Expect(result).ToNot(BeNil()) - // Construct an instance of the ReceivePulsarCatalogEventsOptions model - receivePulsarCatalogEventsOptionsModel := new(projectv1.ReceivePulsarCatalogEventsOptions) - receivePulsarCatalogEventsOptionsModel.PulsarCatalogEvents = []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel} - receivePulsarCatalogEventsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := projectService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := projectService.ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the ReceivePulsarCatalogEventsOptions model with no property values - receivePulsarCatalogEventsOptionsModelNew := new(projectv1.ReceivePulsarCatalogEventsOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = projectService.ReceivePulsarCatalogEvents(receivePulsarCatalogEventsOptionsModelNew) + // Re-test the timeout error with retries disabled + ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc2() + _, _, operationErr = projectService.PostEventNotificationsIntegrationWithContext(ctx, postEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) AfterEach(func() { testServer.Close() }) }) - }) - Describe(`ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptions *ReceivePulsarEventNotificationEventsOptions)`, func() { - receivePulsarEventNotificationEventsPath := "/v1/pulsar/event_notification_events" Context(`Using mock server endpoint`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(receivePulsarEventNotificationEventsPath)) + Expect(req.URL.EscapedPath()).To(Equal(postEventNotificationsIntegrationPath)) Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -5330,10 +5358,13 @@ var _ = Describe(`ProjectV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) - res.WriteHeader(202) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "created_at": "2019-01-01T12:00:00.000Z"}`) })) }) - It(`Invoke ReceivePulsarEventNotificationEvents successfully`, func() { + It(`Invoke PostEventNotificationsIntegration successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5342,32 +5373,28 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - response, operationErr := projectService.ReceivePulsarEventNotificationEvents(nil) + result, response, operationErr := projectService.PostEventNotificationsIntegration(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the PulsarEventPrototypeCollection model - pulsarEventPrototypeCollectionModel := new(projectv1.PulsarEventPrototypeCollection) - pulsarEventPrototypeCollectionModel.EventType = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Timestamp = CreateMockDateTime("2019-01-01T12:00:00.000Z") - pulsarEventPrototypeCollectionModel.Publisher = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.AccountID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Version = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.EventProperties = map[string]interface{}{"anyKey": "anyValue"} - pulsarEventPrototypeCollectionModel.EventID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - - // Construct an instance of the ReceivePulsarEventNotificationEventsOptions model - receivePulsarEventNotificationEventsOptionsModel := new(projectv1.ReceivePulsarEventNotificationEventsOptions) - receivePulsarEventNotificationEventsOptionsModel.PulsarEventNotificationEvents = []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel} - receivePulsarEventNotificationEventsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostEventNotificationsIntegrationOptions model + postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) + postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") + postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") + postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") + postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) + postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = projectService.ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptionsModel) + result, response, operationErr = projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + }) - It(`Invoke ReceivePulsarEventNotificationEvents with error: Operation validation and request error`, func() { + It(`Invoke PostEventNotificationsIntegration with error: Operation validation and request error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5375,57 +5402,89 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PulsarEventPrototypeCollection model - pulsarEventPrototypeCollectionModel := new(projectv1.PulsarEventPrototypeCollection) - pulsarEventPrototypeCollectionModel.EventType = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Timestamp = CreateMockDateTime("2019-01-01T12:00:00.000Z") - pulsarEventPrototypeCollectionModel.Publisher = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.AccountID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Version = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.EventProperties = map[string]interface{}{"anyKey": "anyValue"} - pulsarEventPrototypeCollectionModel.EventID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - - // Construct an instance of the ReceivePulsarEventNotificationEventsOptions model - receivePulsarEventNotificationEventsOptionsModel := new(projectv1.ReceivePulsarEventNotificationEventsOptions) - receivePulsarEventNotificationEventsOptionsModel.PulsarEventNotificationEvents = []projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel} - receivePulsarEventNotificationEventsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostEventNotificationsIntegrationOptions model + postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) + postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") + postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") + postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") + postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) + postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := projectService.ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptionsModel) + result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the ReceivePulsarEventNotificationEventsOptions model with no property values - receivePulsarEventNotificationEventsOptionsModelNew := new(projectv1.ReceivePulsarEventNotificationEventsOptions) + Expect(result).To(BeNil()) + // Construct a second instance of the PostEventNotificationsIntegrationOptions model with no property values + postEventNotificationsIntegrationOptionsModelNew := new(projectv1.PostEventNotificationsIntegrationOptions) // Invoke operation with invalid model (negative test) - response, operationErr = projectService.ReceivePulsarEventNotificationEvents(receivePulsarEventNotificationEventsOptionsModelNew) + result, response, operationErr = projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Using mock server endpoint with missing response body`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() + + // Set success status code with no respoonse body + res.WriteHeader(200) + })) + }) + It(`Invoke PostEventNotificationsIntegration successfully`, func() { + projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(projectService).ToNot(BeNil()) + + // Construct an instance of the PostEventNotificationsIntegrationOptions model + postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) + postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") + postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") + postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") + postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) + postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) AfterEach(func() { testServer.Close() }) }) }) - Describe(`GetHealth(getHealthOptions *GetHealthOptions) - Operation response error`, func() { - getHealthPath := "/v1/health" + Describe(`GetEventNotificationsIntegration(getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions) - Operation response error`, func() { + getEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" Context(`Using mock server endpoint with invalid JSON response`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getHealthPath)) + Expect(req.URL.EscapedPath()).To(Equal(getEventNotificationsIntegrationPath)) Expect(req.Method).To(Equal("GET")) - // TODO: Add check for info query parameter res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetHealth with error: Operation response processing error`, func() { + It(`Invoke GetEventNotificationsIntegration with error: Operation response processing error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5433,19 +5492,19 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetHealthOptions model - getHealthOptionsModel := new(projectv1.GetHealthOptions) - getHealthOptionsModel.Info = core.BoolPtr(false) - getHealthOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetEventNotificationsIntegrationOptions model + getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) + getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := projectService.GetHealth(getHealthOptionsModel) + result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again projectService.EnableRetries(0, 0) - result, response, operationErr = projectService.GetHealth(getHealthOptionsModel) + result, response, operationErr = projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -5455,28 +5514,27 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`GetHealth(getHealthOptions *GetHealthOptions)`, func() { - getHealthPath := "/v1/health" + Describe(`GetEventNotificationsIntegration(getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions)`, func() { + getEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" Context(`Using mock server endpoint with timeout`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getHealthPath)) + Expect(req.URL.EscapedPath()).To(Equal(getEventNotificationsIntegrationPath)) Expect(req.Method).To(Equal("GET")) - // TODO: Add check for info query parameter // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"name": "Name", "version": "Version", "dependencies": {"anyKey": "anyValue"}}`) + fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "updated_at": "2019-01-01T12:00:00.000Z", "topic_count": 10, "topic_names": ["TopicNames"]}`) })) }) - It(`Invoke GetHealth successfully with retries`, func() { + It(`Invoke GetEventNotificationsIntegration successfully with retries`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5485,21 +5543,21 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) projectService.EnableRetries(0, 0) - // Construct an instance of the GetHealthOptions model - getHealthOptionsModel := new(projectv1.GetHealthOptions) - getHealthOptionsModel.Info = core.BoolPtr(false) - getHealthOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetEventNotificationsIntegrationOptions model + getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) + getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() - _, _, operationErr := projectService.GetHealthWithContext(ctx, getHealthOptionsModel) + _, _, operationErr := projectService.GetEventNotificationsIntegrationWithContext(ctx, getEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again projectService.DisableRetries() - result, response, operationErr := projectService.GetHealth(getHealthOptionsModel) + result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -5507,7 +5565,7 @@ var _ = Describe(`ProjectV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = projectService.GetHealthWithContext(ctx, getHealthOptionsModel) + _, _, operationErr = projectService.GetEventNotificationsIntegrationWithContext(ctx, getEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -5521,17 +5579,16 @@ var _ = Describe(`ProjectV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getHealthPath)) + Expect(req.URL.EscapedPath()).To(Equal(getEventNotificationsIntegrationPath)) Expect(req.Method).To(Equal("GET")) - // TODO: Add check for info query parameter // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"name": "Name", "version": "Version", "dependencies": {"anyKey": "anyValue"}}`) + fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "updated_at": "2019-01-01T12:00:00.000Z", "topic_count": 10, "topic_names": ["TopicNames"]}`) })) }) - It(`Invoke GetHealth successfully`, func() { + It(`Invoke GetEventNotificationsIntegration successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5540,24 +5597,24 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := projectService.GetHealth(nil) + result, response, operationErr := projectService.GetEventNotificationsIntegration(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetHealthOptions model - getHealthOptionsModel := new(projectv1.GetHealthOptions) - getHealthOptionsModel.Info = core.BoolPtr(false) - getHealthOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetEventNotificationsIntegrationOptions model + getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) + getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = projectService.GetHealth(getHealthOptionsModel) + result, response, operationErr = projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetHealth with error: Operation request error`, func() { + It(`Invoke GetEventNotificationsIntegration with error: Operation validation and request error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5565,18 +5622,25 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetHealthOptions model - getHealthOptionsModel := new(projectv1.GetHealthOptions) - getHealthOptionsModel.Info = core.BoolPtr(false) - getHealthOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetEventNotificationsIntegrationOptions model + getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) + getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := projectService.GetHealth(getHealthOptionsModel) + result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) Expect(result).To(BeNil()) + // Construct a second instance of the GetEventNotificationsIntegrationOptions model with no property values + getEventNotificationsIntegrationOptionsModelNew := new(projectv1.GetEventNotificationsIntegrationOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) }) AfterEach(func() { testServer.Close() @@ -5591,7 +5655,7 @@ var _ = Describe(`ProjectV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetHealth successfully`, func() { + It(`Invoke GetEventNotificationsIntegration successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5599,13 +5663,13 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetHealthOptions model - getHealthOptionsModel := new(projectv1.GetHealthOptions) - getHealthOptionsModel.Info = core.BoolPtr(false) - getHealthOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetEventNotificationsIntegrationOptions model + getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) + getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := projectService.GetHealth(getHealthOptionsModel) + result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -5617,132 +5681,21 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`GetCatalog(getCatalogOptions *GetCatalogOptions) - Operation response error`, func() { - getCatalogPath := "/v2/catalog" - Context(`Using mock server endpoint with invalid JSON response`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() - - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getCatalogPath)) - Expect(req.Method).To(Equal("GET")) - Expect(req.Header["X-Broker-Api-Version"]).ToNot(BeNil()) - Expect(req.Header["X-Broker-Api-Version"][0]).To(Equal(fmt.Sprintf("%v", "1.0"))) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke GetCatalog with error: Operation response processing error`, func() { - projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(projectService).ToNot(BeNil()) - - // Construct an instance of the GetCatalogOptions model - getCatalogOptionsModel := new(projectv1.GetCatalogOptions) - getCatalogOptionsModel.XBrokerApiVersion = core.StringPtr("1.0") - getCatalogOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := projectService.GetCatalog(getCatalogOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - - // Enable retries and test again - projectService.EnableRetries(0, 0) - result, response, operationErr = projectService.GetCatalog(getCatalogOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetCatalog(getCatalogOptions *GetCatalogOptions)`, func() { - getCatalogPath := "/v2/catalog" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() - - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getCatalogPath)) - Expect(req.Method).To(Equal("GET")) - - Expect(req.Header["X-Broker-Api-Version"]).ToNot(BeNil()) - Expect(req.Header["X-Broker-Api-Version"][0]).To(Equal(fmt.Sprintf("%v", "1.0"))) - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) - - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"services": [{"bindable": true, "description": "Description", "id": "ID", "metadata": {"display_name": "DisplayName", "documentation_url": "DocumentationURL", "image_url": "ImageURL", "instructions_url": "InstructionsURL", "long_description": "LongDescription", "provider_display_name": "ProviderDisplayName", "support_url": "SupportURL", "terms_url": "TermsURL"}, "name": "Name", "plan_updateable": true, "tags": ["Tags"], "plans": [{"description": "Description", "free": true, "id": "ID", "metadata": {"bullets": ["Bullets"], "display_name": "DisplayName"}, "name": "Name"}]}]}`) - })) - }) - It(`Invoke GetCatalog successfully with retries`, func() { - projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(projectService).ToNot(BeNil()) - projectService.EnableRetries(0, 0) - - // Construct an instance of the GetCatalogOptions model - getCatalogOptionsModel := new(projectv1.GetCatalogOptions) - getCatalogOptionsModel.XBrokerApiVersion = core.StringPtr("1.0") - getCatalogOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := projectService.GetCatalogWithContext(ctx, getCatalogOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - - // Disable retries and test again - projectService.DisableRetries() - result, response, operationErr := projectService.GetCatalog(getCatalogOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) - - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = projectService.GetCatalogWithContext(ctx, getCatalogOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) + Describe(`DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptions *DeleteEventNotificationsIntegrationOptions)`, func() { + deleteEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" Context(`Using mock server endpoint`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getCatalogPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(deleteEventNotificationsIntegrationPath)) + Expect(req.Method).To(Equal("DELETE")) - Expect(req.Header["X-Broker-Api-Version"]).ToNot(BeNil()) - Expect(req.Header["X-Broker-Api-Version"][0]).To(Equal(fmt.Sprintf("%v", "1.0"))) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"services": [{"bindable": true, "description": "Description", "id": "ID", "metadata": {"display_name": "DisplayName", "documentation_url": "DocumentationURL", "image_url": "ImageURL", "instructions_url": "InstructionsURL", "long_description": "LongDescription", "provider_display_name": "ProviderDisplayName", "support_url": "SupportURL", "terms_url": "TermsURL"}, "name": "Name", "plan_updateable": true, "tags": ["Tags"], "plans": [{"description": "Description", "free": true, "id": "ID", "metadata": {"bullets": ["Bullets"], "display_name": "DisplayName"}, "name": "Name"}]}]}`) + res.WriteHeader(204) })) }) - It(`Invoke GetCatalog successfully`, func() { + It(`Invoke DeleteEventNotificationsIntegration successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5751,24 +5704,21 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := projectService.GetCatalog(nil) + response, operationErr := projectService.DeleteEventNotificationsIntegration(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - Expect(result).To(BeNil()) - // Construct an instance of the GetCatalogOptions model - getCatalogOptionsModel := new(projectv1.GetCatalogOptions) - getCatalogOptionsModel.XBrokerApiVersion = core.StringPtr("1.0") - getCatalogOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeleteEventNotificationsIntegrationOptions model + deleteEventNotificationsIntegrationOptionsModel := new(projectv1.DeleteEventNotificationsIntegrationOptions) + deleteEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + deleteEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = projectService.GetCatalog(getCatalogOptionsModel) + response, operationErr = projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) - }) - It(`Invoke GetCatalog with error: Operation request error`, func() { + It(`Invoke DeleteEventNotificationsIntegration with error: Operation validation and request error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5776,74 +5726,45 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetCatalogOptions model - getCatalogOptionsModel := new(projectv1.GetCatalogOptions) - getCatalogOptionsModel.XBrokerApiVersion = core.StringPtr("1.0") - getCatalogOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeleteEventNotificationsIntegrationOptions model + deleteEventNotificationsIntegrationOptionsModel := new(projectv1.DeleteEventNotificationsIntegrationOptions) + deleteEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") + deleteEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := projectService.GetCatalog(getCatalogOptionsModel) + response, operationErr := projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint with missing response body`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() - - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke GetCatalog successfully`, func() { - projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(projectService).ToNot(BeNil()) - - // Construct an instance of the GetCatalogOptions model - getCatalogOptionsModel := new(projectv1.GetCatalogOptions) - getCatalogOptionsModel.XBrokerApiVersion = core.StringPtr("1.0") - getCatalogOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation - result, response, operationErr := projectService.GetCatalog(getCatalogOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - - // Verify a nil result - Expect(result).To(BeNil()) + // Construct a second instance of the DeleteEventNotificationsIntegrationOptions model with no property values + deleteEventNotificationsIntegrationOptionsModelNew := new(projectv1.DeleteEventNotificationsIntegrationOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) }) AfterEach(func() { testServer.Close() }) }) }) - Describe(`PostEventNotificationsIntegration(postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions) - Operation response error`, func() { - postEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" + Describe(`PostTestEventNotification(postTestEventNotificationOptions *PostTestEventNotificationOptions) - Operation response error`, func() { + postTestEventNotificationPath := "/v1/projects/testString/event_notifications/test" Context(`Using mock server endpoint with invalid JSON response`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(postEventNotificationsIntegrationPath)) + Expect(req.URL.EscapedPath()).To(Equal(postTestEventNotificationPath)) Expect(req.Method).To(Equal("POST")) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke PostEventNotificationsIntegration with error: Operation response processing error`, func() { + It(`Invoke PostTestEventNotification with error: Operation response processing error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5851,23 +5772,21 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PostEventNotificationsIntegrationOptions model - postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) - postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") - postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") - postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") - postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) - postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostTestEventNotificationOptions model + postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) + postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") + postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") + postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") + postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again projectService.EnableRetries(0, 0) - result, response, operationErr = projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + result, response, operationErr = projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -5877,15 +5796,15 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`PostEventNotificationsIntegration(postEventNotificationsIntegrationOptions *PostEventNotificationsIntegrationOptions)`, func() { - postEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" + Describe(`PostTestEventNotification(postTestEventNotificationOptions *PostTestEventNotificationOptions)`, func() { + postTestEventNotificationPath := "/v1/projects/testString/event_notifications/test" Context(`Using mock server endpoint with timeout`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(postEventNotificationsIntegrationPath)) + Expect(req.URL.EscapedPath()).To(Equal(postTestEventNotificationPath)) Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -5910,10 +5829,10 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "created_at": "2019-01-01T12:00:00.000Z"}`) + fmt.Fprintf(res, "%s", `{"datacontenttype": "Datacontenttype", "ibmendefaultlong": "Ibmendefaultlong", "ibmendefaultshort": "Ibmendefaultshort", "ibmensourceid": "Ibmensourceid", "id": "ID", "source": "Source", "specversion": "Specversion", "type": "Type"}`) })) }) - It(`Invoke PostEventNotificationsIntegration successfully with retries`, func() { + It(`Invoke PostTestEventNotification successfully with retries`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5922,25 +5841,23 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) projectService.EnableRetries(0, 0) - // Construct an instance of the PostEventNotificationsIntegrationOptions model - postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) - postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") - postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") - postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") - postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) - postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostTestEventNotificationOptions model + postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) + postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") + postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") + postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") + postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() - _, _, operationErr := projectService.PostEventNotificationsIntegrationWithContext(ctx, postEventNotificationsIntegrationOptionsModel) + _, _, operationErr := projectService.PostTestEventNotificationWithContext(ctx, postTestEventNotificationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again projectService.DisableRetries() - result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -5948,7 +5865,7 @@ var _ = Describe(`ProjectV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = projectService.PostEventNotificationsIntegrationWithContext(ctx, postEventNotificationsIntegrationOptionsModel) + _, _, operationErr = projectService.PostTestEventNotificationWithContext(ctx, postTestEventNotificationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -5962,7 +5879,7 @@ var _ = Describe(`ProjectV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(postEventNotificationsIntegrationPath)) + Expect(req.URL.EscapedPath()).To(Equal(postTestEventNotificationPath)) Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -5984,10 +5901,10 @@ var _ = Describe(`ProjectV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "created_at": "2019-01-01T12:00:00.000Z"}`) + fmt.Fprintf(res, "%s", `{"datacontenttype": "Datacontenttype", "ibmendefaultlong": "Ibmendefaultlong", "ibmendefaultshort": "Ibmendefaultshort", "ibmensourceid": "Ibmensourceid", "id": "ID", "source": "Source", "specversion": "Specversion", "type": "Type"}`) })) }) - It(`Invoke PostEventNotificationsIntegration successfully`, func() { + It(`Invoke PostTestEventNotification successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -5996,28 +5913,26 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := projectService.PostEventNotificationsIntegration(nil) + result, response, operationErr := projectService.PostTestEventNotification(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the PostEventNotificationsIntegrationOptions model - postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) - postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") - postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") - postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") - postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) - postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostTestEventNotificationOptions model + postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) + postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") + postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") + postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") + postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + result, response, operationErr = projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke PostEventNotificationsIntegration with error: Operation validation and request error`, func() { + It(`Invoke PostTestEventNotification with error: Operation validation and request error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6025,26 +5940,24 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PostEventNotificationsIntegrationOptions model - postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) - postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") - postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") - postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") - postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) - postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostTestEventNotificationOptions model + postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) + postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") + postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") + postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") + postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct a second instance of the PostEventNotificationsIntegrationOptions model with no property values - postEventNotificationsIntegrationOptionsModelNew := new(projectv1.PostEventNotificationsIntegrationOptions) + // Construct a second instance of the PostTestEventNotificationOptions model with no property values + postTestEventNotificationOptionsModelNew := new(projectv1.PostTestEventNotificationOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModelNew) + result, response, operationErr = projectService.PostTestEventNotification(postTestEventNotificationOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -6062,7 +5975,7 @@ var _ = Describe(`ProjectV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke PostEventNotificationsIntegration successfully`, func() { + It(`Invoke PostTestEventNotification successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6070,17 +5983,15 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PostEventNotificationsIntegrationOptions model - postEventNotificationsIntegrationOptionsModel := new(projectv1.PostEventNotificationsIntegrationOptions) - postEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - postEventNotificationsIntegrationOptionsModel.InstanceCrn = core.StringPtr("CRN of event notifications instance") - postEventNotificationsIntegrationOptionsModel.Description = core.StringPtr("A sample project source.") - postEventNotificationsIntegrationOptionsModel.EventNotificationsSourceName = core.StringPtr("project 1 source name for event notifications") - postEventNotificationsIntegrationOptionsModel.Enabled = core.BoolPtr(true) - postEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PostTestEventNotificationOptions model + postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) + postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") + postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") + postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") + postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := projectService.PostEventNotificationsIntegration(postEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -6092,22 +6003,28 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`GetEventNotificationsIntegration(getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions) - Operation response error`, func() { - getEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" + Describe(`ListComplianceProfiles(listComplianceProfilesOptions *ListComplianceProfilesOptions) - Operation response error`, func() { + listComplianceProfilesPath := "/v1/projects/testString/compliance_profiles" Context(`Using mock server endpoint with invalid JSON response`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getEventNotificationsIntegrationPath)) + Expect(req.URL.EscapedPath()).To(Equal(listComplianceProfilesPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Ibm-Trusted-Profile-Id"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Trusted-Profile-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Ibm-Cloud-Api-Key"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Cloud-Api-Key"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetEventNotificationsIntegration with error: Operation response processing error`, func() { + It(`Invoke ListComplianceProfiles with error: Operation response processing error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6115,19 +6032,23 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetEventNotificationsIntegrationOptions model - getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) - getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfilesOptions model + listComplianceProfilesOptionsModel := new(projectv1.ListComplianceProfilesOptions) + listComplianceProfilesOptionsModel.ID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Start = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfilesOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfiles(listComplianceProfilesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again projectService.EnableRetries(0, 0) - result, response, operationErr = projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) + result, response, operationErr = projectService.ListComplianceProfiles(listComplianceProfilesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -6137,27 +6058,33 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`GetEventNotificationsIntegration(getEventNotificationsIntegrationOptions *GetEventNotificationsIntegrationOptions)`, func() { - getEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" + Describe(`ListComplianceProfiles(listComplianceProfilesOptions *ListComplianceProfilesOptions)`, func() { + listComplianceProfilesPath := "/v1/projects/testString/compliance_profiles" Context(`Using mock server endpoint with timeout`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getEventNotificationsIntegrationPath)) + Expect(req.URL.EscapedPath()).To(Equal(listComplianceProfilesPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Ibm-Trusted-Profile-Id"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Trusted-Profile-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Ibm-Cloud-Api-Key"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Cloud-Api-Key"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "updated_at": "2019-01-01T12:00:00.000Z", "topic_count": 10, "topic_names": ["TopicNames"]}`) + fmt.Fprintf(res, "%s", `{"compliance_profiles": [{}]}`) })) }) - It(`Invoke GetEventNotificationsIntegration successfully with retries`, func() { + It(`Invoke ListComplianceProfiles successfully with retries`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6166,21 +6093,25 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) projectService.EnableRetries(0, 0) - // Construct an instance of the GetEventNotificationsIntegrationOptions model - getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) - getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfilesOptions model + listComplianceProfilesOptionsModel := new(projectv1.ListComplianceProfilesOptions) + listComplianceProfilesOptionsModel.ID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Start = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfilesOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() - _, _, operationErr := projectService.GetEventNotificationsIntegrationWithContext(ctx, getEventNotificationsIntegrationOptionsModel) + _, _, operationErr := projectService.ListComplianceProfilesWithContext(ctx, listComplianceProfilesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again projectService.DisableRetries() - result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfiles(listComplianceProfilesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -6188,7 +6119,7 @@ var _ = Describe(`ProjectV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = projectService.GetEventNotificationsIntegrationWithContext(ctx, getEventNotificationsIntegrationOptionsModel) + _, _, operationErr = projectService.ListComplianceProfilesWithContext(ctx, listComplianceProfilesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -6202,16 +6133,22 @@ var _ = Describe(`ProjectV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getEventNotificationsIntegrationPath)) + Expect(req.URL.EscapedPath()).To(Equal(listComplianceProfilesPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Ibm-Trusted-Profile-Id"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Trusted-Profile-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Ibm-Cloud-Api-Key"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Cloud-Api-Key"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"description": "Description", "name": "Name", "enabled": false, "id": "ID", "type": "Type", "updated_at": "2019-01-01T12:00:00.000Z", "topic_count": 10, "topic_names": ["TopicNames"]}`) + fmt.Fprintf(res, "%s", `{"compliance_profiles": [{}]}`) })) }) - It(`Invoke GetEventNotificationsIntegration successfully`, func() { + It(`Invoke ListComplianceProfiles successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6220,24 +6157,28 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := projectService.GetEventNotificationsIntegration(nil) + result, response, operationErr := projectService.ListComplianceProfiles(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetEventNotificationsIntegrationOptions model - getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) - getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfilesOptions model + listComplianceProfilesOptionsModel := new(projectv1.ListComplianceProfilesOptions) + listComplianceProfilesOptionsModel.ID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Start = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfilesOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) + result, response, operationErr = projectService.ListComplianceProfiles(listComplianceProfilesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetEventNotificationsIntegration with error: Operation validation and request error`, func() { + It(`Invoke ListComplianceProfiles with error: Operation validation and request error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6245,22 +6186,26 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetEventNotificationsIntegrationOptions model - getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) - getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfilesOptions model + listComplianceProfilesOptionsModel := new(projectv1.ListComplianceProfilesOptions) + listComplianceProfilesOptionsModel.ID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Start = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfilesOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfiles(listComplianceProfilesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct a second instance of the GetEventNotificationsIntegrationOptions model with no property values - getEventNotificationsIntegrationOptionsModelNew := new(projectv1.GetEventNotificationsIntegrationOptions) + // Construct a second instance of the ListComplianceProfilesOptions model with no property values + listComplianceProfilesOptionsModelNew := new(projectv1.ListComplianceProfilesOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModelNew) + result, response, operationErr = projectService.ListComplianceProfiles(listComplianceProfilesOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -6278,7 +6223,7 @@ var _ = Describe(`ProjectV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetEventNotificationsIntegration successfully`, func() { + It(`Invoke ListComplianceProfiles successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6286,13 +6231,17 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the GetEventNotificationsIntegrationOptions model - getEventNotificationsIntegrationOptionsModel := new(projectv1.GetEventNotificationsIntegrationOptions) - getEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - getEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfilesOptions model + listComplianceProfilesOptionsModel := new(projectv1.ListComplianceProfilesOptions) + listComplianceProfilesOptionsModel.ID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Start = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfilesOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfilesOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfilesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := projectService.GetEventNotificationsIntegration(getEventNotificationsIntegrationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfiles(listComplianceProfilesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -6304,90 +6253,28 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptions *DeleteEventNotificationsIntegrationOptions)`, func() { - deleteEventNotificationsIntegrationPath := "/v1/projects/testString/event_notifications" - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() - - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(deleteEventNotificationsIntegrationPath)) - Expect(req.Method).To(Equal("DELETE")) - - res.WriteHeader(204) - })) - }) - It(`Invoke DeleteEventNotificationsIntegration successfully`, func() { - projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(projectService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - response, operationErr := projectService.DeleteEventNotificationsIntegration(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the DeleteEventNotificationsIntegrationOptions model - deleteEventNotificationsIntegrationOptionsModel := new(projectv1.DeleteEventNotificationsIntegrationOptions) - deleteEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - deleteEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke DeleteEventNotificationsIntegration with error: Operation validation and request error`, func() { - projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(projectService).ToNot(BeNil()) - - // Construct an instance of the DeleteEventNotificationsIntegrationOptions model - deleteEventNotificationsIntegrationOptionsModel := new(projectv1.DeleteEventNotificationsIntegrationOptions) - deleteEventNotificationsIntegrationOptionsModel.ID = core.StringPtr("testString") - deleteEventNotificationsIntegrationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := projectService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the DeleteEventNotificationsIntegrationOptions model with no property values - deleteEventNotificationsIntegrationOptionsModelNew := new(projectv1.DeleteEventNotificationsIntegrationOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = projectService.DeleteEventNotificationsIntegration(deleteEventNotificationsIntegrationOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`PostTestEventNotification(postTestEventNotificationOptions *PostTestEventNotificationOptions) - Operation response error`, func() { - postTestEventNotificationPath := "/v1/projects/testString/event_notifications/test" + Describe(`ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptions *ListComplianceProfileAttachmentsOptions) - Operation response error`, func() { + listComplianceProfileAttachmentsPath := "/v1/projects/testString/compliance_profiles/testString/attachments" Context(`Using mock server endpoint with invalid JSON response`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(postTestEventNotificationPath)) - Expect(req.Method).To(Equal("POST")) + Expect(req.URL.EscapedPath()).To(Equal(listComplianceProfileAttachmentsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Ibm-Trusted-Profile-Id"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Trusted-Profile-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Ibm-Cloud-Api-Key"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Cloud-Api-Key"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke PostTestEventNotification with error: Operation response processing error`, func() { + It(`Invoke ListComplianceProfileAttachments with error: Operation response processing error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6395,21 +6282,24 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PostTestEventNotificationOptions model - postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) - postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") - postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") - postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") - postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfileAttachmentsOptions model + listComplianceProfileAttachmentsOptionsModel := new(projectv1.ListComplianceProfileAttachmentsOptions) + listComplianceProfileAttachmentsOptionsModel.ID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.ProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Start = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfileAttachmentsOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response - result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again projectService.EnableRetries(0, 0) - result, response, operationErr = projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) + result, response, operationErr = projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -6419,43 +6309,33 @@ var _ = Describe(`ProjectV1`, func() { }) }) }) - Describe(`PostTestEventNotification(postTestEventNotificationOptions *PostTestEventNotificationOptions)`, func() { - postTestEventNotificationPath := "/v1/projects/testString/event_notifications/test" + Describe(`ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptions *ListComplianceProfileAttachmentsOptions)`, func() { + listComplianceProfileAttachmentsPath := "/v1/projects/testString/compliance_profiles/testString/attachments" Context(`Using mock server endpoint with timeout`, func() { BeforeEach(func() { testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(postTestEventNotificationPath)) - Expect(req.Method).To(Equal("POST")) - - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) - - // If there is a body, then make sure we can read it - bodyBuf := new(bytes.Buffer) - if req.Header.Get("Content-Encoding") == "gzip" { - body, err := core.NewGzipDecompressionReader(req.Body) - Expect(err).To(BeNil()) - _, err = bodyBuf.ReadFrom(body) - Expect(err).To(BeNil()) - } else { - _, err := bodyBuf.ReadFrom(req.Body) - Expect(err).To(BeNil()) - } - fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.URL.EscapedPath()).To(Equal(listComplianceProfileAttachmentsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Ibm-Trusted-Profile-Id"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Trusted-Profile-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Ibm-Cloud-Api-Key"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Cloud-Api-Key"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"datacontenttype": "Datacontenttype", "ibmendefaultlong": "Ibmendefaultlong", "ibmendefaultshort": "Ibmendefaultshort", "ibmensourceid": "Ibmensourceid", "id": "ID", "source": "Source", "specversion": "Specversion", "type": "Type"}`) + fmt.Fprintf(res, "%s", `{"attachments": [{}]}`) })) }) - It(`Invoke PostTestEventNotification successfully with retries`, func() { + It(`Invoke ListComplianceProfileAttachments successfully with retries`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6464,23 +6344,26 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) projectService.EnableRetries(0, 0) - // Construct an instance of the PostTestEventNotificationOptions model - postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) - postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") - postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") - postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") - postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfileAttachmentsOptions model + listComplianceProfileAttachmentsOptionsModel := new(projectv1.ListComplianceProfileAttachmentsOptions) + listComplianceProfileAttachmentsOptionsModel.ID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.ProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Start = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfileAttachmentsOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc() - _, _, operationErr := projectService.PostTestEventNotificationWithContext(ctx, postTestEventNotificationOptionsModel) + _, _, operationErr := projectService.ListComplianceProfileAttachmentsWithContext(ctx, listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again projectService.DisableRetries() - result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -6488,7 +6371,7 @@ var _ = Describe(`ProjectV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = projectService.PostTestEventNotificationWithContext(ctx, postTestEventNotificationOptionsModel) + _, _, operationErr = projectService.ListComplianceProfileAttachmentsWithContext(ctx, listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -6502,32 +6385,22 @@ var _ = Describe(`ProjectV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(postTestEventNotificationPath)) - Expect(req.Method).To(Equal("POST")) - - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) - - // If there is a body, then make sure we can read it - bodyBuf := new(bytes.Buffer) - if req.Header.Get("Content-Encoding") == "gzip" { - body, err := core.NewGzipDecompressionReader(req.Body) - Expect(err).To(BeNil()) - _, err = bodyBuf.ReadFrom(body) - Expect(err).To(BeNil()) - } else { - _, err := bodyBuf.ReadFrom(req.Body) - Expect(err).To(BeNil()) - } - fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.URL.EscapedPath()).To(Equal(listComplianceProfileAttachmentsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Ibm-Trusted-Profile-Id"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Trusted-Profile-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.Header["Ibm-Cloud-Api-Key"]).ToNot(BeNil()) + Expect(req.Header["Ibm-Cloud-Api-Key"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"datacontenttype": "Datacontenttype", "ibmendefaultlong": "Ibmendefaultlong", "ibmendefaultshort": "Ibmendefaultshort", "ibmensourceid": "Ibmensourceid", "id": "ID", "source": "Source", "specversion": "Specversion", "type": "Type"}`) + fmt.Fprintf(res, "%s", `{"attachments": [{}]}`) })) }) - It(`Invoke PostTestEventNotification successfully`, func() { + It(`Invoke ListComplianceProfileAttachments successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6536,26 +6409,29 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := projectService.PostTestEventNotification(nil) + result, response, operationErr := projectService.ListComplianceProfileAttachments(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the PostTestEventNotificationOptions model - postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) - postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") - postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") - postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") - postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfileAttachmentsOptions model + listComplianceProfileAttachmentsOptionsModel := new(projectv1.ListComplianceProfileAttachmentsOptions) + listComplianceProfileAttachmentsOptionsModel.ID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.ProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Start = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfileAttachmentsOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) + result, response, operationErr = projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke PostTestEventNotification with error: Operation validation and request error`, func() { + It(`Invoke ListComplianceProfileAttachments with error: Operation validation and request error`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6563,24 +6439,27 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PostTestEventNotificationOptions model - postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) - postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") - postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") - postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") - postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfileAttachmentsOptions model + listComplianceProfileAttachmentsOptionsModel := new(projectv1.ListComplianceProfileAttachmentsOptions) + listComplianceProfileAttachmentsOptionsModel.ID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.ProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Start = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfileAttachmentsOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := projectService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct a second instance of the PostTestEventNotificationOptions model with no property values - postTestEventNotificationOptionsModelNew := new(projectv1.PostTestEventNotificationOptions) + // Construct a second instance of the ListComplianceProfileAttachmentsOptions model with no property values + listComplianceProfileAttachmentsOptionsModelNew := new(projectv1.ListComplianceProfileAttachmentsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = projectService.PostTestEventNotification(postTestEventNotificationOptionsModelNew) + result, response, operationErr = projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -6598,7 +6477,7 @@ var _ = Describe(`ProjectV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke PostTestEventNotification successfully`, func() { + It(`Invoke ListComplianceProfileAttachments successfully`, func() { projectService, serviceErr := projectv1.NewProjectV1(&projectv1.ProjectV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -6606,15 +6485,18 @@ var _ = Describe(`ProjectV1`, func() { Expect(serviceErr).To(BeNil()) Expect(projectService).ToNot(BeNil()) - // Construct an instance of the PostTestEventNotificationOptions model - postTestEventNotificationOptionsModel := new(projectv1.PostTestEventNotificationOptions) - postTestEventNotificationOptionsModel.ID = core.StringPtr("testString") - postTestEventNotificationOptionsModel.Ibmendefaultlong = core.StringPtr("long test notification message") - postTestEventNotificationOptionsModel.Ibmendefaultshort = core.StringPtr("Test notification") - postTestEventNotificationOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListComplianceProfileAttachmentsOptions model + listComplianceProfileAttachmentsOptionsModel := new(projectv1.ListComplianceProfileAttachmentsOptions) + listComplianceProfileAttachmentsOptionsModel.ID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.ProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Start = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Limit = core.Int64Ptr(int64(1)) + listComplianceProfileAttachmentsOptionsModel.IbmTrustedProfileID = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.IbmCloudApiKey = core.StringPtr("testString") + listComplianceProfileAttachmentsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := projectService.PostTestEventNotification(postTestEventNotificationOptionsModel) + result, response, operationErr := projectService.ListComplianceProfileAttachments(listComplianceProfileAttachmentsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -6634,38 +6516,38 @@ var _ = Describe(`ProjectV1`, func() { }) It(`Invoke NewApproveOptions successfully`, func() { // Construct an instance of the ApproveOptions model + projectID := "testString" id := "testString" - configID := "testString" - approveOptionsModel := projectService.NewApproveOptions(id, configID) + approveOptionsModel := projectService.NewApproveOptions(projectID, id) + approveOptionsModel.SetProjectID("testString") approveOptionsModel.SetID("testString") - approveOptionsModel.SetConfigID("testString") approveOptionsModel.SetComment("Approving the changes") approveOptionsModel.SetComplete(false) approveOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(approveOptionsModel).ToNot(BeNil()) + Expect(approveOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(approveOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(approveOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(approveOptionsModel.Comment).To(Equal(core.StringPtr("Approving the changes"))) Expect(approveOptionsModel.Complete).To(Equal(core.BoolPtr(false))) Expect(approveOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCheckConfigOptions successfully`, func() { // Construct an instance of the CheckConfigOptions model + projectID := "testString" id := "testString" - configID := "testString" - checkConfigOptionsModel := projectService.NewCheckConfigOptions(id, configID) + checkConfigOptionsModel := projectService.NewCheckConfigOptions(projectID, id) + checkConfigOptionsModel.SetProjectID("testString") checkConfigOptionsModel.SetID("testString") - checkConfigOptionsModel.SetConfigID("testString") checkConfigOptionsModel.SetXAuthRefreshToken("testString") - checkConfigOptionsModel.SetVersion("active") checkConfigOptionsModel.SetComplete(false) + checkConfigOptionsModel.SetVersion("active") checkConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(checkConfigOptionsModel).ToNot(BeNil()) + Expect(checkConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(checkConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(checkConfigOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(checkConfigOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(checkConfigOptionsModel.Version).To(Equal(core.StringPtr("active"))) Expect(checkConfigOptionsModel.Complete).To(Equal(core.BoolPtr(false))) + Expect(checkConfigOptionsModel.Version).To(Equal(core.StringPtr("active"))) Expect(checkConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCreateConfigOptions successfully`, func() { @@ -6673,7 +6555,9 @@ var _ = Describe(`ProjectV1`, func() { projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) Expect(projectConfigInputVariableModel).ToNot(BeNil()) projectConfigInputVariableModel.Name = core.StringPtr("account_id") + projectConfigInputVariableModel.Value = core.StringPtr(`$configs[].name["account-stage"].input.account_id`) Expect(projectConfigInputVariableModel.Name).To(Equal(core.StringPtr("account_id"))) + Expect(projectConfigInputVariableModel.Value).To(Equal(core.StringPtr(`$configs[].name["account-stage"].input.account_id`))) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -6684,28 +6568,28 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectConfigSettingCollectionModel.Value).To(Equal(core.StringPtr("https://api.us-south.devops.dev.cloud.ibm.com"))) // Construct an instance of the CreateConfigOptions model - id := "testString" - createConfigOptionsNewName := "env-stage" - createConfigOptionsNewLocatorID := "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" - createConfigOptionsModel := projectService.NewCreateConfigOptions(id, createConfigOptionsNewName, createConfigOptionsNewLocatorID) + projectID := "testString" + createConfigOptionsName := "env-stage" + createConfigOptionsLocatorID := "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" + createConfigOptionsModel := projectService.NewCreateConfigOptions(projectID, createConfigOptionsName, createConfigOptionsLocatorID) + createConfigOptionsModel.SetProjectID("testString") + createConfigOptionsModel.SetName("env-stage") + createConfigOptionsModel.SetLocatorID("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") createConfigOptionsModel.SetID("testString") - createConfigOptionsModel.SetNewName("env-stage") - createConfigOptionsModel.SetNewLocatorID("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global") - createConfigOptionsModel.SetNewID("testString") - createConfigOptionsModel.SetNewLabels([]string{"env:stage", "governance:test", "build:0"}) - createConfigOptionsModel.SetNewDescription("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") - createConfigOptionsModel.SetNewInput([]projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel}) - createConfigOptionsModel.SetNewSetting([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel}) + createConfigOptionsModel.SetLabels([]string{"env:stage", "governance:test", "build:0"}) + createConfigOptionsModel.SetDescription("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace.") + createConfigOptionsModel.SetInput([]projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel}) + createConfigOptionsModel.SetSetting([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel}) createConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createConfigOptionsModel).ToNot(BeNil()) + Expect(createConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) + Expect(createConfigOptionsModel.Name).To(Equal(core.StringPtr("env-stage"))) + Expect(createConfigOptionsModel.LocatorID).To(Equal(core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"))) Expect(createConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(createConfigOptionsModel.NewName).To(Equal(core.StringPtr("env-stage"))) - Expect(createConfigOptionsModel.NewLocatorID).To(Equal(core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"))) - Expect(createConfigOptionsModel.NewID).To(Equal(core.StringPtr("testString"))) - Expect(createConfigOptionsModel.NewLabels).To(Equal([]string{"env:stage", "governance:test", "build:0"})) - Expect(createConfigOptionsModel.NewDescription).To(Equal(core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace."))) - Expect(createConfigOptionsModel.NewInput).To(Equal([]projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel})) - Expect(createConfigOptionsModel.NewSetting).To(Equal([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel})) + Expect(createConfigOptionsModel.Labels).To(Equal([]string{"env:stage", "governance:test", "build:0"})) + Expect(createConfigOptionsModel.Description).To(Equal(core.StringPtr("Stage environment configuration, which includes services common to all the environment regions. There must be a blueprint configuring all the services common to the stage regions. It is a terraform_template type of configuration that points to a Github repo hosting the terraform modules that can be deployed by a Schematics Workspace."))) + Expect(createConfigOptionsModel.Input).To(Equal([]projectv1.ProjectConfigInputVariable{*projectConfigInputVariableModel})) + Expect(createConfigOptionsModel.Setting).To(Equal([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel})) Expect(createConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCreateProjectOptions successfully`, func() { @@ -6713,7 +6597,9 @@ var _ = Describe(`ProjectV1`, func() { projectConfigInputVariableModel := new(projectv1.ProjectConfigInputVariable) Expect(projectConfigInputVariableModel).ToNot(BeNil()) projectConfigInputVariableModel.Name = core.StringPtr("testString") + projectConfigInputVariableModel.Value = core.StringPtr("testString") Expect(projectConfigInputVariableModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(projectConfigInputVariableModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -6742,35 +6628,37 @@ var _ = Describe(`ProjectV1`, func() { Expect(projectConfigPrototypeModel.Setting).To(Equal([]projectv1.ProjectConfigSettingCollection{*projectConfigSettingCollectionModel})) // Construct an instance of the CreateProjectOptions model + resourceGroup := "testString" + location := "testString" createProjectOptionsName := "acme-microservice" - createProjectOptionsModel := projectService.NewCreateProjectOptions(createProjectOptionsName) + createProjectOptionsModel := projectService.NewCreateProjectOptions(resourceGroup, location, createProjectOptionsName) + createProjectOptionsModel.SetResourceGroup("testString") + createProjectOptionsModel.SetLocation("testString") createProjectOptionsModel.SetName("acme-microservice") createProjectOptionsModel.SetDescription("A microservice to deploy on top of ACME infrastructure.") createProjectOptionsModel.SetConfigs([]projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel}) - createProjectOptionsModel.SetResourceGroup("Default") - createProjectOptionsModel.SetLocation("us-south") createProjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createProjectOptionsModel).ToNot(BeNil()) + Expect(createProjectOptionsModel.ResourceGroup).To(Equal(core.StringPtr("testString"))) + Expect(createProjectOptionsModel.Location).To(Equal(core.StringPtr("testString"))) Expect(createProjectOptionsModel.Name).To(Equal(core.StringPtr("acme-microservice"))) Expect(createProjectOptionsModel.Description).To(Equal(core.StringPtr("A microservice to deploy on top of ACME infrastructure."))) Expect(createProjectOptionsModel.Configs).To(Equal([]projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel})) - Expect(createProjectOptionsModel.ResourceGroup).To(Equal(core.StringPtr("Default"))) - Expect(createProjectOptionsModel.Location).To(Equal(core.StringPtr("us-south"))) Expect(createProjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewDeleteConfigOptions successfully`, func() { // Construct an instance of the DeleteConfigOptions model + projectID := "testString" id := "testString" - configID := "testString" - deleteConfigOptionsModel := projectService.NewDeleteConfigOptions(id, configID) + deleteConfigOptionsModel := projectService.NewDeleteConfigOptions(projectID, id) + deleteConfigOptionsModel.SetProjectID("testString") deleteConfigOptionsModel.SetID("testString") - deleteConfigOptionsModel.SetConfigID("testString") deleteConfigOptionsModel.SetDraftOnly(false) deleteConfigOptionsModel.SetDestroy(false) deleteConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(deleteConfigOptionsModel).ToNot(BeNil()) + Expect(deleteConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(deleteConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(deleteConfigOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(deleteConfigOptionsModel.DraftOnly).To(Equal(core.BoolPtr(false))) Expect(deleteConfigOptionsModel.Destroy).To(Equal(core.BoolPtr(false))) Expect(deleteConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) @@ -6797,96 +6685,65 @@ var _ = Describe(`ProjectV1`, func() { Expect(deleteProjectOptionsModel.Destroy).To(Equal(core.BoolPtr(false))) Expect(deleteProjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewDeleteServiceInstanceOptions successfully`, func() { - // Construct an instance of the DeleteServiceInstanceOptions model - instanceID := "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" - planID := "cb54391b-3316-4943-a5a6-a541678c1924" - serviceID := "cb54391b-3316-4943-a5a6-a541678c1924" - deleteServiceInstanceOptionsModel := projectService.NewDeleteServiceInstanceOptions(instanceID, planID, serviceID) - deleteServiceInstanceOptionsModel.SetInstanceID("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::") - deleteServiceInstanceOptionsModel.SetPlanID("cb54391b-3316-4943-a5a6-a541678c1924") - deleteServiceInstanceOptionsModel.SetServiceID("cb54391b-3316-4943-a5a6-a541678c1924") - deleteServiceInstanceOptionsModel.SetXBrokerApiVersion("1.0") - deleteServiceInstanceOptionsModel.SetXBrokerApiOriginatingIdentity("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0=") - deleteServiceInstanceOptionsModel.SetAcceptsIncomplete(false) - deleteServiceInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteServiceInstanceOptionsModel).ToNot(BeNil()) - Expect(deleteServiceInstanceOptionsModel.InstanceID).To(Equal(core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"))) - Expect(deleteServiceInstanceOptionsModel.PlanID).To(Equal(core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"))) - Expect(deleteServiceInstanceOptionsModel.ServiceID).To(Equal(core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"))) - Expect(deleteServiceInstanceOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(deleteServiceInstanceOptionsModel.XBrokerApiOriginatingIdentity).To(Equal(core.StringPtr("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0="))) - Expect(deleteServiceInstanceOptionsModel.AcceptsIncomplete).To(Equal(core.BoolPtr(false))) - Expect(deleteServiceInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) It(`Invoke NewForceApproveOptions successfully`, func() { // Construct an instance of the ForceApproveOptions model + projectID := "testString" id := "testString" - configID := "testString" - forceApproveOptionsModel := projectService.NewForceApproveOptions(id, configID) + forceApproveOptionsModel := projectService.NewForceApproveOptions(projectID, id) + forceApproveOptionsModel.SetProjectID("testString") forceApproveOptionsModel.SetID("testString") - forceApproveOptionsModel.SetConfigID("testString") forceApproveOptionsModel.SetComment("Approving the changes") forceApproveOptionsModel.SetComplete(false) forceApproveOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(forceApproveOptionsModel).ToNot(BeNil()) + Expect(forceApproveOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(forceApproveOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(forceApproveOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(forceApproveOptionsModel.Comment).To(Equal(core.StringPtr("Approving the changes"))) Expect(forceApproveOptionsModel.Complete).To(Equal(core.BoolPtr(false))) Expect(forceApproveOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewGetCatalogOptions successfully`, func() { - // Construct an instance of the GetCatalogOptions model - getCatalogOptionsModel := projectService.NewGetCatalogOptions() - getCatalogOptionsModel.SetXBrokerApiVersion("1.0") - getCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getCatalogOptionsModel).ToNot(BeNil()) - Expect(getCatalogOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(getCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) It(`Invoke NewGetConfigDiffOptions successfully`, func() { // Construct an instance of the GetConfigDiffOptions model + projectID := "testString" id := "testString" - configID := "testString" - getConfigDiffOptionsModel := projectService.NewGetConfigDiffOptions(id, configID) + getConfigDiffOptionsModel := projectService.NewGetConfigDiffOptions(projectID, id) + getConfigDiffOptionsModel.SetProjectID("testString") getConfigDiffOptionsModel.SetID("testString") - getConfigDiffOptionsModel.SetConfigID("testString") getConfigDiffOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(getConfigDiffOptionsModel).ToNot(BeNil()) + Expect(getConfigDiffOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(getConfigDiffOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getConfigDiffOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(getConfigDiffOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewGetConfigOptions successfully`, func() { // Construct an instance of the GetConfigOptions model + projectID := "testString" id := "testString" - configID := "testString" - getConfigOptionsModel := projectService.NewGetConfigOptions(id, configID) + getConfigOptionsModel := projectService.NewGetConfigOptions(projectID, id) + getConfigOptionsModel.SetProjectID("testString") getConfigOptionsModel.SetID("testString") - getConfigOptionsModel.SetConfigID("testString") getConfigOptionsModel.SetVersion("active") getConfigOptionsModel.SetComplete(false) getConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(getConfigOptionsModel).ToNot(BeNil()) + Expect(getConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(getConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getConfigOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(getConfigOptionsModel.Version).To(Equal(core.StringPtr("active"))) Expect(getConfigOptionsModel.Complete).To(Equal(core.BoolPtr(false))) Expect(getConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewGetCostEstimateOptions successfully`, func() { // Construct an instance of the GetCostEstimateOptions model + projectID := "testString" id := "testString" - configID := "testString" - getCostEstimateOptionsModel := projectService.NewGetCostEstimateOptions(id, configID) + getCostEstimateOptionsModel := projectService.NewGetCostEstimateOptions(projectID, id) + getCostEstimateOptionsModel.SetProjectID("testString") getCostEstimateOptionsModel.SetID("testString") - getCostEstimateOptionsModel.SetConfigID("testString") getCostEstimateOptionsModel.SetVersion("active") getCostEstimateOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(getCostEstimateOptionsModel).ToNot(BeNil()) + Expect(getCostEstimateOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(getCostEstimateOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getCostEstimateOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(getCostEstimateOptionsModel.Version).To(Equal(core.StringPtr("active"))) Expect(getCostEstimateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) @@ -6900,33 +6757,6 @@ var _ = Describe(`ProjectV1`, func() { Expect(getEventNotificationsIntegrationOptionsModel.ID).To(Equal(core.StringPtr("testString"))) Expect(getEventNotificationsIntegrationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewGetHealthOptions successfully`, func() { - // Construct an instance of the GetHealthOptions model - getHealthOptionsModel := projectService.NewGetHealthOptions() - getHealthOptionsModel.SetInfo(false) - getHealthOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getHealthOptionsModel).ToNot(BeNil()) - Expect(getHealthOptionsModel.Info).To(Equal(core.BoolPtr(false))) - Expect(getHealthOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetLastOperationOptions successfully`, func() { - // Construct an instance of the GetLastOperationOptions model - instanceID := "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" - getLastOperationOptionsModel := projectService.NewGetLastOperationOptions(instanceID) - getLastOperationOptionsModel.SetInstanceID("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::") - getLastOperationOptionsModel.SetXBrokerApiVersion("1.0") - getLastOperationOptionsModel.SetOperation("ABCD") - getLastOperationOptionsModel.SetPlanID("cb54391b-3316-4943-a5a6-a541678c1924") - getLastOperationOptionsModel.SetServiceID("cb54391b-3316-4943-a5a6-a541678c1924") - getLastOperationOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getLastOperationOptionsModel).ToNot(BeNil()) - Expect(getLastOperationOptionsModel.InstanceID).To(Equal(core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"))) - Expect(getLastOperationOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(getLastOperationOptionsModel.Operation).To(Equal(core.StringPtr("ABCD"))) - Expect(getLastOperationOptionsModel.PlanID).To(Equal(core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"))) - Expect(getLastOperationOptionsModel.ServiceID).To(Equal(core.StringPtr("cb54391b-3316-4943-a5a6-a541678c1924"))) - Expect(getLastOperationOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) It(`Invoke NewGetNotificationsOptions successfully`, func() { // Construct an instance of the GetNotificationsOptions model id := "testString" @@ -6953,46 +6783,34 @@ var _ = Describe(`ProjectV1`, func() { }) It(`Invoke NewGetSchematicsJobOptions successfully`, func() { // Construct an instance of the GetSchematicsJobOptions model + projectID := "testString" id := "testString" - configID := "testString" action := "plan" - getSchematicsJobOptionsModel := projectService.NewGetSchematicsJobOptions(id, configID, action) + getSchematicsJobOptionsModel := projectService.NewGetSchematicsJobOptions(projectID, id, action) + getSchematicsJobOptionsModel.SetProjectID("testString") getSchematicsJobOptionsModel.SetID("testString") - getSchematicsJobOptionsModel.SetConfigID("testString") getSchematicsJobOptionsModel.SetAction("plan") getSchematicsJobOptionsModel.SetSince(int64(38)) getSchematicsJobOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(getSchematicsJobOptionsModel).ToNot(BeNil()) + Expect(getSchematicsJobOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(getSchematicsJobOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getSchematicsJobOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(getSchematicsJobOptionsModel.Action).To(Equal(core.StringPtr("plan"))) Expect(getSchematicsJobOptionsModel.Since).To(Equal(core.Int64Ptr(int64(38)))) Expect(getSchematicsJobOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewGetServiceInstanceOptions successfully`, func() { - // Construct an instance of the GetServiceInstanceOptions model - instanceID := "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" - getServiceInstanceOptionsModel := projectService.NewGetServiceInstanceOptions(instanceID) - getServiceInstanceOptionsModel.SetInstanceID("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::") - getServiceInstanceOptionsModel.SetXBrokerApiVersion("1.0") - getServiceInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getServiceInstanceOptionsModel).ToNot(BeNil()) - Expect(getServiceInstanceOptionsModel.InstanceID).To(Equal(core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"))) - Expect(getServiceInstanceOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(getServiceInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) It(`Invoke NewInstallConfigOptions successfully`, func() { // Construct an instance of the InstallConfigOptions model + projectID := "testString" id := "testString" - configID := "testString" - installConfigOptionsModel := projectService.NewInstallConfigOptions(id, configID) + installConfigOptionsModel := projectService.NewInstallConfigOptions(projectID, id) + installConfigOptionsModel.SetProjectID("testString") installConfigOptionsModel.SetID("testString") - installConfigOptionsModel.SetConfigID("testString") installConfigOptionsModel.SetComplete(false) installConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(installConfigOptionsModel).ToNot(BeNil()) + Expect(installConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(installConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(installConfigOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(installConfigOptionsModel.Complete).To(Equal(core.BoolPtr(false))) Expect(installConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) @@ -7003,20 +6821,57 @@ var _ = Describe(`ProjectV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) + It(`Invoke NewListComplianceProfileAttachmentsOptions successfully`, func() { + // Construct an instance of the ListComplianceProfileAttachmentsOptions model + id := "testString" + profileID := "testString" + listComplianceProfileAttachmentsOptionsModel := projectService.NewListComplianceProfileAttachmentsOptions(id, profileID) + listComplianceProfileAttachmentsOptionsModel.SetID("testString") + listComplianceProfileAttachmentsOptionsModel.SetProfileID("testString") + listComplianceProfileAttachmentsOptionsModel.SetStart("testString") + listComplianceProfileAttachmentsOptionsModel.SetLimit(int64(1)) + listComplianceProfileAttachmentsOptionsModel.SetIbmTrustedProfileID("testString") + listComplianceProfileAttachmentsOptionsModel.SetIbmCloudApiKey("testString") + listComplianceProfileAttachmentsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listComplianceProfileAttachmentsOptionsModel).ToNot(BeNil()) + Expect(listComplianceProfileAttachmentsOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfileAttachmentsOptionsModel.ProfileID).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfileAttachmentsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfileAttachmentsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(1)))) + Expect(listComplianceProfileAttachmentsOptionsModel.IbmTrustedProfileID).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfileAttachmentsOptionsModel.IbmCloudApiKey).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfileAttachmentsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListComplianceProfilesOptions successfully`, func() { + // Construct an instance of the ListComplianceProfilesOptions model + id := "testString" + listComplianceProfilesOptionsModel := projectService.NewListComplianceProfilesOptions(id) + listComplianceProfilesOptionsModel.SetID("testString") + listComplianceProfilesOptionsModel.SetStart("testString") + listComplianceProfilesOptionsModel.SetLimit(int64(1)) + listComplianceProfilesOptionsModel.SetIbmTrustedProfileID("testString") + listComplianceProfilesOptionsModel.SetIbmCloudApiKey("testString") + listComplianceProfilesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listComplianceProfilesOptionsModel).ToNot(BeNil()) + Expect(listComplianceProfilesOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfilesOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfilesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(1)))) + Expect(listComplianceProfilesOptionsModel.IbmTrustedProfileID).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfilesOptionsModel.IbmCloudApiKey).To(Equal(core.StringPtr("testString"))) + Expect(listComplianceProfilesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) It(`Invoke NewListConfigsOptions successfully`, func() { // Construct an instance of the ListConfigsOptions model - id := "testString" - listConfigsOptionsModel := projectService.NewListConfigsOptions(id) - listConfigsOptionsModel.SetID("testString") + projectID := "testString" + listConfigsOptionsModel := projectService.NewListConfigsOptions(projectID) + listConfigsOptionsModel.SetProjectID("testString") listConfigsOptionsModel.SetVersion("active") listConfigsOptionsModel.SetComplete(false) - listConfigsOptionsModel.SetProjectID("testString") listConfigsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(listConfigsOptionsModel).ToNot(BeNil()) - Expect(listConfigsOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(listConfigsOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(listConfigsOptionsModel.Version).To(Equal(core.StringPtr("active"))) Expect(listConfigsOptionsModel.Complete).To(Equal(core.BoolPtr(false))) - Expect(listConfigsOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(listConfigsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewListProjectsOptions successfully`, func() { @@ -7115,13 +6970,14 @@ var _ = Describe(`ProjectV1`, func() { inputVariableModel := new(projectv1.InputVariable) inputVariableModel.Name = core.StringPtr("testString") inputVariableModel.Type = core.StringPtr("array") + inputVariableModel.Value = core.StringPtr("testString") inputVariableModel.Required = core.BoolPtr(true) // Construct an instance of the OutputValue model outputValueModel := new(projectv1.OutputValue) outputValueModel.Name = core.StringPtr("testString") outputValueModel.Description = core.StringPtr("testString") - outputValueModel.Value = []string{"testString"} + outputValueModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -7174,41 +7030,41 @@ var _ = Describe(`ProjectV1`, func() { return *op.(projectv1.JSONPatchOperation).Path } Expect(projectPatch).To(MatchAllElements(_path, Elements{ - "/name": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/name")), - "From": BeNil(), - "Value": Equal(project.Name), + "/name": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/name")), + "From": BeNil(), + "Value": Equal(project.Name), }), - "/description": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/description")), - "From": BeNil(), - "Value": Equal(project.Description), + "/description": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/description")), + "From": BeNil(), + "Value": Equal(project.Description), }), - "/id": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/id")), - "From": BeNil(), - "Value": Equal(project.ID), + "/id": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/id")), + "From": BeNil(), + "Value": Equal(project.ID), }), - "/crn": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/crn")), - "From": BeNil(), - "Value": Equal(project.Crn), + "/crn": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/crn")), + "From": BeNil(), + "Value": Equal(project.Crn), }), - "/configs": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/configs")), - "From": BeNil(), - "Value": Equal(project.Configs), + "/configs": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/configs")), + "From": BeNil(), + "Value": Equal(project.Configs), }), - "/metadata": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/metadata")), - "From": BeNil(), - "Value": Equal(project.Metadata), + "/metadata": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/metadata")), + "From": BeNil(), + "Value": Equal(project.Metadata), }), })) }) @@ -7217,13 +7073,14 @@ var _ = Describe(`ProjectV1`, func() { inputVariableModel := new(projectv1.InputVariable) inputVariableModel.Name = core.StringPtr("testString") inputVariableModel.Type = core.StringPtr("array") + inputVariableModel.Value = core.StringPtr("testString") inputVariableModel.Required = core.BoolPtr(true) // Construct an instance of the OutputValue model outputValueModel := new(projectv1.OutputValue) outputValueModel.Name = core.StringPtr("testString") outputValueModel.Description = core.StringPtr("testString") - outputValueModel.Value = []string{"testString"} + outputValueModel.Value = core.StringPtr("testString") // Construct an instance of the ProjectConfigSettingCollection model projectConfigSettingCollectionModel := new(projectv1.ProjectConfigSettingCollection) @@ -7249,59 +7106,59 @@ var _ = Describe(`ProjectV1`, func() { return *op.(projectv1.JSONPatchOperation).Path } Expect(projectConfigPatch).To(MatchAllElements(_path, Elements{ - "/id": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/id")), - "From": BeNil(), - "Value": Equal(projectConfig.ID), + "/id": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/id")), + "From": BeNil(), + "Value": Equal(projectConfig.ID), }), - "/name": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/name")), - "From": BeNil(), - "Value": Equal(projectConfig.Name), + "/name": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/name")), + "From": BeNil(), + "Value": Equal(projectConfig.Name), }), - "/labels": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/labels")), - "From": BeNil(), - "Value": Equal(projectConfig.Labels), + "/labels": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/labels")), + "From": BeNil(), + "Value": Equal(projectConfig.Labels), }), - "/description": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/description")), - "From": BeNil(), - "Value": Equal(projectConfig.Description), + "/description": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/description")), + "From": BeNil(), + "Value": Equal(projectConfig.Description), }), - "/locator_id": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/locator_id")), - "From": BeNil(), - "Value": Equal(projectConfig.LocatorID), + "/locator_id": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/locator_id")), + "From": BeNil(), + "Value": Equal(projectConfig.LocatorID), }), - "/type": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/type")), - "From": BeNil(), - "Value": Equal(projectConfig.Type), + "/type": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/type")), + "From": BeNil(), + "Value": Equal(projectConfig.Type), }), - "/input": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/input")), - "From": BeNil(), - "Value": Equal(projectConfig.Input), + "/input": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/input")), + "From": BeNil(), + "Value": Equal(projectConfig.Input), }), - "/output": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/output")), - "From": BeNil(), - "Value": Equal(projectConfig.Output), + "/output": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/output")), + "From": BeNil(), + "Value": Equal(projectConfig.Output), }), - "/setting": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/setting")), - "From": BeNil(), - "Value": Equal(projectConfig.Setting), + "/setting": MatchAllFields(Fields{ + "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), + "Path": PointTo(Equal("/setting")), + "From": BeNil(), + "Value": Equal(projectConfig.Setting), }), })) }) @@ -7325,178 +7182,17 @@ var _ = Describe(`ProjectV1`, func() { Expect(_model).ToNot(BeNil()) Expect(err).To(BeNil()) }) - It(`Invoke NewPulsarEventPrototypeCollection successfully`, func() { - eventType := "testString" - timestamp := CreateMockDateTime("2019-01-01T12:00:00.000Z") - publisher := "testString" - accountID := "testString" - version := "testString" - _model, err := projectService.NewPulsarEventPrototypeCollection(eventType, timestamp, publisher, accountID, version) - Expect(_model).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - It(`Invoke NewReceivePulsarCatalogEventsOptions successfully`, func() { - // Construct an instance of the PulsarEventPrototypeCollection model - pulsarEventPrototypeCollectionModel := new(projectv1.PulsarEventPrototypeCollection) - Expect(pulsarEventPrototypeCollectionModel).ToNot(BeNil()) - pulsarEventPrototypeCollectionModel.EventType = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Timestamp = CreateMockDateTime("2019-01-01T12:00:00.000Z") - pulsarEventPrototypeCollectionModel.Publisher = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.AccountID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Version = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.EventProperties = map[string]interface{}{"anyKey": "anyValue"} - pulsarEventPrototypeCollectionModel.EventID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - Expect(pulsarEventPrototypeCollectionModel.EventType).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.Timestamp).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(pulsarEventPrototypeCollectionModel.Publisher).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.AccountID).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.EventProperties).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(pulsarEventPrototypeCollectionModel.EventID).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.GetProperties()).ToNot(BeEmpty()) - Expect(pulsarEventPrototypeCollectionModel.GetProperty("foo")).To(Equal(core.StringPtr("testString"))) - - pulsarEventPrototypeCollectionModel.SetProperties(nil) - Expect(pulsarEventPrototypeCollectionModel.GetProperties()).To(BeEmpty()) - - pulsarEventPrototypeCollectionModelExpectedMap := make(map[string]interface{}) - pulsarEventPrototypeCollectionModelExpectedMap["foo"] = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperties(pulsarEventPrototypeCollectionModelExpectedMap) - pulsarEventPrototypeCollectionModelActualMap := pulsarEventPrototypeCollectionModel.GetProperties() - Expect(pulsarEventPrototypeCollectionModelActualMap).To(Equal(pulsarEventPrototypeCollectionModelExpectedMap)) - - // Construct an instance of the ReceivePulsarCatalogEventsOptions model - pulsarCatalogEvents := []projectv1.PulsarEventPrototypeCollection{} - receivePulsarCatalogEventsOptionsModel := projectService.NewReceivePulsarCatalogEventsOptions(pulsarCatalogEvents) - receivePulsarCatalogEventsOptionsModel.SetPulsarCatalogEvents([]projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel}) - receivePulsarCatalogEventsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(receivePulsarCatalogEventsOptionsModel).ToNot(BeNil()) - Expect(receivePulsarCatalogEventsOptionsModel.PulsarCatalogEvents).To(Equal([]projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel})) - Expect(receivePulsarCatalogEventsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewReceivePulsarEventNotificationEventsOptions successfully`, func() { - // Construct an instance of the PulsarEventPrototypeCollection model - pulsarEventPrototypeCollectionModel := new(projectv1.PulsarEventPrototypeCollection) - Expect(pulsarEventPrototypeCollectionModel).ToNot(BeNil()) - pulsarEventPrototypeCollectionModel.EventType = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Timestamp = CreateMockDateTime("2019-01-01T12:00:00.000Z") - pulsarEventPrototypeCollectionModel.Publisher = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.AccountID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.Version = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.EventProperties = map[string]interface{}{"anyKey": "anyValue"} - pulsarEventPrototypeCollectionModel.EventID = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperty("foo", core.StringPtr("testString")) - Expect(pulsarEventPrototypeCollectionModel.EventType).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.Timestamp).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(pulsarEventPrototypeCollectionModel.Publisher).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.AccountID).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.EventProperties).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(pulsarEventPrototypeCollectionModel.EventID).To(Equal(core.StringPtr("testString"))) - Expect(pulsarEventPrototypeCollectionModel.GetProperties()).ToNot(BeEmpty()) - Expect(pulsarEventPrototypeCollectionModel.GetProperty("foo")).To(Equal(core.StringPtr("testString"))) - - pulsarEventPrototypeCollectionModel.SetProperties(nil) - Expect(pulsarEventPrototypeCollectionModel.GetProperties()).To(BeEmpty()) - - pulsarEventPrototypeCollectionModelExpectedMap := make(map[string]interface{}) - pulsarEventPrototypeCollectionModelExpectedMap["foo"] = core.StringPtr("testString") - pulsarEventPrototypeCollectionModel.SetProperties(pulsarEventPrototypeCollectionModelExpectedMap) - pulsarEventPrototypeCollectionModelActualMap := pulsarEventPrototypeCollectionModel.GetProperties() - Expect(pulsarEventPrototypeCollectionModelActualMap).To(Equal(pulsarEventPrototypeCollectionModelExpectedMap)) - - // Construct an instance of the ReceivePulsarEventNotificationEventsOptions model - pulsarEventNotificationEvents := []projectv1.PulsarEventPrototypeCollection{} - receivePulsarEventNotificationEventsOptionsModel := projectService.NewReceivePulsarEventNotificationEventsOptions(pulsarEventNotificationEvents) - receivePulsarEventNotificationEventsOptionsModel.SetPulsarEventNotificationEvents([]projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel}) - receivePulsarEventNotificationEventsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(receivePulsarEventNotificationEventsOptionsModel).ToNot(BeNil()) - Expect(receivePulsarEventNotificationEventsOptionsModel.PulsarEventNotificationEvents).To(Equal([]projectv1.PulsarEventPrototypeCollection{*pulsarEventPrototypeCollectionModel})) - Expect(receivePulsarEventNotificationEventsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewReplaceServiceInstanceOptions successfully`, func() { - // Construct an instance of the ReplaceServiceInstanceOptions model - instanceID := "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" - replaceServiceInstanceOptionsServiceID := "testString" - replaceServiceInstanceOptionsPlanID := "testString" - replaceServiceInstanceOptionsModel := projectService.NewReplaceServiceInstanceOptions(instanceID, replaceServiceInstanceOptionsServiceID, replaceServiceInstanceOptionsPlanID) - replaceServiceInstanceOptionsModel.SetInstanceID("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::") - replaceServiceInstanceOptionsModel.SetServiceID("testString") - replaceServiceInstanceOptionsModel.SetPlanID("testString") - replaceServiceInstanceOptionsModel.SetContext([]string{"testString"}) - replaceServiceInstanceOptionsModel.SetParameters(map[string]interface{}{"anyKey": "anyValue"}) - replaceServiceInstanceOptionsModel.SetPreviousValues([]string{"testString"}) - replaceServiceInstanceOptionsModel.SetXBrokerApiVersion("1.0") - replaceServiceInstanceOptionsModel.SetXBrokerApiOriginatingIdentity("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0=") - replaceServiceInstanceOptionsModel.SetAcceptsIncomplete(false) - replaceServiceInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(replaceServiceInstanceOptionsModel).ToNot(BeNil()) - Expect(replaceServiceInstanceOptionsModel.InstanceID).To(Equal(core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"))) - Expect(replaceServiceInstanceOptionsModel.ServiceID).To(Equal(core.StringPtr("testString"))) - Expect(replaceServiceInstanceOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) - Expect(replaceServiceInstanceOptionsModel.Context).To(Equal([]string{"testString"})) - Expect(replaceServiceInstanceOptionsModel.Parameters).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(replaceServiceInstanceOptionsModel.PreviousValues).To(Equal([]string{"testString"})) - Expect(replaceServiceInstanceOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(replaceServiceInstanceOptionsModel.XBrokerApiOriginatingIdentity).To(Equal(core.StringPtr("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0="))) - Expect(replaceServiceInstanceOptionsModel.AcceptsIncomplete).To(Equal(core.BoolPtr(false))) - Expect(replaceServiceInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewReplaceServiceInstanceStateOptions successfully`, func() { - // Construct an instance of the ReplaceServiceInstanceStateOptions model - instanceID := "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" - replaceServiceInstanceStateOptionsEnabled := true - replaceServiceInstanceStateOptionsModel := projectService.NewReplaceServiceInstanceStateOptions(instanceID, replaceServiceInstanceStateOptionsEnabled) - replaceServiceInstanceStateOptionsModel.SetInstanceID("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::") - replaceServiceInstanceStateOptionsModel.SetEnabled(true) - replaceServiceInstanceStateOptionsModel.SetInitiatorID("testString") - replaceServiceInstanceStateOptionsModel.SetReasonCode(map[string]interface{}{"anyKey": "anyValue"}) - replaceServiceInstanceStateOptionsModel.SetPlanID("testString") - replaceServiceInstanceStateOptionsModel.SetPreviousValues([]string{"testString"}) - replaceServiceInstanceStateOptionsModel.SetXBrokerApiVersion("1.0") - replaceServiceInstanceStateOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(replaceServiceInstanceStateOptionsModel).ToNot(BeNil()) - Expect(replaceServiceInstanceStateOptionsModel.InstanceID).To(Equal(core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"))) - Expect(replaceServiceInstanceStateOptionsModel.Enabled).To(Equal(core.BoolPtr(true))) - Expect(replaceServiceInstanceStateOptionsModel.InitiatorID).To(Equal(core.StringPtr("testString"))) - Expect(replaceServiceInstanceStateOptionsModel.ReasonCode).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(replaceServiceInstanceStateOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) - Expect(replaceServiceInstanceStateOptionsModel.PreviousValues).To(Equal([]string{"testString"})) - Expect(replaceServiceInstanceStateOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(replaceServiceInstanceStateOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewResourceUpdateResultPatch successfully`, func() { - // Construct an instance of the ResourceUpdateResult model - resourceUpdateResult := new(projectv1.ResourceUpdateResult) - resourceUpdateResult.SetProperty("foo", core.StringPtr("testString")) - - resourceUpdateResultPatch := projectService.NewResourceUpdateResultPatch(resourceUpdateResult) - Expect(resourceUpdateResultPatch).ToNot(BeNil()) - - _path := func(op interface{}) string { - return *op.(projectv1.JSONPatchOperation).Path - } - Expect(resourceUpdateResultPatch).To(MatchAllElements(_path, Elements{ - "/foo": MatchAllFields(Fields{ - "Op": PointTo(Equal(projectv1.JSONPatchOperation_Op_Add)), - "Path": PointTo(Equal("/foo")), - "From": BeNil(), - "Value": Equal(resourceUpdateResult.GetProperty("foo")), - }), - })) - }) It(`Invoke NewUninstallConfigOptions successfully`, func() { // Construct an instance of the UninstallConfigOptions model + projectID := "testString" id := "testString" - configID := "testString" - uninstallConfigOptionsModel := projectService.NewUninstallConfigOptions(id, configID) + uninstallConfigOptionsModel := projectService.NewUninstallConfigOptions(projectID, id) + uninstallConfigOptionsModel.SetProjectID("testString") uninstallConfigOptionsModel.SetID("testString") - uninstallConfigOptionsModel.SetConfigID("testString") uninstallConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(uninstallConfigOptionsModel).ToNot(BeNil()) + Expect(uninstallConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(uninstallConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(uninstallConfigOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(uninstallConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewUpdateConfigOptions successfully`, func() { @@ -7513,18 +7209,18 @@ var _ = Describe(`ProjectV1`, func() { Expect(jsonPatchOperationModel.Value).To(Equal(core.StringPtr("testString"))) // Construct an instance of the UpdateConfigOptions model + projectID := "testString" id := "testString" - configID := "testString" projectConfig := []projectv1.JSONPatchOperation{} - updateConfigOptionsModel := projectService.NewUpdateConfigOptions(id, configID, projectConfig) + updateConfigOptionsModel := projectService.NewUpdateConfigOptions(projectID, id, projectConfig) + updateConfigOptionsModel.SetProjectID("testString") updateConfigOptionsModel.SetID("testString") - updateConfigOptionsModel.SetConfigID("testString") updateConfigOptionsModel.SetProjectConfig([]projectv1.JSONPatchOperation{*jsonPatchOperationModel}) updateConfigOptionsModel.SetComplete(false) updateConfigOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(updateConfigOptionsModel).ToNot(BeNil()) + Expect(updateConfigOptionsModel.ProjectID).To(Equal(core.StringPtr("testString"))) Expect(updateConfigOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(updateConfigOptionsModel.ConfigID).To(Equal(core.StringPtr("testString"))) Expect(updateConfigOptionsModel.ProjectConfig).To(Equal([]projectv1.JSONPatchOperation{*jsonPatchOperationModel})) Expect(updateConfigOptionsModel.Complete).To(Equal(core.BoolPtr(false))) Expect(updateConfigOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) @@ -7554,37 +7250,6 @@ var _ = Describe(`ProjectV1`, func() { Expect(updateProjectOptionsModel.JSONPatchOperation).To(Equal([]projectv1.JSONPatchOperation{*jsonPatchOperationModel})) Expect(updateProjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewUpdateServiceInstanceOptions successfully`, func() { - // Construct an instance of the JSONPatchOperation model - jsonPatchOperationModel := new(projectv1.JSONPatchOperation) - Expect(jsonPatchOperationModel).ToNot(BeNil()) - jsonPatchOperationModel.Op = core.StringPtr("add") - jsonPatchOperationModel.Path = core.StringPtr("testString") - jsonPatchOperationModel.From = core.StringPtr("testString") - jsonPatchOperationModel.Value = core.StringPtr("testString") - Expect(jsonPatchOperationModel.Op).To(Equal(core.StringPtr("add"))) - Expect(jsonPatchOperationModel.Path).To(Equal(core.StringPtr("testString"))) - Expect(jsonPatchOperationModel.From).To(Equal(core.StringPtr("testString"))) - Expect(jsonPatchOperationModel.Value).To(Equal(core.StringPtr("testString"))) - - // Construct an instance of the UpdateServiceInstanceOptions model - instanceID := "crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::" - jsonPatchOperation := []projectv1.JSONPatchOperation{} - updateServiceInstanceOptionsModel := projectService.NewUpdateServiceInstanceOptions(instanceID, jsonPatchOperation) - updateServiceInstanceOptionsModel.SetInstanceID("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::") - updateServiceInstanceOptionsModel.SetJSONPatchOperation([]projectv1.JSONPatchOperation{*jsonPatchOperationModel}) - updateServiceInstanceOptionsModel.SetXBrokerApiVersion("1.0") - updateServiceInstanceOptionsModel.SetXBrokerApiOriginatingIdentity("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0=") - updateServiceInstanceOptionsModel.SetAcceptsIncomplete(false) - updateServiceInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(updateServiceInstanceOptionsModel).ToNot(BeNil()) - Expect(updateServiceInstanceOptionsModel.InstanceID).To(Equal(core.StringPtr("crn:v1:staging:public:project:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"))) - Expect(updateServiceInstanceOptionsModel.JSONPatchOperation).To(Equal([]projectv1.JSONPatchOperation{*jsonPatchOperationModel})) - Expect(updateServiceInstanceOptionsModel.XBrokerApiVersion).To(Equal(core.StringPtr("1.0"))) - Expect(updateServiceInstanceOptionsModel.XBrokerApiOriginatingIdentity).To(Equal(core.StringPtr("ibmcloud eyJpYW1fbWQiOiJJQk2pZC03MEdOUjcxN2lFIn0="))) - Expect(updateServiceInstanceOptionsModel.AcceptsIncomplete).To(Equal(core.BoolPtr(false))) - Expect(updateServiceInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) }) }) Describe(`Utility function tests`, func() {