diff --git a/catalogmanagementv1/catalog_management_v1.go b/catalogmanagementv1/catalog_management_v1.go index aa369ff1..d7cab44f 100644 --- a/catalogmanagementv1/catalog_management_v1.go +++ b/catalogmanagementv1/catalog_management_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.90.1-64fd3296-20240515-180710 + * IBM OpenAPI SDK Code Generator Version: 3.94.1-71478489-20240820-161623 */ // Package catalogmanagementv1 : Operations and models for the CatalogManagementV1 service @@ -283,6 +283,15 @@ func (catalogManagement *CatalogManagementV1) UpdateCatalogAccountWithContext(ct if updateCatalogAccountOptions.AccountFilters != nil { body["account_filters"] = updateCatalogAccountOptions.AccountFilters } + if updateCatalogAccountOptions.RegionFilters != nil { + body["region_filters"] = updateCatalogAccountOptions.RegionFilters + } + if updateCatalogAccountOptions.FilteredRegions != nil { + body["filtered_regions"] = updateCatalogAccountOptions.FilteredRegions + } + if updateCatalogAccountOptions.FilterRegions != nil { + body["filter_regions"] = updateCatalogAccountOptions.FilterRegions + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -2096,6 +2105,9 @@ func (catalogManagement *CatalogManagementV1) ImportOfferingVersionWithContext(c if importOfferingVersionOptions.Tags != nil { body["tags"] = importOfferingVersionOptions.Tags } + if importOfferingVersionOptions.Keywords != nil { + body["keywords"] = importOfferingVersionOptions.Keywords + } if importOfferingVersionOptions.Content != nil { body["content"] = importOfferingVersionOptions.Content } @@ -2240,6 +2252,9 @@ func (catalogManagement *CatalogManagementV1) ImportOfferingWithContext(ctx cont if importOfferingOptions.Tags != nil { body["tags"] = importOfferingOptions.Tags } + if importOfferingOptions.Keywords != nil { + body["keywords"] = importOfferingOptions.Keywords + } if importOfferingOptions.Content != nil { body["content"] = importOfferingOptions.Content } @@ -2386,6 +2401,9 @@ func (catalogManagement *CatalogManagementV1) ReloadOfferingWithContext(ctx cont if reloadOfferingOptions.WorkingDirectory != nil { body["working_directory"] = reloadOfferingOptions.WorkingDirectory } + if reloadOfferingOptions.InstallType != nil { + body["install_type"] = reloadOfferingOptions.InstallType + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -4069,6 +4087,91 @@ func (catalogManagement *CatalogManagementV1) GetOfferingSourceURLWithContext(ct return } +// GetVersions : Get versions +// Get the versions of the specified kind in the specified offering. This can be used by an unauthenticated user for +// publicly available offerings. +func (catalogManagement *CatalogManagementV1) GetVersions(getVersionsOptions *GetVersionsOptions) (result *VersionsResult, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.GetVersionsWithContext(context.Background(), getVersionsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetVersionsWithContext is an alternate form of the GetVersions method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) GetVersionsWithContext(ctx context.Context, getVersionsOptions *GetVersionsOptions) (result *VersionsResult, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVersionsOptions, "getVersionsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getVersionsOptions, "getVersionsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "catalog_identifier": *getVersionsOptions.CatalogIdentifier, + "offering_id": *getVersionsOptions.OfferingID, + "kind_id": *getVersionsOptions.KindID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/catalogs/{catalog_identifier}/offerings/{offering_id}/kinds/{kind_id}/versions`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range getVersionsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "GetVersions") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if getVersionsOptions.Digest != nil { + builder.AddQuery("digest", fmt.Sprint(*getVersionsOptions.Digest)) + } + if getVersionsOptions.Catalog != nil { + builder.AddQuery("catalog", fmt.Sprint(*getVersionsOptions.Catalog)) + } + if getVersionsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*getVersionsOptions.Start)) + } + if getVersionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*getVersionsOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_versions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVersionsResult) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + // GetOfferingAbout : Get version about information // Get the about information, in markdown, for the current version. func (catalogManagement *CatalogManagementV1) GetOfferingAbout(getOfferingAboutOptions *GetOfferingAboutOptions) (result *string, response *core.DetailedResponse, err error) { @@ -4761,6 +4864,9 @@ func (catalogManagement *CatalogManagementV1) CopyVersionWithContext(ctx context if copyVersionOptions.WorkingDirectory != nil { body["working_directory"] = copyVersionOptions.WorkingDirectory } + if copyVersionOptions.InstallType != nil { + body["install_type"] = copyVersionOptions.InstallType + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -4913,49 +5019,63 @@ func (catalogManagement *CatalogManagementV1) CopyFromPreviousVersionWithContext return } -// GetVersion : Get offering/kind/version 'branch' -// Get the Offering/Kind/Version 'branch' for the specified locator ID. -func (catalogManagement *CatalogManagementV1) GetVersion(getVersionOptions *GetVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { - result, response, err = catalogManagement.GetVersionWithContext(context.Background(), getVersionOptions) +// ValidateInputs : Validates deployment input variables +// Validates deployment input variables. +func (catalogManagement *CatalogManagementV1) ValidateInputs(validateInputsOptions *ValidateInputsOptions) (result *VersionInputValidationResponse, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.ValidateInputsWithContext(context.Background(), validateInputsOptions) err = core.RepurposeSDKProblem(err, "") return } -// GetVersionWithContext is an alternate form of the GetVersion method which supports a Context parameter -func (catalogManagement *CatalogManagementV1) GetVersionWithContext(ctx context.Context, getVersionOptions *GetVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getVersionOptions, "getVersionOptions cannot be nil") +// ValidateInputsWithContext is an alternate form of the ValidateInputs method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) ValidateInputsWithContext(ctx context.Context, validateInputsOptions *ValidateInputsOptions) (result *VersionInputValidationResponse, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(validateInputsOptions, "validateInputsOptions cannot be nil") if err != nil { err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.ValidateStruct(getVersionOptions, "getVersionOptions") + err = core.ValidateStruct(validateInputsOptions, "validateInputsOptions") if err != nil { err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ - "version_loc_id": *getVersionOptions.VersionLocID, + "version_loc_id": *validateInputsOptions.VersionLocID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}/validateInputs`, pathParamsMap) if err != nil { err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getVersionOptions.Headers { + for headerName, headerValue := range validateInputsOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "GetVersion") + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "ValidateInputs") 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 validateInputsOptions.Input1 != nil { + body["input1"] = validateInputsOptions.Input1 + } + if validateInputsOptions.Input2 != nil { + body["input2"] = validateInputsOptions.Input2 + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } request, err := builder.Build() if err != nil { @@ -4966,12 +5086,12 @@ func (catalogManagement *CatalogManagementV1) GetVersionWithContext(ctx context. var rawResponse map[string]json.RawMessage response, err = catalogManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_version", getServiceComponentInfo()) + core.EnrichHTTPProblem(err, "validate_inputs", getServiceComponentInfo()) err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOffering) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVersionInputValidationResponse) if err != nil { err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return @@ -4982,33 +5102,32 @@ func (catalogManagement *CatalogManagementV1) GetVersionWithContext(ctx context. return } -// DeleteVersion : Delete version -// Delete the specified version. If the version is an active version with a working copy, the working copy will be -// deleted as well. -func (catalogManagement *CatalogManagementV1) DeleteVersion(deleteVersionOptions *DeleteVersionOptions) (response *core.DetailedResponse, err error) { - response, err = catalogManagement.DeleteVersionWithContext(context.Background(), deleteVersionOptions) +// GetVersion : Get offering/kind/version 'branch' +// Get the Offering/Kind/Version 'branch' for the specified locator ID. +func (catalogManagement *CatalogManagementV1) GetVersion(getVersionOptions *GetVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.GetVersionWithContext(context.Background(), getVersionOptions) err = core.RepurposeSDKProblem(err, "") return } -// DeleteVersionWithContext is an alternate form of the DeleteVersion method which supports a Context parameter -func (catalogManagement *CatalogManagementV1) DeleteVersionWithContext(ctx context.Context, deleteVersionOptions *DeleteVersionOptions) (response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(deleteVersionOptions, "deleteVersionOptions cannot be nil") +// GetVersionWithContext is an alternate form of the GetVersion method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) GetVersionWithContext(ctx context.Context, getVersionOptions *GetVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVersionOptions, "getVersionOptions cannot be nil") if err != nil { err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.ValidateStruct(deleteVersionOptions, "deleteVersionOptions") + err = core.ValidateStruct(getVersionOptions, "getVersionOptions") if err != nil { err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ - "version_loc_id": *deleteVersionOptions.VersionLocID, + "version_loc_id": *getVersionOptions.VersionLocID, } - builder := core.NewRequestBuilder(core.DELETE) + builder := core.NewRequestBuilder(core.GET) builder = builder.WithContext(ctx) builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}`, pathParamsMap) @@ -5017,14 +5136,15 @@ func (catalogManagement *CatalogManagementV1) DeleteVersionWithContext(ctx conte return } - for headerName, headerValue := range deleteVersionOptions.Headers { + for headerName, headerValue := range getVersionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "DeleteVersion") + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "GetVersion") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } + builder.AddHeader("Accept", "application/json") request, err := builder.Build() if err != nil { @@ -5032,61 +5152,215 @@ func (catalogManagement *CatalogManagementV1) DeleteVersionWithContext(ctx conte return } - response, err = catalogManagement.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "delete_version", getServiceComponentInfo()) + core.EnrichHTTPProblem(err, "get_version", getServiceComponentInfo()) err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOffering) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } return } -// DeprecateVersion : Deprecate version immediately - use /archive instead -// Deprecate the specified version. -// Deprecated: this method is deprecated and may be removed in a future release. -func (catalogManagement *CatalogManagementV1) DeprecateVersion(deprecateVersionOptions *DeprecateVersionOptions) (response *core.DetailedResponse, err error) { - response, err = catalogManagement.DeprecateVersionWithContext(context.Background(), deprecateVersionOptions) +// UpdateVersion : Update a version +// Update the version for the specified locator ID using an offering 'branch'. Note that any changes to the Offering +// and Kind in the provided Offering 'branch' are discarded. +func (catalogManagement *CatalogManagementV1) UpdateVersion(updateVersionOptions *UpdateVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.UpdateVersionWithContext(context.Background(), updateVersionOptions) err = core.RepurposeSDKProblem(err, "") return } -// DeprecateVersionWithContext is an alternate form of the DeprecateVersion method which supports a Context parameter -// Deprecated: this method is deprecated and may be removed in a future release. -func (catalogManagement *CatalogManagementV1) DeprecateVersionWithContext(ctx context.Context, deprecateVersionOptions *DeprecateVersionOptions) (response *core.DetailedResponse, err error) { - core.GetLogger().Warn("A deprecated operation has been invoked: DeprecateVersion") - err = core.ValidateNotNil(deprecateVersionOptions, "deprecateVersionOptions cannot be nil") +// UpdateVersionWithContext is an alternate form of the UpdateVersion method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) UpdateVersionWithContext(ctx context.Context, updateVersionOptions *UpdateVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateVersionOptions, "updateVersionOptions cannot be nil") if err != nil { err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.ValidateStruct(deprecateVersionOptions, "deprecateVersionOptions") + err = core.ValidateStruct(updateVersionOptions, "updateVersionOptions") if err != nil { err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ - "version_loc_id": *deprecateVersionOptions.VersionLocID, + "version_loc_id": *updateVersionOptions.VersionLocID, } - builder := core.NewRequestBuilder(core.POST) + builder := core.NewRequestBuilder(core.PUT) builder = builder.WithContext(ctx) builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}/deprecate`, pathParamsMap) + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}`, pathParamsMap) if err != nil { err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deprecateVersionOptions.Headers { + for headerName, headerValue := range updateVersionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "DeprecateVersion") + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "UpdateVersion") 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 updateVersionOptions.ID != nil { + body["id"] = updateVersionOptions.ID + } + if updateVersionOptions.Rev != nil { + body["_rev"] = updateVersionOptions.Rev + } + if updateVersionOptions.URL != nil { + body["url"] = updateVersionOptions.URL + } + if updateVersionOptions.CRN != nil { + body["crn"] = updateVersionOptions.CRN + } + if updateVersionOptions.Label != nil { + body["label"] = updateVersionOptions.Label + } + if updateVersionOptions.LabelI18n != nil { + body["label_i18n"] = updateVersionOptions.LabelI18n + } + if updateVersionOptions.Name != nil { + body["name"] = updateVersionOptions.Name + } + if updateVersionOptions.OfferingIconURL != nil { + body["offering_icon_url"] = updateVersionOptions.OfferingIconURL + } + if updateVersionOptions.OfferingDocsURL != nil { + body["offering_docs_url"] = updateVersionOptions.OfferingDocsURL + } + if updateVersionOptions.OfferingSupportURL != nil { + body["offering_support_url"] = updateVersionOptions.OfferingSupportURL + } + if updateVersionOptions.Tags != nil { + body["tags"] = updateVersionOptions.Tags + } + if updateVersionOptions.Keywords != nil { + body["keywords"] = updateVersionOptions.Keywords + } + if updateVersionOptions.Rating != nil { + body["rating"] = updateVersionOptions.Rating + } + if updateVersionOptions.Created != nil { + body["created"] = updateVersionOptions.Created + } + if updateVersionOptions.Updated != nil { + body["updated"] = updateVersionOptions.Updated + } + if updateVersionOptions.ShortDescription != nil { + body["short_description"] = updateVersionOptions.ShortDescription + } + if updateVersionOptions.ShortDescriptionI18n != nil { + body["short_description_i18n"] = updateVersionOptions.ShortDescriptionI18n + } + if updateVersionOptions.LongDescription != nil { + body["long_description"] = updateVersionOptions.LongDescription + } + if updateVersionOptions.LongDescriptionI18n != nil { + body["long_description_i18n"] = updateVersionOptions.LongDescriptionI18n + } + if updateVersionOptions.Features != nil { + body["features"] = updateVersionOptions.Features + } + if updateVersionOptions.Kinds != nil { + body["kinds"] = updateVersionOptions.Kinds + } + if updateVersionOptions.Publish != nil { + body["publish"] = updateVersionOptions.Publish + } + if updateVersionOptions.PcManaged != nil { + body["pc_managed"] = updateVersionOptions.PcManaged + } + if updateVersionOptions.PublishApproved != nil { + body["publish_approved"] = updateVersionOptions.PublishApproved + } + if updateVersionOptions.ShareWithAll != nil { + body["share_with_all"] = updateVersionOptions.ShareWithAll + } + if updateVersionOptions.ShareWithIBM != nil { + body["share_with_ibm"] = updateVersionOptions.ShareWithIBM + } + if updateVersionOptions.ShareEnabled != nil { + body["share_enabled"] = updateVersionOptions.ShareEnabled + } + if updateVersionOptions.PublicOriginalCRN != nil { + body["public_original_crn"] = updateVersionOptions.PublicOriginalCRN + } + if updateVersionOptions.PublishPublicCRN != nil { + body["publish_public_crn"] = updateVersionOptions.PublishPublicCRN + } + if updateVersionOptions.PortalApprovalRecord != nil { + body["portal_approval_record"] = updateVersionOptions.PortalApprovalRecord + } + if updateVersionOptions.PortalUIURL != nil { + body["portal_ui_url"] = updateVersionOptions.PortalUIURL + } + if updateVersionOptions.CatalogID != nil { + body["catalog_id"] = updateVersionOptions.CatalogID + } + if updateVersionOptions.CatalogName != nil { + body["catalog_name"] = updateVersionOptions.CatalogName + } + if updateVersionOptions.Metadata != nil { + body["metadata"] = updateVersionOptions.Metadata + } + if updateVersionOptions.Disclaimer != nil { + body["disclaimer"] = updateVersionOptions.Disclaimer + } + if updateVersionOptions.Hidden != nil { + body["hidden"] = updateVersionOptions.Hidden + } + if updateVersionOptions.Provider != nil { + body["provider"] = updateVersionOptions.Provider + } + if updateVersionOptions.ProviderInfo != nil { + body["provider_info"] = updateVersionOptions.ProviderInfo + } + if updateVersionOptions.RepoInfo != nil { + body["repo_info"] = updateVersionOptions.RepoInfo + } + if updateVersionOptions.ImagePullKeys != nil { + body["image_pull_keys"] = updateVersionOptions.ImagePullKeys + } + if updateVersionOptions.Support != nil { + body["support"] = updateVersionOptions.Support + } + if updateVersionOptions.Media != nil { + body["media"] = updateVersionOptions.Media + } + if updateVersionOptions.DeprecatePending != nil { + body["deprecate_pending"] = updateVersionOptions.DeprecatePending + } + if updateVersionOptions.ProductKind != nil { + body["product_kind"] = updateVersionOptions.ProductKind + } + if updateVersionOptions.Badges != nil { + body["badges"] = updateVersionOptions.Badges + } + if updateVersionOptions.Plans != nil { + body["plans"] = updateVersionOptions.Plans + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } request, err := builder.Build() if err != nil { @@ -5094,64 +5368,79 @@ func (catalogManagement *CatalogManagementV1) DeprecateVersionWithContext(ctx co return } - response, err = catalogManagement.Service.Request(request, nil) + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "deprecate_version", getServiceComponentInfo()) + core.EnrichHTTPProblem(err, "update_version", getServiceComponentInfo()) err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOffering) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } return } -// GetCluster : Get kubernetes cluster -// Get the contents of the specified kubernetes cluster. -func (catalogManagement *CatalogManagementV1) GetCluster(getClusterOptions *GetClusterOptions) (result *ClusterInfo, response *core.DetailedResponse, err error) { - result, response, err = catalogManagement.GetClusterWithContext(context.Background(), getClusterOptions) +// PatchUpdateVersion : Update a version +// Update a version using a JSONPatch document as defined by RFC 6902. Note that the path must always reference +// '/kinds/0/versions/0/...'. +func (catalogManagement *CatalogManagementV1) PatchUpdateVersion(patchUpdateVersionOptions *PatchUpdateVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.PatchUpdateVersionWithContext(context.Background(), patchUpdateVersionOptions) err = core.RepurposeSDKProblem(err, "") return } -// GetClusterWithContext is an alternate form of the GetCluster method which supports a Context parameter -func (catalogManagement *CatalogManagementV1) GetClusterWithContext(ctx context.Context, getClusterOptions *GetClusterOptions) (result *ClusterInfo, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getClusterOptions, "getClusterOptions cannot be nil") +// PatchUpdateVersionWithContext is an alternate form of the PatchUpdateVersion method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) PatchUpdateVersionWithContext(ctx context.Context, patchUpdateVersionOptions *PatchUpdateVersionOptions) (result *Offering, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(patchUpdateVersionOptions, "patchUpdateVersionOptions cannot be nil") if err != nil { err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.ValidateStruct(getClusterOptions, "getClusterOptions") + err = core.ValidateStruct(patchUpdateVersionOptions, "patchUpdateVersionOptions") if err != nil { err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } pathParamsMap := map[string]string{ - "cluster_id": *getClusterOptions.ClusterID, + "version_loc_id": *patchUpdateVersionOptions.VersionLocID, } - builder := core.NewRequestBuilder(core.GET) + builder := core.NewRequestBuilder(core.PATCH) builder = builder.WithContext(ctx) builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/deploy/kubernetes/clusters/{cluster_id}`, pathParamsMap) + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}`, pathParamsMap) if err != nil { err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getClusterOptions.Headers { + for headerName, headerValue := range patchUpdateVersionOptions.Headers { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "GetCluster") + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "PatchUpdateVersion") for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") - if getClusterOptions.XAuthRefreshToken != nil { - builder.AddHeader("X-Auth-Refresh-Token", fmt.Sprint(*getClusterOptions.XAuthRefreshToken)) + builder.AddHeader("Content-Type", "application/json-patch+json") + if patchUpdateVersionOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*patchUpdateVersionOptions.IfMatch)) } - builder.AddQuery("region", fmt.Sprint(*getClusterOptions.Region)) + _, err = builder.SetBodyContentJSON(patchUpdateVersionOptions.Updates) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } request, err := builder.Build() if err != nil { @@ -5162,12 +5451,12 @@ func (catalogManagement *CatalogManagementV1) GetClusterWithContext(ctx context. var rawResponse map[string]json.RawMessage response, err = catalogManagement.Service.Request(request, &rawResponse) if err != nil { - core.EnrichHTTPProblem(err, "get_cluster", getServiceComponentInfo()) + core.EnrichHTTPProblem(err, "patch_update_version", getServiceComponentInfo()) err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalClusterInfo) + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalOffering) if err != nil { err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return @@ -5178,18 +5467,283 @@ func (catalogManagement *CatalogManagementV1) GetClusterWithContext(ctx context. return } -// GetNamespaces : Get cluster namespaces -// Get the namespaces associated with the specified kubernetes cluster. -func (catalogManagement *CatalogManagementV1) GetNamespaces(getNamespacesOptions *GetNamespacesOptions) (result *NamespaceSearchResult, response *core.DetailedResponse, err error) { - result, response, err = catalogManagement.GetNamespacesWithContext(context.Background(), getNamespacesOptions) +// DeleteVersion : Delete version +// Delete the specified version. If the version is an active version with a working copy, the working copy will be +// deleted as well. +func (catalogManagement *CatalogManagementV1) DeleteVersion(deleteVersionOptions *DeleteVersionOptions) (response *core.DetailedResponse, err error) { + response, err = catalogManagement.DeleteVersionWithContext(context.Background(), deleteVersionOptions) err = core.RepurposeSDKProblem(err, "") return } -// GetNamespacesWithContext is an alternate form of the GetNamespaces method which supports a Context parameter -func (catalogManagement *CatalogManagementV1) GetNamespacesWithContext(ctx context.Context, getNamespacesOptions *GetNamespacesOptions) (result *NamespaceSearchResult, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(getNamespacesOptions, "getNamespacesOptions cannot be nil") - if err != nil { +// DeleteVersionWithContext is an alternate form of the DeleteVersion method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) DeleteVersionWithContext(ctx context.Context, deleteVersionOptions *DeleteVersionOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteVersionOptions, "deleteVersionOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteVersionOptions, "deleteVersionOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "version_loc_id": *deleteVersionOptions.VersionLocID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range deleteVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "DeleteVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = catalogManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// GetVersionDependencies : Get offering/kind/version 'dependencies' +// Get the latest version of all offerings/variations that depends on this version locator. +func (catalogManagement *CatalogManagementV1) GetVersionDependencies(getVersionDependenciesOptions *GetVersionDependenciesOptions) (result *VersionDependant, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.GetVersionDependenciesWithContext(context.Background(), getVersionDependenciesOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetVersionDependenciesWithContext is an alternate form of the GetVersionDependencies method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) GetVersionDependenciesWithContext(ctx context.Context, getVersionDependenciesOptions *GetVersionDependenciesOptions) (result *VersionDependant, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVersionDependenciesOptions, "getVersionDependenciesOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getVersionDependenciesOptions, "getVersionDependenciesOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "version_loc_id": *getVersionDependenciesOptions.VersionLocID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}/dependencies`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range getVersionDependenciesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "GetVersionDependencies") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_version_dependencies", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVersionDependant) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// DeprecateVersion : Deprecate version immediately - use /archive instead +// Deprecate the specified version. +// Deprecated: this method is deprecated and may be removed in a future release. +func (catalogManagement *CatalogManagementV1) DeprecateVersion(deprecateVersionOptions *DeprecateVersionOptions) (response *core.DetailedResponse, err error) { + response, err = catalogManagement.DeprecateVersionWithContext(context.Background(), deprecateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// DeprecateVersionWithContext is an alternate form of the DeprecateVersion method which supports a Context parameter +// Deprecated: this method is deprecated and may be removed in a future release. +func (catalogManagement *CatalogManagementV1) DeprecateVersionWithContext(ctx context.Context, deprecateVersionOptions *DeprecateVersionOptions) (response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: DeprecateVersion") + err = core.ValidateNotNil(deprecateVersionOptions, "deprecateVersionOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deprecateVersionOptions, "deprecateVersionOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "version_loc_id": *deprecateVersionOptions.VersionLocID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/versions/{version_loc_id}/deprecate`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range deprecateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "DeprecateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = catalogManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "deprecate_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// GetCluster : Get kubernetes cluster +// Get the contents of the specified kubernetes cluster. +func (catalogManagement *CatalogManagementV1) GetCluster(getClusterOptions *GetClusterOptions) (result *ClusterInfo, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.GetClusterWithContext(context.Background(), getClusterOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetClusterWithContext is an alternate form of the GetCluster method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) GetClusterWithContext(ctx context.Context, getClusterOptions *GetClusterOptions) (result *ClusterInfo, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getClusterOptions, "getClusterOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getClusterOptions, "getClusterOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "cluster_id": *getClusterOptions.ClusterID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/deploy/kubernetes/clusters/{cluster_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range getClusterOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "GetCluster") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if getClusterOptions.XAuthRefreshToken != nil { + builder.AddHeader("X-Auth-Refresh-Token", fmt.Sprint(*getClusterOptions.XAuthRefreshToken)) + } + + builder.AddQuery("region", fmt.Sprint(*getClusterOptions.Region)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_cluster", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalClusterInfo) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// GetNamespaces : Get cluster namespaces +// Get the namespaces associated with the specified kubernetes cluster. +func (catalogManagement *CatalogManagementV1) GetNamespaces(getNamespacesOptions *GetNamespacesOptions) (result *NamespaceSearchResult, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.GetNamespacesWithContext(context.Background(), getNamespacesOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetNamespacesWithContext is an alternate form of the GetNamespaces method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) GetNamespacesWithContext(ctx context.Context, getNamespacesOptions *GetNamespacesOptions) (result *NamespaceSearchResult, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getNamespacesOptions, "getNamespacesOptions cannot be nil") + if err != nil { err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } @@ -5652,6 +6206,9 @@ func (catalogManagement *CatalogManagementV1) InstallVersionWithContext(ctx cont if installVersionOptions.OverrideValues != nil { body["override_values"] = installVersionOptions.OverrideValues } + if installVersionOptions.DependencyConfigs != nil { + body["dependency_configs"] = installVersionOptions.DependencyConfigs + } if installVersionOptions.EnvironmentVariables != nil { body["environment_variables"] = installVersionOptions.EnvironmentVariables } @@ -5782,6 +6339,9 @@ func (catalogManagement *CatalogManagementV1) PreinstallVersionWithContext(ctx c if preinstallVersionOptions.OverrideValues != nil { body["override_values"] = preinstallVersionOptions.OverrideValues } + if preinstallVersionOptions.DependencyConfigs != nil { + body["dependency_configs"] = preinstallVersionOptions.DependencyConfigs + } if preinstallVersionOptions.EnvironmentVariables != nil { body["environment_variables"] = preinstallVersionOptions.EnvironmentVariables } @@ -5998,6 +6558,9 @@ func (catalogManagement *CatalogManagementV1) ValidateInstallWithContext(ctx con if validateInstallOptions.OverrideValues != nil { body["override_values"] = validateInstallOptions.OverrideValues } + if validateInstallOptions.DependencyConfigs != nil { + body["dependency_configs"] = validateInstallOptions.DependencyConfigs + } if validateInstallOptions.EnvironmentVariables != nil { body["environment_variables"] = validateInstallOptions.EnvironmentVariables } @@ -8394,6 +8957,152 @@ func (catalogManagement *CatalogManagementV1) SetDeprecatePlanWithContext(ctx co return } + +// PreviewRegions : Returns available locations based on supplied filter +// Returns available locations based on supplied filter. +func (catalogManagement *CatalogManagementV1) PreviewRegions(previewRegionsOptions *PreviewRegionsOptions) (result *RegionsSearchResult, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.PreviewRegionsWithContext(context.Background(), previewRegionsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// PreviewRegionsWithContext is an alternate form of the PreviewRegions method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) PreviewRegionsWithContext(ctx context.Context, previewRegionsOptions *PreviewRegionsOptions) (result *RegionsSearchResult, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(previewRegionsOptions, "previewRegionsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/regions`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range previewRegionsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "PreviewRegions") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if previewRegionsOptions.Filter != nil { + builder.AddQuery("filter", fmt.Sprint(*previewRegionsOptions.Filter)) + } + if previewRegionsOptions.GetInactive != nil { + builder.AddQuery("get_inactive", fmt.Sprint(*previewRegionsOptions.GetInactive)) + } + if previewRegionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*previewRegionsOptions.Limit)) + } + if previewRegionsOptions.Offset != nil { + builder.AddQuery("offset", fmt.Sprint(*previewRegionsOptions.Offset)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "preview_regions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionsSearchResult) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// ListRegions : Returns available locations based on filter set on the account and supplied filter +// Returns available locations based on filter set on the account and supplied filter. +func (catalogManagement *CatalogManagementV1) ListRegions(listRegionsOptions *ListRegionsOptions) (result *RegionsSearchResult, response *core.DetailedResponse, err error) { + result, response, err = catalogManagement.ListRegionsWithContext(context.Background(), listRegionsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListRegionsWithContext is an alternate form of the ListRegions method which supports a Context parameter +func (catalogManagement *CatalogManagementV1) ListRegionsWithContext(ctx context.Context, listRegionsOptions *ListRegionsOptions) (result *RegionsSearchResult, response *core.DetailedResponse, err error) { + err = core.ValidateStruct(listRegionsOptions, "listRegionsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/regions`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + for headerName, headerValue := range listRegionsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + sdkHeaders := common.GetSdkHeaders("catalog_management", "V1", "ListRegions") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if listRegionsOptions.Filter != nil { + builder.AddQuery("filter", fmt.Sprint(*listRegionsOptions.Filter)) + } + if listRegionsOptions.GetInactive != nil { + builder.AddQuery("get_inactive", fmt.Sprint(*listRegionsOptions.GetInactive)) + } + if listRegionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRegionsOptions.Limit)) + } + if listRegionsOptions.Offset != nil { + builder.AddQuery("offset", fmt.Sprint(*listRegionsOptions.Offset)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = catalogManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_regions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRegionsSearchResult) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} func getServiceComponentInfo() *core.ProblemComponent { return core.NewProblemComponent(DefaultServiceName, "1.0") } @@ -8601,6 +9310,12 @@ type Account struct { // Filters for account and catalog filters. AccountFilters *Filters `json:"account_filters,omitempty"` + + RegionFilters []string `json:"region_filters,omitempty"` + + FilteredRegions []string `json:"filtered_regions,omitempty"` + + FilterRegions *bool `json:"filter_regions,omitempty"` } // UnmarshalAccount unmarshals an instance of Account from the specified map of raw messages. @@ -8626,6 +9341,21 @@ func UnmarshalAccount(m map[string]json.RawMessage, result interface{}) (err err err = core.SDKErrorf(err, "", "account_filters-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "region_filters", &obj.RegionFilters) + if err != nil { + err = core.SDKErrorf(err, "", "region_filters-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "filtered_regions", &obj.FilteredRegions) + if err != nil { + err = core.SDKErrorf(err, "", "filtered_regions-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "filter_regions", &obj.FilterRegions) + if err != nil { + err = core.SDKErrorf(err, "", "filter_regions-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -8641,6 +9371,12 @@ type AccumulatedFilters struct { // The filters for all of the accessible catalogs. CatalogFilters []AccumulatedFiltersCatalogFiltersItem `json:"catalog_filters,omitempty"` + + RegionFilters []string `json:"region_filters,omitempty"` + + FilteredRegions []string `json:"filtered_regions,omitempty"` + + FilterRegions *bool `json:"filter_regions,omitempty"` } // UnmarshalAccumulatedFilters unmarshals an instance of AccumulatedFilters from the specified map of raw messages. @@ -8661,6 +9397,21 @@ func UnmarshalAccumulatedFilters(m map[string]json.RawMessage, result interface{ err = core.SDKErrorf(err, "", "catalog_filters-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "region_filters", &obj.RegionFilters) + if err != nil { + err = core.SDKErrorf(err, "", "region_filters-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "filtered_regions", &obj.FilteredRegions) + if err != nil { + err = core.SDKErrorf(err, "", "filtered_regions-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "filter_regions", &obj.FilterRegions) + if err != nil { + err = core.SDKErrorf(err, "", "filter_regions-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -8728,7 +9479,7 @@ type AddObjectAccessListOptions struct { // A list of accesses to add. Accesses []string `json:"accesses" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8776,7 +9527,7 @@ type AddOfferingAccessListOptions struct { // A list of accesses to add. Accesses []string `json:"accesses" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8821,7 +9572,7 @@ type AddShareApprovalListOptions struct { // A list of accesses to add. Accesses []string `json:"accesses" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -8976,7 +9727,7 @@ type ArchiveVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10142,7 +10893,7 @@ type CommitVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10329,7 +11080,7 @@ type ConsumablePlanOptions struct { // A dotted value of `sw`.`catalogID`.`resourceID`. PlanLocID *string `json:"plan_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10360,7 +11111,7 @@ type ConsumableShareObjectOptions struct { // Object identifier. ObjectIdentifier *string `json:"object_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10395,7 +11146,7 @@ type ConsumableVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10429,7 +11180,7 @@ type CopyFromPreviousVersionOptions struct { // The version locator id of the version you wish to copy data from. VersionLocIDToCopyFrom *string `json:"version_loc_id_to_copy_from" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -10489,7 +11240,10 @@ type CopyVersionOptions struct { // Optional - The sub-folder within the specified tgz file that contains the software being onboarded. WorkingDirectory *string `json:"working_directory,omitempty"` - // Allows users to set headers on API requests + // The install type of the current software being onboarded. + InstallType *string `json:"install_type,omitempty"` + + // Allows users to set headers on API requests. Headers map[string]string } @@ -10542,6 +11296,12 @@ func (_options *CopyVersionOptions) SetWorkingDirectory(workingDirectory string) return _options } +// SetInstallType : Allow user to set InstallType +func (_options *CopyVersionOptions) SetInstallType(installType string) *CopyVersionOptions { + _options.InstallType = core.StringPtr(installType) + return _options +} + // SetHeaders : Allow user to set Headers func (options *CopyVersionOptions) SetHeaders(param map[string]string) *CopyVersionOptions { options.Headers = param @@ -10909,7 +11669,7 @@ type CreateCatalogOptions struct { // List of target accounts contexts on this catalog. TargetAccountContexts []TargetAccountContext `json:"target_account_contexts,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11026,7 +11786,7 @@ type CreateObjectAccessOptions struct { // and '-entgrp-enterprisegroupid' for an enterprise group. AccessIdentifier *string `json:"access_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11119,7 +11879,7 @@ type CreateObjectOptions struct { // Map of data values for this object. Data map[string]interface{} `json:"data,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11343,7 +12103,7 @@ type CreateOfferingInstanceOptions struct { // The CRN of the resource that is considered a parent of this software instance. ParentCRN *string `json:"parent_crn,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11691,7 +12451,7 @@ type CreateOfferingOptions struct { // A list of plans for this offering. Plans []Plan `json:"plans,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -11984,7 +12744,7 @@ type DeleteCatalogOptions struct { // Catalog identifier. CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12018,7 +12778,7 @@ type DeleteObjectAccessListOptions struct { // A list of accesses to delete. An entry with star["*"] will remove all accesses. Accesses []string `json:"accesses" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12067,7 +12827,7 @@ type DeleteObjectAccessOptions struct { // and '-entgrp-enterprisegroupid' for an enterprise group. AccessIdentifier *string `json:"access_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12112,7 +12872,7 @@ type DeleteObjectOptions struct { // Object identifier. ObjectIdentifier *string `json:"object_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12153,7 +12913,7 @@ type DeleteOfferingAccessListOptions struct { // A list of accesses to delete. An entry with star["*"] will remove all accesses. Accesses []string `json:"accesses" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12198,7 +12958,7 @@ type DeleteOfferingInstanceOptions struct { // IAM Refresh token. XAuthRefreshToken *string `json:"X-Auth-Refresh-Token" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12240,7 +13000,7 @@ type DeleteOfferingOptions struct { // the public offering Partner Center only needs to use their token in the authorization header. XApproverToken *string `json:"X-Approver-Token,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12290,7 +13050,7 @@ type DeleteOperatorsOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocatorID *string `json:"version_locator_id" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12339,7 +13099,7 @@ type DeletePlanOptions struct { // A dotted value of `sw`.`catalogID`.`resourceID`. PlanLocID *string `json:"plan_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12370,7 +13130,7 @@ type DeleteShareApprovalListOptions struct { // A list of accesses to delete. An entry with star["*"] will remove all accesses. Accesses []string `json:"accesses" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12414,7 +13174,7 @@ type DeleteVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12463,7 +13223,7 @@ type DeployOperatorsOptions struct { // Plan. InstallPlan *string `json:"install_plan,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12571,6 +13331,7 @@ func UnmarshalDeployRequestBodyEnvironmentVariablesItem(m map[string]json.RawMes } // DeployRequestBodyOverrideValues : Validation override values. Required for virtual server image for VPC. +// This type supports additional properties of type interface{}. type DeployRequestBodyOverrideValues struct { // Name of virtual server image instance to create. Required for virtual server image for VPC. VsiInstanceName *string `json:"vsi_instance_name,omitempty"` @@ -12593,11 +13354,11 @@ type DeployRequestBodyOverrideValues struct { // Region virtual server image exists in. Required for virtual server image for VPC. VPCRegion *string `json:"vpc_region,omitempty"` - // Allows users to set arbitrary properties + // Allows users to set arbitrary properties of type interface{}. additionalProperties map[string]interface{} } -// SetProperty allows the user to set an arbitrary property on an instance of DeployRequestBodyOverrideValues +// SetProperty allows the user to set an arbitrary property on an instance of DeployRequestBodyOverrideValues. func (o *DeployRequestBodyOverrideValues) SetProperty(key string, value interface{}) { if o.additionalProperties == nil { o.additionalProperties = make(map[string]interface{}) @@ -12605,7 +13366,7 @@ func (o *DeployRequestBodyOverrideValues) SetProperty(key string, value interfac o.additionalProperties[key] = value } -// SetProperties allows the user to set a map of arbitrary properties on an instance of DeployRequestBodyOverrideValues +// SetProperties allows the user to set a map of arbitrary properties on an instance of DeployRequestBodyOverrideValues. func (o *DeployRequestBodyOverrideValues) SetProperties(m map[string]interface{}) { o.additionalProperties = make(map[string]interface{}) for k, v := range m { @@ -12613,12 +13374,12 @@ func (o *DeployRequestBodyOverrideValues) SetProperties(m map[string]interface{} } } -// GetProperty allows the user to retrieve an arbitrary property from an instance of DeployRequestBodyOverrideValues +// GetProperty allows the user to retrieve an arbitrary property from an instance of DeployRequestBodyOverrideValues. func (o *DeployRequestBodyOverrideValues) GetProperty(key string) interface{} { return o.additionalProperties[key] } -// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of DeployRequestBodyOverrideValues +// GetProperties allows the user to retrieve the map of arbitrary properties from an instance of DeployRequestBodyOverrideValues. func (o *DeployRequestBodyOverrideValues) GetProperties() map[string]interface{} { return o.additionalProperties } @@ -12792,7 +13553,7 @@ type DeprecateOfferingOptions struct { // Specifies the amount of days until product is not available in catalog. DaysUntilDeprecate *int64 `json:"days_until_deprecate,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -12886,7 +13647,7 @@ type DeprecateVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13188,7 +13949,7 @@ type GetCatalogAccountAuditOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13222,7 +13983,7 @@ type GetCatalogAccountFiltersOptions struct { // catalog id. Narrow down filters to the account and just the one catalog. Catalog *string `json:"catalog,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13246,7 +14007,7 @@ func (options *GetCatalogAccountFiltersOptions) SetHeaders(param map[string]stri // GetCatalogAccountOptions : The GetCatalogAccount options. type GetCatalogAccountOptions struct { - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13272,7 +14033,7 @@ type GetCatalogAuditOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13313,7 +14074,7 @@ type GetCatalogOptions struct { // Catalog identifier. CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13347,7 +14108,7 @@ type GetClusterOptions struct { // IAM Refresh token. XAuthRefreshToken *string `json:"X-Auth-Refresh-Token" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13408,7 +14169,7 @@ type GetConsumptionOfferingsOptions struct { // number of results to skip before returning values. Offset *int64 `json:"offset,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13479,7 +14240,7 @@ type GetEnterpriseAuditOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13520,7 +14281,7 @@ type GetIamPermissionsOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13560,7 +14321,7 @@ type GetNamespacesOptions struct { // The number of results to skip before returning values. Offset *int64 `json:"offset,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13623,7 +14384,7 @@ type GetObjectAccessListDeprecatedOptions struct { // The number of results to skip before returning values. Offset *int64 `json:"offset,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13679,7 +14440,7 @@ type GetObjectAccessListOptions struct { // number or results to return in the query. Limit *int64 `json:"limit,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13733,7 +14494,7 @@ type GetObjectAccessOptions struct { // and '-entgrp-enterprisegroupid' for an enterprise group. AccessIdentifier *string `json:"access_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13784,7 +14545,7 @@ type GetObjectAuditOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13835,7 +14596,7 @@ type GetObjectOptions struct { // Object identifier. ObjectIdentifier *string `json:"object_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13870,7 +14631,7 @@ type GetOfferingAboutOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13907,7 +14668,7 @@ type GetOfferingAccessListOptions struct { // number or results to return in the query. Limit *int64 `json:"limit,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -13961,7 +14722,7 @@ type GetOfferingAccessOptions struct { // and '-entgrp-enterprisegroupid' for an enterprise group. AccessIdentifier *string `json:"access_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14012,7 +14773,7 @@ type GetOfferingAuditOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14079,7 +14840,7 @@ type GetOfferingChangeNoticesOptions struct { // that are newer than the specified version, including the specified version. Versions *string `json:"versions,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14153,7 +14914,7 @@ type GetOfferingContainerImagesOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14187,7 +14948,7 @@ type GetOfferingInstanceAuditOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14228,7 +14989,7 @@ type GetOfferingInstanceOptions struct { // Version Instance identifier. InstanceIdentifier *string `json:"instance_identifier" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14259,7 +15020,7 @@ type GetOfferingLicenseOptions struct { // The ID of the license, which maps to the file name in the 'licenses' directory of this verions tgz file. LicenseID *string `json:"license_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14303,7 +15064,7 @@ type GetOfferingOptions struct { // Return the digest format of the specified offering. Default is false. Digest *bool `json:"digest,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14378,7 +15139,7 @@ type GetOfferingSourceArchiveOptions struct { // The install type of the specified version. InstallType *string `json:"installType,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14488,7 +15249,7 @@ type GetOfferingSourceOptions struct { // The install type of the specified version. InstallType *string `json:"installType,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14582,7 +15343,7 @@ type GetOfferingSourceURLOptions struct { // Offering id. An offering name or ID must be specified. ID *string `json:"id,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14637,7 +15398,7 @@ type GetOfferingStatsOptions struct { // Offering identification. OfferingID *string `json:"offering_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14717,7 +15478,7 @@ type GetOfferingUpdatesOptions struct { // The install type of the version that was installed. InstallType *string `json:"install_type,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14838,7 +15599,7 @@ type GetOfferingWorkingCopyOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14866,7 +15627,7 @@ type GetPlanOptions struct { // A dotted value of `sw`.`catalogID`.`resourceID`. PlanLocID *string `json:"plan_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14906,7 +15667,7 @@ type GetPreinstallOptions struct { // Required if the version's pre-install scope is `namespace`. Namespace *string `json:"namespace,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -14972,7 +15733,7 @@ type GetShareApprovalListAsSourceOptions struct { // enterprise and '-entgrp-enterprisegroupid for an enterprise group. EnterpriseID *string `json:"enterprise_id,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -15048,7 +15809,7 @@ type GetShareApprovalListOptions struct { // number or results to return in the query. Limit *int64 `json:"limit,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -15103,7 +15864,7 @@ type GetValidationStatusOptions struct { // The name of a target account context on a catalog. TargetContextName *string `json:"targetContextName,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -15139,12 +15900,40 @@ func (options *GetValidationStatusOptions) SetHeaders(param map[string]string) * return options } +// GetVersionDependenciesOptions : The GetVersionDependencies options. +type GetVersionDependenciesOptions struct { + // A dotted value of `catalogID`.`versionID`. + VersionLocID *string `json:"version_loc_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetVersionDependenciesOptions : Instantiate GetVersionDependenciesOptions +func (*CatalogManagementV1) NewGetVersionDependenciesOptions(versionLocID string) *GetVersionDependenciesOptions { + return &GetVersionDependenciesOptions{ + VersionLocID: core.StringPtr(versionLocID), + } +} + +// SetVersionLocID : Allow user to set VersionLocID +func (_options *GetVersionDependenciesOptions) SetVersionLocID(versionLocID string) *GetVersionDependenciesOptions { + _options.VersionLocID = core.StringPtr(versionLocID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVersionDependenciesOptions) SetHeaders(param map[string]string) *GetVersionDependenciesOptions { + options.Headers = param + return options +} + // GetVersionOptions : The GetVersion options. type GetVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -15167,6 +15956,90 @@ func (options *GetVersionOptions) SetHeaders(param map[string]string) *GetVersio return options } +// GetVersionsOptions : The GetVersions options. +type GetVersionsOptions struct { + // Catalog identifier. + CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` + + // Offering identification. + OfferingID *string `json:"offering_id" validate:"required,ne="` + + // Kind identification. + KindID *string `json:"kind_id" validate:"required,ne="` + + // Return the digest format of the specified offering. Default is false. + Digest *bool `json:"digest,omitempty"` + + // Return consumable versions. Default is false. + Catalog *bool `json:"catalog,omitempty"` + + // Start token for a query. + Start *string `json:"start,omitempty"` + + // number or results to return in the query. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetVersionsOptions : Instantiate GetVersionsOptions +func (*CatalogManagementV1) NewGetVersionsOptions(catalogIdentifier string, offeringID string, kindID string) *GetVersionsOptions { + return &GetVersionsOptions{ + CatalogIdentifier: core.StringPtr(catalogIdentifier), + OfferingID: core.StringPtr(offeringID), + KindID: core.StringPtr(kindID), + } +} + +// SetCatalogIdentifier : Allow user to set CatalogIdentifier +func (_options *GetVersionsOptions) SetCatalogIdentifier(catalogIdentifier string) *GetVersionsOptions { + _options.CatalogIdentifier = core.StringPtr(catalogIdentifier) + return _options +} + +// SetOfferingID : Allow user to set OfferingID +func (_options *GetVersionsOptions) SetOfferingID(offeringID string) *GetVersionsOptions { + _options.OfferingID = core.StringPtr(offeringID) + return _options +} + +// SetKindID : Allow user to set KindID +func (_options *GetVersionsOptions) SetKindID(kindID string) *GetVersionsOptions { + _options.KindID = core.StringPtr(kindID) + return _options +} + +// SetDigest : Allow user to set Digest +func (_options *GetVersionsOptions) SetDigest(digest bool) *GetVersionsOptions { + _options.Digest = core.BoolPtr(digest) + return _options +} + +// SetCatalog : Allow user to set Catalog +func (_options *GetVersionsOptions) SetCatalog(catalog bool) *GetVersionsOptions { + _options.Catalog = core.BoolPtr(catalog) + return _options +} + +// SetStart : Allow user to set Start +func (_options *GetVersionsOptions) SetStart(start string) *GetVersionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *GetVersionsOptions) SetLimit(limit int64) *GetVersionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVersionsOptions) SetHeaders(param map[string]string) *GetVersionsOptions { + options.Headers = param + return options +} + // IamPermission : IAM Permission definition. type IamPermission struct { // Service name. @@ -15517,6 +16390,9 @@ type ImportOfferingOptions struct { // Tags array. Tags []string `json:"tags,omitempty"` + // Keywords array. + Keywords []string `json:"keywords,omitempty"` + // Byte array representing the content to be imported. Only supported for OVA images at this time. Content *[]byte `json:"content,omitempty"` @@ -15582,7 +16458,7 @@ type ImportOfferingOptions struct { // Authentication token used to access the specified zip file. XAuthToken *string `json:"X-Auth-Token,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -15605,6 +16481,12 @@ func (_options *ImportOfferingOptions) SetTags(tags []string) *ImportOfferingOpt return _options } +// SetKeywords : Allow user to set Keywords +func (_options *ImportOfferingOptions) SetKeywords(keywords []string) *ImportOfferingOptions { + _options.Keywords = keywords + return _options +} + // SetContent : Allow user to set Content func (_options *ImportOfferingOptions) SetContent(content []byte) *ImportOfferingOptions { _options.Content = core.ByteArrayPtr(content) @@ -15748,6 +16630,9 @@ type ImportOfferingVersionOptions struct { // Tags array. Tags []string `json:"tags,omitempty"` + // Keywords array. + Keywords []string `json:"keywords,omitempty"` + // Byte array representing the content to be imported. Only supported for OVA images at this time. Content *[]byte `json:"content,omitempty"` @@ -15810,7 +16695,7 @@ type ImportOfferingVersionOptions struct { // Authentication token used to access the specified zip file. XAuthToken *string `json:"X-Auth-Token,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -15840,6 +16725,12 @@ func (_options *ImportOfferingVersionOptions) SetTags(tags []string) *ImportOffe return _options } +// SetKeywords : Allow user to set Keywords +func (_options *ImportOfferingVersionOptions) SetKeywords(keywords []string) *ImportOfferingVersionOptions { + _options.Keywords = keywords + return _options +} + // SetContent : Allow user to set Content func (_options *ImportOfferingVersionOptions) SetContent(content []byte) *ImportOfferingVersionOptions { _options.Content = core.ByteArrayPtr(content) @@ -16153,6 +17044,9 @@ type InstallVersionOptions struct { // Validation override values. Required for virtual server image for VPC. OverrideValues *DeployRequestBodyOverrideValues `json:"override_values,omitempty"` + // Used when the product has required dependencies, to indicated existing dependencies to reuse during validation. + DependencyConfigs []string `json:"dependency_configs,omitempty"` + // Schematics environment variables to use with this workspace. EnvironmentVariables []DeployRequestBodyEnvironmentVariablesItem `json:"environment_variables,omitempty"` @@ -16195,7 +17089,7 @@ type InstallVersionOptions struct { // Used when installing an operator, to indicate which install plan to use. InstallPlan *string `json:"install_plan,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16255,6 +17149,12 @@ func (_options *InstallVersionOptions) SetOverrideValues(overrideValues *DeployR return _options } +// SetDependencyConfigs : Allow user to set DependencyConfigs +func (_options *InstallVersionOptions) SetDependencyConfigs(dependencyConfigs []string) *InstallVersionOptions { + _options.DependencyConfigs = dependencyConfigs + return _options +} + // SetEnvironmentVariables : Allow user to set EnvironmentVariables func (_options *InstallVersionOptions) SetEnvironmentVariables(environmentVariables []DeployRequestBodyEnvironmentVariablesItem) *InstallVersionOptions { _options.EnvironmentVariables = environmentVariables @@ -16451,6 +17351,9 @@ type Kind struct { // list of versions. Versions []Version `json:"versions,omitempty"` + + // URLs for paging through all versions within this kind. + AllVersions *KindAllVersions `json:"all_versions,omitempty"` } // UnmarshalKind unmarshals an instance of Kind from the specified map of raw messages. @@ -16521,23 +17424,54 @@ func UnmarshalKind(m map[string]json.RawMessage, result interface{}) (err error) err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "all_versions", &obj.AllVersions, UnmarshalKindAllVersions) + if err != nil { + err = core.SDKErrorf(err, "", "all_versions-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// LearnMoreLinks : Learn more links for a badge. -type LearnMoreLinks struct { - // First party link. - FirstParty *string `json:"first_party,omitempty"` +// KindAllVersions : URLs for paging through all versions within this kind. +type KindAllVersions struct { + // Link response on a token paginated query. + First *PaginationTokenLink `json:"first,omitempty"` - // Third party link. - ThirdParty *string `json:"third_party,omitempty"` + // Link response on a token paginated query. + Next *PaginationTokenLink `json:"next,omitempty"` } -// UnmarshalLearnMoreLinks unmarshals an instance of LearnMoreLinks from the specified map of raw messages. -func UnmarshalLearnMoreLinks(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LearnMoreLinks) - err = core.UnmarshalPrimitive(m, "first_party", &obj.FirstParty) +// UnmarshalKindAllVersions unmarshals an instance of KindAllVersions from the specified map of raw messages. +func UnmarshalKindAllVersions(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(KindAllVersions) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// LearnMoreLinks : Learn more links for a badge. +type LearnMoreLinks struct { + // First party link. + FirstParty *string `json:"first_party,omitempty"` + + // Third party link. + ThirdParty *string `json:"third_party,omitempty"` +} + +// UnmarshalLearnMoreLinks unmarshals an instance of LearnMoreLinks from the specified map of raw messages. +func UnmarshalLearnMoreLinks(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LearnMoreLinks) + err = core.UnmarshalPrimitive(m, "first_party", &obj.FirstParty) if err != nil { err = core.SDKErrorf(err, "", "first_party-error", common.GetComponentInfo()) return @@ -16612,7 +17546,7 @@ type ListCatalogAccountAuditsOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16659,7 +17593,7 @@ type ListCatalogAuditsOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16703,7 +17637,7 @@ func (options *ListCatalogAuditsOptions) SetHeaders(param map[string]string) *Li // ListCatalogsOptions : The ListCatalogs options. type ListCatalogsOptions struct { - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16732,7 +17666,7 @@ type ListEnterpriseAuditsOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16790,7 +17724,7 @@ type ListObjectAuditsOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16857,7 +17791,7 @@ type ListObjectsOptions struct { // specify descending order. Default is ascending order. Sort *string `json:"sort,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16921,7 +17855,7 @@ type ListOfferingAuditsOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -16983,7 +17917,7 @@ type ListOfferingInstanceAuditsOptions struct { // Auditlog Lookup Names - by default names are not returned in auditlog. Lookupnames *bool `json:"lookupnames,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -17051,7 +17985,7 @@ type ListOfferingsOptions struct { // must be explicitly set. IncludeHidden *bool `json:"includeHidden,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -17124,7 +18058,7 @@ type ListOperatorsOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocatorID *string `json:"version_locator_id" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -17168,6 +18102,59 @@ func (options *ListOperatorsOptions) SetHeaders(param map[string]string) *ListOp return options } +// ListRegionsOptions : The ListRegions options. +type ListRegionsOptions struct { + // Filter to apply for search. + Filter *string `json:"filter,omitempty"` + + // Returns inactive locations when true. + GetInactive *bool `json:"get_inactive,omitempty"` + + // The maximum number of results to return. + Limit *int64 `json:"limit,omitempty"` + + // The number of results to skip before returning values. + Offset *int64 `json:"offset,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListRegionsOptions : Instantiate ListRegionsOptions +func (*CatalogManagementV1) NewListRegionsOptions() *ListRegionsOptions { + return &ListRegionsOptions{} +} + +// SetFilter : Allow user to set Filter +func (_options *ListRegionsOptions) SetFilter(filter string) *ListRegionsOptions { + _options.Filter = core.StringPtr(filter) + return _options +} + +// SetGetInactive : Allow user to set GetInactive +func (_options *ListRegionsOptions) SetGetInactive(getInactive bool) *ListRegionsOptions { + _options.GetInactive = core.BoolPtr(getInactive) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListRegionsOptions) SetLimit(limit int64) *ListRegionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetOffset : Allow user to set Offset +func (_options *ListRegionsOptions) SetOffset(offset int64) *ListRegionsOptions { + _options.Offset = core.Int64Ptr(offset) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListRegionsOptions) SetHeaders(param map[string]string) *ListRegionsOptions { + options.Headers = param + return options +} + // MediaItem : Offering Media information. type MediaItem struct { // URL of the specified media item. @@ -18656,6 +19643,18 @@ type PaginationTokenLink struct { Start *string `json:"start,omitempty"` } +// NewPaginationTokenLink : Instantiate PaginationTokenLink (Generic Model Constructor) +func (*CatalogManagementV1) NewPaginationTokenLink(href string) (_model *PaginationTokenLink, err error) { + _model = &PaginationTokenLink{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + // UnmarshalPaginationTokenLink unmarshals an instance of PaginationTokenLink from the specified map of raw messages. func UnmarshalPaginationTokenLink(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(PaginationTokenLink) @@ -18673,6 +19672,52 @@ func UnmarshalPaginationTokenLink(m map[string]json.RawMessage, result interface return } +// PatchUpdateVersionOptions : The PatchUpdateVersion options. +type PatchUpdateVersionOptions struct { + // A dotted value of `catalogID`.`versionID`. + VersionLocID *string `json:"version_loc_id" validate:"required,ne="` + + // Offering etag contained in quotes. + IfMatch *string `json:"If-Match" validate:"required"` + + Updates []JSONPatchOperation `json:"updates,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewPatchUpdateVersionOptions : Instantiate PatchUpdateVersionOptions +func (*CatalogManagementV1) NewPatchUpdateVersionOptions(versionLocID string, ifMatch string) *PatchUpdateVersionOptions { + return &PatchUpdateVersionOptions{ + VersionLocID: core.StringPtr(versionLocID), + IfMatch: core.StringPtr(ifMatch), + } +} + +// SetVersionLocID : Allow user to set VersionLocID +func (_options *PatchUpdateVersionOptions) SetVersionLocID(versionLocID string) *PatchUpdateVersionOptions { + _options.VersionLocID = core.StringPtr(versionLocID) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *PatchUpdateVersionOptions) SetIfMatch(ifMatch string) *PatchUpdateVersionOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetUpdates : Allow user to set Updates +func (_options *PatchUpdateVersionOptions) SetUpdates(updates []JSONPatchOperation) *PatchUpdateVersionOptions { + _options.Updates = updates + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *PatchUpdateVersionOptions) SetHeaders(param map[string]string) *PatchUpdateVersionOptions { + options.Headers = param + return options +} + // Plan : Plan information. type Plan struct { // Unique ID. @@ -18870,6 +19915,9 @@ type PreinstallVersionOptions struct { // Validation override values. Required for virtual server image for VPC. OverrideValues *DeployRequestBodyOverrideValues `json:"override_values,omitempty"` + // Used when the product has required dependencies, to indicated existing dependencies to reuse during validation. + DependencyConfigs []string `json:"dependency_configs,omitempty"` + // Schematics environment variables to use with this workspace. EnvironmentVariables []DeployRequestBodyEnvironmentVariablesItem `json:"environment_variables,omitempty"` @@ -18912,7 +19960,7 @@ type PreinstallVersionOptions struct { // Used when installing an operator, to indicate which install plan to use. InstallPlan *string `json:"install_plan,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -18972,6 +20020,12 @@ func (_options *PreinstallVersionOptions) SetOverrideValues(overrideValues *Depl return _options } +// SetDependencyConfigs : Allow user to set DependencyConfigs +func (_options *PreinstallVersionOptions) SetDependencyConfigs(dependencyConfigs []string) *PreinstallVersionOptions { + _options.DependencyConfigs = dependencyConfigs + return _options +} + // SetEnvironmentVariables : Allow user to set EnvironmentVariables func (_options *PreinstallVersionOptions) SetEnvironmentVariables(environmentVariables []DeployRequestBodyEnvironmentVariablesItem) *PreinstallVersionOptions { _options.EnvironmentVariables = environmentVariables @@ -19067,7 +20121,7 @@ type PrereleaseVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -19090,6 +20144,59 @@ func (options *PrereleaseVersionOptions) SetHeaders(param map[string]string) *Pr return options } +// PreviewRegionsOptions : The PreviewRegions options. +type PreviewRegionsOptions struct { + // Filter to apply for search. + Filter *string `json:"filter,omitempty"` + + // Returns inactive locations when true. + GetInactive *bool `json:"get_inactive,omitempty"` + + // The maximum number of results to return. + Limit *int64 `json:"limit,omitempty"` + + // The number of results to skip before returning values. + Offset *int64 `json:"offset,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewPreviewRegionsOptions : Instantiate PreviewRegionsOptions +func (*CatalogManagementV1) NewPreviewRegionsOptions() *PreviewRegionsOptions { + return &PreviewRegionsOptions{} +} + +// SetFilter : Allow user to set Filter +func (_options *PreviewRegionsOptions) SetFilter(filter string) *PreviewRegionsOptions { + _options.Filter = core.StringPtr(filter) + return _options +} + +// SetGetInactive : Allow user to set GetInactive +func (_options *PreviewRegionsOptions) SetGetInactive(getInactive bool) *PreviewRegionsOptions { + _options.GetInactive = core.BoolPtr(getInactive) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *PreviewRegionsOptions) SetLimit(limit int64) *PreviewRegionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetOffset : Allow user to set Offset +func (_options *PreviewRegionsOptions) SetOffset(offset int64) *PreviewRegionsOptions { + _options.Offset = core.Int64Ptr(offset) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *PreviewRegionsOptions) SetHeaders(param map[string]string) *PreviewRegionsOptions { + options.Headers = param + return options +} + // Project : Cost estimate project definition. type Project struct { // Project name. @@ -19383,7 +20490,7 @@ type PutOfferingInstanceOptions struct { // The CRN of the resource that is considered a parent of this software instance. ParentCRN *string `json:"parent_crn,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -19641,292 +20748,575 @@ func UnmarshalRating(m map[string]json.RawMessage, result interface{}) (err erro return } -// ReloadOfferingOptions : The ReloadOffering options. -type ReloadOfferingOptions struct { - // Catalog identifier. - CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` - - // Offering identification. - OfferingID *string `json:"offering_id" validate:"required,ne="` - - // The semver value for this new version. - TargetVersion *string `json:"targetVersion" validate:"required"` - - // Tags array. - Tags []string `json:"tags,omitempty"` - - // byte array representing the content to be imported. Only supported for OVA images at this time. - Content *[]byte `json:"content,omitempty"` - - // Target kinds. Current valid values are 'iks', 'roks', 'vcenter', 'power-iaas', and 'terraform'. - TargetKinds []string `json:"target_kinds,omitempty"` - - // Format of content being onboarded. Example: vsi-image. Required for virtual server image for VPC. - FormatKind *string `json:"format_kind,omitempty"` - - // Version Flavor Information. Only supported for Product kind Solution. - Flavor *Flavor `json:"flavor,omitempty"` +// Region : Region information. +type Region struct { + ID *string `json:"id,omitempty"` - // Optional - The sub-folder within the specified tgz file that contains the software being onboarded. - WorkingDirectory *string `json:"working_directory,omitempty"` + Name *string `json:"name,omitempty"` - // URL path to zip location. If not specified, must provide content in this post body. - Zipurl *string `json:"zipurl,omitempty"` + CatalogCRN *string `json:"catalog_crn,omitempty"` - // The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'. - RepoType *string `json:"repoType,omitempty"` + Kind *string `json:"kind,omitempty"` - // Allows users to set headers on API requests - Headers map[string]string -} + Public *bool `json:"public,omitempty"` -// NewReloadOfferingOptions : Instantiate ReloadOfferingOptions -func (*CatalogManagementV1) NewReloadOfferingOptions(catalogIdentifier string, offeringID string, targetVersion string) *ReloadOfferingOptions { - return &ReloadOfferingOptions{ - CatalogIdentifier: core.StringPtr(catalogIdentifier), - OfferingID: core.StringPtr(offeringID), - TargetVersion: core.StringPtr(targetVersion), - } -} + UI *RegionUI `json:"ui,omitempty"` -// SetCatalogIdentifier : Allow user to set CatalogIdentifier -func (_options *ReloadOfferingOptions) SetCatalogIdentifier(catalogIdentifier string) *ReloadOfferingOptions { - _options.CatalogIdentifier = core.StringPtr(catalogIdentifier) - return _options -} + Icon *string `json:"icon,omitempty"` -// SetOfferingID : Allow user to set OfferingID -func (_options *ReloadOfferingOptions) SetOfferingID(offeringID string) *ReloadOfferingOptions { - _options.OfferingID = core.StringPtr(offeringID) - return _options -} + ParentID *string `json:"parent_id,omitempty"` -// SetTargetVersion : Allow user to set TargetVersion -func (_options *ReloadOfferingOptions) SetTargetVersion(targetVersion string) *ReloadOfferingOptions { - _options.TargetVersion = core.StringPtr(targetVersion) - return _options -} + MetroID *string `json:"metro_id,omitempty"` -// SetTags : Allow user to set Tags -func (_options *ReloadOfferingOptions) SetTags(tags []string) *ReloadOfferingOptions { - _options.Tags = tags - return _options -} + CountryID *string `json:"country_id,omitempty"` -// SetContent : Allow user to set Content -func (_options *ReloadOfferingOptions) SetContent(content []byte) *ReloadOfferingOptions { - _options.Content = core.ByteArrayPtr(content) - return _options -} + GeoID *string `json:"geo_id,omitempty"` -// SetTargetKinds : Allow user to set TargetKinds -func (_options *ReloadOfferingOptions) SetTargetKinds(targetKinds []string) *ReloadOfferingOptions { - _options.TargetKinds = targetKinds - return _options -} + Authority *RegionAuthority `json:"authority,omitempty"` -// SetFormatKind : Allow user to set FormatKind -func (_options *ReloadOfferingOptions) SetFormatKind(formatKind string) *ReloadOfferingOptions { - _options.FormatKind = core.StringPtr(formatKind) - return _options -} + Tags []string `json:"tags,omitempty"` -// SetFlavor : Allow user to set Flavor -func (_options *ReloadOfferingOptions) SetFlavor(flavor *Flavor) *ReloadOfferingOptions { - _options.Flavor = flavor - return _options -} + Capabilities *string `json:"capabilities,omitempty"` -// SetWorkingDirectory : Allow user to set WorkingDirectory -func (_options *ReloadOfferingOptions) SetWorkingDirectory(workingDirectory string) *ReloadOfferingOptions { - _options.WorkingDirectory = core.StringPtr(workingDirectory) - return _options -} + Created *string `json:"created,omitempty"` -// SetZipurl : Allow user to set Zipurl -func (_options *ReloadOfferingOptions) SetZipurl(zipurl string) *ReloadOfferingOptions { - _options.Zipurl = core.StringPtr(zipurl) - return _options -} + Updated *string `json:"updated,omitempty"` -// SetRepoType : Allow user to set RepoType -func (_options *ReloadOfferingOptions) SetRepoType(repoType string) *ReloadOfferingOptions { - _options.RepoType = core.StringPtr(repoType) - return _options -} + Active *bool `json:"active,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ReloadOfferingOptions) SetHeaders(param map[string]string) *ReloadOfferingOptions { - options.Headers = param - return options + Visibility map[string]interface{} `json:"visibility,omitempty"` } -// RenderType : Render type. -type RenderType struct { - // ID of the widget type. - Type *string `json:"type,omitempty"` - - // Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment). - Grouping *string `json:"grouping,omitempty"` - - // Original grouping type for this configuration (3 types - Target, Resource, and Deployment). - OriginalGrouping *string `json:"original_grouping,omitempty"` - - // Determines the order that this configuration item shows in that particular grouping. - GroupingIndex *int64 `json:"grouping_index,omitempty"` - - // Map of constraint parameters that will be passed to the custom widget. - ConfigConstraints map[string]interface{} `json:"config_constraints,omitempty"` - - // List of parameters that are associated with this configuration. - Associations *RenderTypeAssociations `json:"associations,omitempty"` -} - -// UnmarshalRenderType unmarshals an instance of RenderType from the specified map of raw messages. -func UnmarshalRenderType(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RenderType) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) +// UnmarshalRegion unmarshals an instance of Region from the specified map of raw messages. +func UnmarshalRegion(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Region) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "grouping", &obj.Grouping) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { - err = core.SDKErrorf(err, "", "grouping-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "original_grouping", &obj.OriginalGrouping) + err = core.UnmarshalPrimitive(m, "catalog_crn", &obj.CatalogCRN) if err != nil { - err = core.SDKErrorf(err, "", "original_grouping-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "catalog_crn-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "grouping_index", &obj.GroupingIndex) + err = core.UnmarshalPrimitive(m, "kind", &obj.Kind) if err != nil { - err = core.SDKErrorf(err, "", "grouping_index-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "kind-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "config_constraints", &obj.ConfigConstraints) + err = core.UnmarshalPrimitive(m, "public", &obj.Public) if err != nil { - err = core.SDKErrorf(err, "", "config_constraints-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "public-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "associations", &obj.Associations, UnmarshalRenderTypeAssociations) + err = core.UnmarshalModel(m, "ui", &obj.UI, UnmarshalRegionUI) if err != nil { - err = core.SDKErrorf(err, "", "associations-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "ui-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "icon", &obj.Icon) + if err != nil { + err = core.SDKErrorf(err, "", "icon-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "parent_id", &obj.ParentID) + if err != nil { + err = core.SDKErrorf(err, "", "parent_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "metro_id", &obj.MetroID) + if err != nil { + err = core.SDKErrorf(err, "", "metro_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "country_id", &obj.CountryID) + if err != nil { + err = core.SDKErrorf(err, "", "country_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "geo_id", &obj.GeoID) + if err != nil { + err = core.SDKErrorf(err, "", "geo_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "authority", &obj.Authority, UnmarshalRegionAuthority) + if err != nil { + err = core.SDKErrorf(err, "", "authority-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "tags", &obj.Tags) + if err != nil { + err = core.SDKErrorf(err, "", "tags-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "capabilities", &obj.Capabilities) + if err != nil { + err = core.SDKErrorf(err, "", "capabilities-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created", &obj.Created) + if err != nil { + err = core.SDKErrorf(err, "", "created-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "updated", &obj.Updated) + if err != nil { + err = core.SDKErrorf(err, "", "updated-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "active", &obj.Active) + if err != nil { + err = core.SDKErrorf(err, "", "active-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "visibility", &obj.Visibility) + if err != nil { + err = core.SDKErrorf(err, "", "visibility-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// RenderTypeAssociations : List of parameters that are associated with this configuration. -type RenderTypeAssociations struct { - // Parameters for this association. - Parameters []RenderTypeAssociationsParametersItem `json:"parameters,omitempty"` +// RegionAuthority : RegionAuthority struct +type RegionAuthority struct { + URL *string `json:"url,omitempty"` + + CRN *string `json:"crn,omitempty"` + + Provider *string `json:"provider,omitempty"` } -// UnmarshalRenderTypeAssociations unmarshals an instance of RenderTypeAssociations from the specified map of raw messages. -func UnmarshalRenderTypeAssociations(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RenderTypeAssociations) - err = core.UnmarshalModel(m, "parameters", &obj.Parameters, UnmarshalRenderTypeAssociationsParametersItem) +// UnmarshalRegionAuthority unmarshals an instance of RegionAuthority from the specified map of raw messages. +func UnmarshalRegionAuthority(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionAuthority) + err = core.UnmarshalPrimitive(m, "url", &obj.URL) if err != nil { - err = core.SDKErrorf(err, "", "parameters-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "provider", &obj.Provider) + if err != nil { + err = core.SDKErrorf(err, "", "provider-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// RenderTypeAssociationsParametersItem : RenderTypeAssociationsParametersItem struct -type RenderTypeAssociationsParametersItem struct { - // Name of this parameter. - Name *string `json:"name,omitempty"` +// RegionUI : RegionUI struct +type RegionUI struct { + Language *RegionUILanguage `json:"_language_,omitempty"` +} - // Refresh options. - OptionsRefresh *bool `json:"optionsRefresh,omitempty"` +// UnmarshalRegionUI unmarshals an instance of RegionUI from the specified map of raw messages. +func UnmarshalRegionUI(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionUI) + err = core.UnmarshalModel(m, "_language_", &obj.Language, UnmarshalRegionUILanguage) + if err != nil { + err = core.SDKErrorf(err, "", "_language_-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// UnmarshalRenderTypeAssociationsParametersItem unmarshals an instance of RenderTypeAssociationsParametersItem from the specified map of raw messages. -func UnmarshalRenderTypeAssociationsParametersItem(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RenderTypeAssociationsParametersItem) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// RegionUILanguage : RegionUILanguage struct +type RegionUILanguage struct { + Description *string `json:"description,omitempty"` + + DisplayName *string `json:"display_name,omitempty"` +} + +// UnmarshalRegionUILanguage unmarshals an instance of RegionUILanguage from the specified map of raw messages. +func UnmarshalRegionUILanguage(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionUILanguage) + err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "optionsRefresh", &obj.OptionsRefresh) + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { - err = core.SDKErrorf(err, "", "optionsRefresh-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ReplaceCatalogOptions : The ReplaceCatalog options. -type ReplaceCatalogOptions struct { - // Catalog identifier. - CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` +// RegionsSearchResult : Paginated location search result. +type RegionsSearchResult struct { + // The offset (origin 0) of the first resource in this page of search results. + Offset *int64 `json:"offset" validate:"required"` - // Unique ID. - ID *string `json:"id,omitempty"` + // The maximum number of resources returned in each page of search results. + Limit *int64 `json:"limit" validate:"required"` - // Cloudant revision. - Rev *string `json:"_rev,omitempty"` + // The overall total number of resources in the search result set. + TotalCount *int64 `json:"total_count,omitempty"` - // Display Name in the requested language. - Label *string `json:"label,omitempty"` + // The number of resources returned in this page of search results. + ResourceCount *int64 `json:"resource_count,omitempty"` - // A map of translated strings, by language code. - LabelI18n map[string]string `json:"label_i18n,omitempty"` + // Link response on a token paginated query. + First *PaginationTokenLink `json:"first,omitempty"` - // Description in the requested language. - ShortDescription *string `json:"short_description,omitempty"` + // Link response on a token paginated query. + Last *PaginationTokenLink `json:"last,omitempty"` - // A map of translated strings, by language code. - ShortDescriptionI18n map[string]string `json:"short_description_i18n,omitempty"` + // Resulting objects. + Regions []Region `json:"regions,omitempty"` +} - // URL for an icon associated with this catalog. - CatalogIconURL *string `json:"catalog_icon_url,omitempty"` +// UnmarshalRegionsSearchResult unmarshals an instance of RegionsSearchResult from the specified map of raw messages. +func UnmarshalRegionsSearchResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RegionsSearchResult) + err = core.UnmarshalPrimitive(m, "offset", &obj.Offset) + if err != nil { + err = core.SDKErrorf(err, "", "offset-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_count", &obj.ResourceCount) + if err != nil { + err = core.SDKErrorf(err, "", "resource_count-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "last", &obj.Last, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "last-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "regions", &obj.Regions, UnmarshalRegion) + if err != nil { + err = core.SDKErrorf(err, "", "regions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // URL for a banner image for this catalog. - CatalogBannerURL *string `json:"catalog_banner_url,omitempty"` +// ReloadOfferingOptions : The ReloadOffering options. +type ReloadOfferingOptions struct { + // Catalog identifier. + CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` - // List of tags associated with this catalog. + // Offering identification. + OfferingID *string `json:"offering_id" validate:"required,ne="` + + // The semver value for this new version. + TargetVersion *string `json:"targetVersion" validate:"required"` + + // Tags array. Tags []string `json:"tags,omitempty"` - // List of features associated with this catalog. - Features []Feature `json:"features,omitempty"` + // byte array representing the content to be imported. Only supported for OVA images at this time. + Content *[]byte `json:"content,omitempty"` - // Denotes whether a catalog is disabled. - Disabled *bool `json:"disabled,omitempty"` + // Target kinds. Current valid values are 'iks', 'roks', 'vcenter', 'power-iaas', and 'terraform'. + TargetKinds []string `json:"target_kinds,omitempty"` - // Resource group id the catalog is owned by. - ResourceGroupID *string `json:"resource_group_id,omitempty"` + // Format of content being onboarded. Example: vsi-image. Required for virtual server image for VPC. + FormatKind *string `json:"format_kind,omitempty"` - // Account that owns catalog. - OwningAccount *string `json:"owning_account,omitempty"` + // Version Flavor Information. Only supported for Product kind Solution. + Flavor *Flavor `json:"flavor,omitempty"` - // Filters for account and catalog filters. - CatalogFilters *Filters `json:"catalog_filters,omitempty"` + // Optional - The sub-folder within the specified tgz file that contains the software being onboarded. + WorkingDirectory *string `json:"working_directory,omitempty"` - // Kind of catalog. Supported kinds are offering and vpe. - Kind *string `json:"kind,omitempty"` + // The install type of the current software being onboarded. + InstallType *string `json:"install_type,omitempty"` - // Catalog specific metadata. - Metadata map[string]interface{} `json:"metadata,omitempty"` + // URL path to zip location. If not specified, must provide content in this post body. + Zipurl *string `json:"zipurl,omitempty"` - // List of target accounts contexts on this catalog. - TargetAccountContexts []TargetAccountContext `json:"target_account_contexts,omitempty"` + // The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'. + RepoType *string `json:"repoType,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } -// NewReplaceCatalogOptions : Instantiate ReplaceCatalogOptions -func (*CatalogManagementV1) NewReplaceCatalogOptions(catalogIdentifier string) *ReplaceCatalogOptions { - return &ReplaceCatalogOptions{ - CatalogIdentifier: core.StringPtr(catalogIdentifier), +// NewReloadOfferingOptions : Instantiate ReloadOfferingOptions +func (*CatalogManagementV1) NewReloadOfferingOptions(catalogIdentifier string, offeringID string, targetVersion string) *ReloadOfferingOptions { + return &ReloadOfferingOptions{ + CatalogIdentifier: core.StringPtr(catalogIdentifier), + OfferingID: core.StringPtr(offeringID), + TargetVersion: core.StringPtr(targetVersion), + } +} + +// SetCatalogIdentifier : Allow user to set CatalogIdentifier +func (_options *ReloadOfferingOptions) SetCatalogIdentifier(catalogIdentifier string) *ReloadOfferingOptions { + _options.CatalogIdentifier = core.StringPtr(catalogIdentifier) + return _options +} + +// SetOfferingID : Allow user to set OfferingID +func (_options *ReloadOfferingOptions) SetOfferingID(offeringID string) *ReloadOfferingOptions { + _options.OfferingID = core.StringPtr(offeringID) + return _options +} + +// SetTargetVersion : Allow user to set TargetVersion +func (_options *ReloadOfferingOptions) SetTargetVersion(targetVersion string) *ReloadOfferingOptions { + _options.TargetVersion = core.StringPtr(targetVersion) + return _options +} + +// SetTags : Allow user to set Tags +func (_options *ReloadOfferingOptions) SetTags(tags []string) *ReloadOfferingOptions { + _options.Tags = tags + return _options +} + +// SetContent : Allow user to set Content +func (_options *ReloadOfferingOptions) SetContent(content []byte) *ReloadOfferingOptions { + _options.Content = core.ByteArrayPtr(content) + return _options +} + +// SetTargetKinds : Allow user to set TargetKinds +func (_options *ReloadOfferingOptions) SetTargetKinds(targetKinds []string) *ReloadOfferingOptions { + _options.TargetKinds = targetKinds + return _options +} + +// SetFormatKind : Allow user to set FormatKind +func (_options *ReloadOfferingOptions) SetFormatKind(formatKind string) *ReloadOfferingOptions { + _options.FormatKind = core.StringPtr(formatKind) + return _options +} + +// SetFlavor : Allow user to set Flavor +func (_options *ReloadOfferingOptions) SetFlavor(flavor *Flavor) *ReloadOfferingOptions { + _options.Flavor = flavor + return _options +} + +// SetWorkingDirectory : Allow user to set WorkingDirectory +func (_options *ReloadOfferingOptions) SetWorkingDirectory(workingDirectory string) *ReloadOfferingOptions { + _options.WorkingDirectory = core.StringPtr(workingDirectory) + return _options +} + +// SetInstallType : Allow user to set InstallType +func (_options *ReloadOfferingOptions) SetInstallType(installType string) *ReloadOfferingOptions { + _options.InstallType = core.StringPtr(installType) + return _options +} + +// SetZipurl : Allow user to set Zipurl +func (_options *ReloadOfferingOptions) SetZipurl(zipurl string) *ReloadOfferingOptions { + _options.Zipurl = core.StringPtr(zipurl) + return _options +} + +// SetRepoType : Allow user to set RepoType +func (_options *ReloadOfferingOptions) SetRepoType(repoType string) *ReloadOfferingOptions { + _options.RepoType = core.StringPtr(repoType) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReloadOfferingOptions) SetHeaders(param map[string]string) *ReloadOfferingOptions { + options.Headers = param + return options +} + +// RenderType : Render type. +type RenderType struct { + // ID of the widget type. + Type *string `json:"type,omitempty"` + + // Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment). + Grouping *string `json:"grouping,omitempty"` + + // Original grouping type for this configuration (3 types - Target, Resource, and Deployment). + OriginalGrouping *string `json:"original_grouping,omitempty"` + + // Determines the order that this configuration item shows in that particular grouping. + GroupingIndex *int64 `json:"grouping_index,omitempty"` + + // Map of constraint parameters that will be passed to the custom widget. + ConfigConstraints map[string]interface{} `json:"config_constraints,omitempty"` + + // List of parameters that are associated with this configuration. + Associations *RenderTypeAssociations `json:"associations,omitempty"` +} + +// UnmarshalRenderType unmarshals an instance of RenderType from the specified map of raw messages. +func UnmarshalRenderType(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RenderType) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "grouping", &obj.Grouping) + if err != nil { + err = core.SDKErrorf(err, "", "grouping-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "original_grouping", &obj.OriginalGrouping) + if err != nil { + err = core.SDKErrorf(err, "", "original_grouping-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "grouping_index", &obj.GroupingIndex) + if err != nil { + err = core.SDKErrorf(err, "", "grouping_index-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "config_constraints", &obj.ConfigConstraints) + if err != nil { + err = core.SDKErrorf(err, "", "config_constraints-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "associations", &obj.Associations, UnmarshalRenderTypeAssociations) + if err != nil { + err = core.SDKErrorf(err, "", "associations-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RenderTypeAssociations : List of parameters that are associated with this configuration. +type RenderTypeAssociations struct { + // Parameters for this association. + Parameters []RenderTypeAssociationsParametersItem `json:"parameters,omitempty"` +} + +// UnmarshalRenderTypeAssociations unmarshals an instance of RenderTypeAssociations from the specified map of raw messages. +func UnmarshalRenderTypeAssociations(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RenderTypeAssociations) + err = core.UnmarshalModel(m, "parameters", &obj.Parameters, UnmarshalRenderTypeAssociationsParametersItem) + if err != nil { + err = core.SDKErrorf(err, "", "parameters-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RenderTypeAssociationsParametersItem : RenderTypeAssociationsParametersItem struct +type RenderTypeAssociationsParametersItem struct { + // Name of this parameter. + Name *string `json:"name,omitempty"` + + // Refresh options. + OptionsRefresh *bool `json:"optionsRefresh,omitempty"` +} + +// UnmarshalRenderTypeAssociationsParametersItem unmarshals an instance of RenderTypeAssociationsParametersItem from the specified map of raw messages. +func UnmarshalRenderTypeAssociationsParametersItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RenderTypeAssociationsParametersItem) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "optionsRefresh", &obj.OptionsRefresh) + if err != nil { + err = core.SDKErrorf(err, "", "optionsRefresh-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReplaceCatalogOptions : The ReplaceCatalog options. +type ReplaceCatalogOptions struct { + // Catalog identifier. + CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` + + // Unique ID. + ID *string `json:"id,omitempty"` + + // Cloudant revision. + Rev *string `json:"_rev,omitempty"` + + // Display Name in the requested language. + Label *string `json:"label,omitempty"` + + // A map of translated strings, by language code. + LabelI18n map[string]string `json:"label_i18n,omitempty"` + + // Description in the requested language. + ShortDescription *string `json:"short_description,omitempty"` + + // A map of translated strings, by language code. + ShortDescriptionI18n map[string]string `json:"short_description_i18n,omitempty"` + + // URL for an icon associated with this catalog. + CatalogIconURL *string `json:"catalog_icon_url,omitempty"` + + // URL for a banner image for this catalog. + CatalogBannerURL *string `json:"catalog_banner_url,omitempty"` + + // List of tags associated with this catalog. + Tags []string `json:"tags,omitempty"` + + // List of features associated with this catalog. + Features []Feature `json:"features,omitempty"` + + // Denotes whether a catalog is disabled. + Disabled *bool `json:"disabled,omitempty"` + + // Resource group id the catalog is owned by. + ResourceGroupID *string `json:"resource_group_id,omitempty"` + + // Account that owns catalog. + OwningAccount *string `json:"owning_account,omitempty"` + + // Filters for account and catalog filters. + CatalogFilters *Filters `json:"catalog_filters,omitempty"` + + // Kind of catalog. Supported kinds are offering and vpe. + Kind *string `json:"kind,omitempty"` + + // Catalog specific metadata. + Metadata map[string]interface{} `json:"metadata,omitempty"` + + // List of target accounts contexts on this catalog. + TargetAccountContexts []TargetAccountContext `json:"target_account_contexts,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewReplaceCatalogOptions : Instantiate ReplaceCatalogOptions +func (*CatalogManagementV1) NewReplaceCatalogOptions(catalogIdentifier string) *ReplaceCatalogOptions { + return &ReplaceCatalogOptions{ + CatalogIdentifier: core.StringPtr(catalogIdentifier), } } @@ -20109,7 +21499,7 @@ type ReplaceObjectOptions struct { // Map of data values for this object. Data map[string]interface{} `json:"data,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -20401,7 +21791,7 @@ type ReplaceOfferingOptions struct { // A list of plans for this offering. Plans []Plan `json:"plans,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -20734,7 +22124,7 @@ type ReplaceOperatorsOptions struct { // Plan. InstallPlan *string `json:"install_plan,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -21333,7 +22723,7 @@ type SearchObjectsOptions struct { // Display a digests of search results, has default value of true. Digest *bool `json:"digest,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -21406,7 +22796,7 @@ type SetDeprecatePlanOptions struct { // Specifies the amount of days until product is not available in catalog. DaysUntilDeprecate *int64 `json:"days_until_deprecate,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -21469,7 +22859,7 @@ type SetDeprecateVersionOptions struct { // Specifies the amount of days until product is not available in catalog. DaysUntilDeprecate *int64 `json:"days_until_deprecate,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -21552,7 +22942,7 @@ type SetOfferingPublishOptions struct { // approval type as `ibm_module_repo` or `ibm_community`. XAuthToken *string `json:"X-Auth-Token,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -21812,7 +23202,7 @@ type ShareObjectOptions struct { // Visible to access list. Enabled *bool `json:"enabled,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -21877,7 +23267,7 @@ type ShareOfferingOptions struct { // Visible to access list. Enabled *bool `json:"enabled,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -22300,7 +23690,7 @@ type SuspendVersionOptions struct { // A dotted value of `catalogID`.`versionID`. VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -22455,172 +23845,687 @@ type UpdateCatalogAccountOptions struct { // Filters for account and catalog filters. AccountFilters *Filters `json:"account_filters,omitempty"` - // Allows users to set headers on API requests + RegionFilters []string `json:"region_filters,omitempty"` + + FilteredRegions []string `json:"filtered_regions,omitempty"` + + FilterRegions *bool `json:"filter_regions,omitempty"` + + // Allows users to set headers on API requests. Headers map[string]string } -// NewUpdateCatalogAccountOptions : Instantiate UpdateCatalogAccountOptions -func (*CatalogManagementV1) NewUpdateCatalogAccountOptions() *UpdateCatalogAccountOptions { - return &UpdateCatalogAccountOptions{} +// NewUpdateCatalogAccountOptions : Instantiate UpdateCatalogAccountOptions +func (*CatalogManagementV1) NewUpdateCatalogAccountOptions() *UpdateCatalogAccountOptions { + return &UpdateCatalogAccountOptions{} +} + +// SetID : Allow user to set ID +func (_options *UpdateCatalogAccountOptions) SetID(id string) *UpdateCatalogAccountOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetRev : Allow user to set Rev +func (_options *UpdateCatalogAccountOptions) SetRev(rev string) *UpdateCatalogAccountOptions { + _options.Rev = core.StringPtr(rev) + return _options +} + +// SetHideIBMCloudCatalog : Allow user to set HideIBMCloudCatalog +func (_options *UpdateCatalogAccountOptions) SetHideIBMCloudCatalog(hideIBMCloudCatalog bool) *UpdateCatalogAccountOptions { + _options.HideIBMCloudCatalog = core.BoolPtr(hideIBMCloudCatalog) + return _options +} + +// SetAccountFilters : Allow user to set AccountFilters +func (_options *UpdateCatalogAccountOptions) SetAccountFilters(accountFilters *Filters) *UpdateCatalogAccountOptions { + _options.AccountFilters = accountFilters + return _options +} + +// SetRegionFilters : Allow user to set RegionFilters +func (_options *UpdateCatalogAccountOptions) SetRegionFilters(regionFilters []string) *UpdateCatalogAccountOptions { + _options.RegionFilters = regionFilters + return _options +} + +// SetFilteredRegions : Allow user to set FilteredRegions +func (_options *UpdateCatalogAccountOptions) SetFilteredRegions(filteredRegions []string) *UpdateCatalogAccountOptions { + _options.FilteredRegions = filteredRegions + return _options +} + +// SetFilterRegions : Allow user to set FilterRegions +func (_options *UpdateCatalogAccountOptions) SetFilterRegions(filterRegions bool) *UpdateCatalogAccountOptions { + _options.FilterRegions = core.BoolPtr(filterRegions) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateCatalogAccountOptions) SetHeaders(param map[string]string) *UpdateCatalogAccountOptions { + options.Headers = param + return options +} + +// UpdateOfferingOptions : The UpdateOffering options. +type UpdateOfferingOptions struct { + // Catalog identifier. + CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` + + // Offering identification. + OfferingID *string `json:"offering_id" validate:"required,ne="` + + // Offering etag contained in quotes. + IfMatch *string `json:"If-Match" validate:"required"` + + Updates []JSONPatchOperation `json:"updates,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateOfferingOptions : Instantiate UpdateOfferingOptions +func (*CatalogManagementV1) NewUpdateOfferingOptions(catalogIdentifier string, offeringID string, ifMatch string) *UpdateOfferingOptions { + return &UpdateOfferingOptions{ + CatalogIdentifier: core.StringPtr(catalogIdentifier), + OfferingID: core.StringPtr(offeringID), + IfMatch: core.StringPtr(ifMatch), + } +} + +// SetCatalogIdentifier : Allow user to set CatalogIdentifier +func (_options *UpdateOfferingOptions) SetCatalogIdentifier(catalogIdentifier string) *UpdateOfferingOptions { + _options.CatalogIdentifier = core.StringPtr(catalogIdentifier) + return _options +} + +// SetOfferingID : Allow user to set OfferingID +func (_options *UpdateOfferingOptions) SetOfferingID(offeringID string) *UpdateOfferingOptions { + _options.OfferingID = core.StringPtr(offeringID) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateOfferingOptions) SetIfMatch(ifMatch string) *UpdateOfferingOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetUpdates : Allow user to set Updates +func (_options *UpdateOfferingOptions) SetUpdates(updates []JSONPatchOperation) *UpdateOfferingOptions { + _options.Updates = updates + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateOfferingOptions) SetHeaders(param map[string]string) *UpdateOfferingOptions { + options.Headers = param + return options +} + +// UpdateShareApprovalListAsSourceOptions : The UpdateShareApprovalListAsSource options. +type UpdateShareApprovalListAsSourceOptions struct { + // The type for the object. + ObjectType *string `json:"object_type" validate:"required,ne="` + + // The different possible approval states for share requests or access request. + ApprovalStateIdentifier *string `json:"approval_state_identifier" validate:"required,ne="` + + // A list of accesses to update to the specified approval state. + Accesses []string `json:"accesses" validate:"required"` + + // Execute the request in the context of an enterprise or enterpise account group ID. Use '-ent-enterpriseid' for an + // enterprise and '-entgrp-enterprisegroupid for an enterprise group. + EnterpriseID *string `json:"enterprise_id,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// Constants associated with the UpdateShareApprovalListAsSourceOptions.ObjectType property. +// The type for the object. +const ( + UpdateShareApprovalListAsSourceOptionsObjectTypeOfferingConst = "offering" + UpdateShareApprovalListAsSourceOptionsObjectTypePresetConfigurationConst = "preset_configuration" + UpdateShareApprovalListAsSourceOptionsObjectTypeProxySourceConst = "proxy_source" + UpdateShareApprovalListAsSourceOptionsObjectTypeVpeConst = "vpe" +) + +// Constants associated with the UpdateShareApprovalListAsSourceOptions.ApprovalStateIdentifier property. +// The different possible approval states for share requests or access request. +const ( + UpdateShareApprovalListAsSourceOptionsApprovalStateIdentifierApprovedConst = "approved" + UpdateShareApprovalListAsSourceOptionsApprovalStateIdentifierPendingConst = "pending" + UpdateShareApprovalListAsSourceOptionsApprovalStateIdentifierRejectedConst = "rejected" +) + +// NewUpdateShareApprovalListAsSourceOptions : Instantiate UpdateShareApprovalListAsSourceOptions +func (*CatalogManagementV1) NewUpdateShareApprovalListAsSourceOptions(objectType string, approvalStateIdentifier string, accesses []string) *UpdateShareApprovalListAsSourceOptions { + return &UpdateShareApprovalListAsSourceOptions{ + ObjectType: core.StringPtr(objectType), + ApprovalStateIdentifier: core.StringPtr(approvalStateIdentifier), + Accesses: accesses, + } +} + +// SetObjectType : Allow user to set ObjectType +func (_options *UpdateShareApprovalListAsSourceOptions) SetObjectType(objectType string) *UpdateShareApprovalListAsSourceOptions { + _options.ObjectType = core.StringPtr(objectType) + return _options +} + +// SetApprovalStateIdentifier : Allow user to set ApprovalStateIdentifier +func (_options *UpdateShareApprovalListAsSourceOptions) SetApprovalStateIdentifier(approvalStateIdentifier string) *UpdateShareApprovalListAsSourceOptions { + _options.ApprovalStateIdentifier = core.StringPtr(approvalStateIdentifier) + return _options +} + +// SetAccesses : Allow user to set Accesses +func (_options *UpdateShareApprovalListAsSourceOptions) SetAccesses(accesses []string) *UpdateShareApprovalListAsSourceOptions { + _options.Accesses = accesses + return _options +} + +// SetEnterpriseID : Allow user to set EnterpriseID +func (_options *UpdateShareApprovalListAsSourceOptions) SetEnterpriseID(enterpriseID string) *UpdateShareApprovalListAsSourceOptions { + _options.EnterpriseID = core.StringPtr(enterpriseID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateShareApprovalListAsSourceOptions) SetHeaders(param map[string]string) *UpdateShareApprovalListAsSourceOptions { + options.Headers = param + return options +} + +// UpdateVersionOptions : The UpdateVersion options. +type UpdateVersionOptions struct { + // A dotted value of `catalogID`.`versionID`. + VersionLocID *string `json:"version_loc_id" validate:"required,ne="` + + // unique id. + ID *string `json:"id,omitempty"` + + // Cloudant revision. + Rev *string `json:"_rev,omitempty"` + + // The url for this specific offering. + URL *string `json:"url,omitempty"` + + // The crn for this specific offering. + CRN *string `json:"crn,omitempty"` + + // Display Name in the requested language. + Label *string `json:"label,omitempty"` + + // A map of translated strings, by language code. + LabelI18n map[string]string `json:"label_i18n,omitempty"` + + // The programmatic name of this offering. + Name *string `json:"name,omitempty"` + + // URL for an icon associated with this offering. + OfferingIconURL *string `json:"offering_icon_url,omitempty"` + + // URL for an additional docs with this offering. + OfferingDocsURL *string `json:"offering_docs_url,omitempty"` + + // [deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this + // offering. + OfferingSupportURL *string `json:"offering_support_url,omitempty"` + + // List of tags associated with this catalog. + Tags []string `json:"tags,omitempty"` + + // List of keywords associated with offering, typically used to search for it. + Keywords []string `json:"keywords,omitempty"` + + // Repository info for offerings. + Rating *Rating `json:"rating,omitempty"` + + // The date and time this catalog was created. + Created *strfmt.DateTime `json:"created,omitempty"` + + // The date and time this catalog was last updated. + Updated *strfmt.DateTime `json:"updated,omitempty"` + + // Short description in the requested language. + ShortDescription *string `json:"short_description,omitempty"` + + // A map of translated strings, by language code. + ShortDescriptionI18n map[string]string `json:"short_description_i18n,omitempty"` + + // Long description in the requested language. + LongDescription *string `json:"long_description,omitempty"` + + // A map of translated strings, by language code. + LongDescriptionI18n map[string]string `json:"long_description_i18n,omitempty"` + + // list of features associated with this offering. + Features []Feature `json:"features,omitempty"` + + // Array of kind. + Kinds []Kind `json:"kinds,omitempty"` + + // Publish information. + Publish *PublishObject `json:"publish,omitempty"` + + // Offering is managed by Partner Center. + PcManaged *bool `json:"pc_managed,omitempty"` + + // Offering has been approved to publish to permitted to IBM or Public Catalog. + PublishApproved *bool `json:"publish_approved,omitempty"` + + // Denotes public availability of an Offering. + ShareWithAll *bool `json:"share_with_all,omitempty"` + + // Denotes IBM employee availability of an Offering - if share_enabled is true. + ShareWithIBM *bool `json:"share_with_ibm,omitempty"` + + // Denotes sharing including access list availability of an Offering is enabled. + ShareEnabled *bool `json:"share_enabled,omitempty"` + + // The original offering CRN that this publish entry came from. + PublicOriginalCRN *string `json:"public_original_crn,omitempty"` + + // The crn of the public catalog entry of this offering. + PublishPublicCRN *string `json:"publish_public_crn,omitempty"` + + // The portal's approval record ID. + PortalApprovalRecord *string `json:"portal_approval_record,omitempty"` + + // The portal UI URL. + PortalUIURL *string `json:"portal_ui_url,omitempty"` + + // The id of the catalog containing this offering. + CatalogID *string `json:"catalog_id,omitempty"` + + // The name of the catalog. + CatalogName *string `json:"catalog_name,omitempty"` + + // Map of metadata values for this offering. + Metadata map[string]interface{} `json:"metadata,omitempty"` + + // A disclaimer for this offering. + Disclaimer *string `json:"disclaimer,omitempty"` + + // Determine if this offering should be displayed in the Consumption UI. + Hidden *bool `json:"hidden,omitempty"` + + // Deprecated - Provider of this offering. + // Deprecated: this field is deprecated and may be removed in a future release. + Provider *string `json:"provider,omitempty"` + + // Information on the provider for this offering, or omitted if no provider information is given. + ProviderInfo *ProviderInfo `json:"provider_info,omitempty"` + + // Repository info for offerings. + RepoInfo *RepoInfo `json:"repo_info,omitempty"` + + // Image pull keys for this offering. + ImagePullKeys []ImagePullKey `json:"image_pull_keys,omitempty"` + + // Offering Support information. + Support *Support `json:"support,omitempty"` + + // A list of media items related to this offering. + Media []MediaItem `json:"media,omitempty"` + + // Deprecation information for an Offering. + DeprecatePending *DeprecatePending `json:"deprecate_pending,omitempty"` + + // The product kind. Valid values are module, solution, or empty string. + ProductKind *string `json:"product_kind,omitempty"` + + // A list of badges for this offering. + Badges []Badge `json:"badges,omitempty"` + + // A list of plans for this offering. + Plans []Plan `json:"plans,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateVersionOptions : Instantiate UpdateVersionOptions +func (*CatalogManagementV1) NewUpdateVersionOptions(versionLocID string) *UpdateVersionOptions { + return &UpdateVersionOptions{ + VersionLocID: core.StringPtr(versionLocID), + } +} + +// SetVersionLocID : Allow user to set VersionLocID +func (_options *UpdateVersionOptions) SetVersionLocID(versionLocID string) *UpdateVersionOptions { + _options.VersionLocID = core.StringPtr(versionLocID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateVersionOptions) SetID(id string) *UpdateVersionOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetRev : Allow user to set Rev +func (_options *UpdateVersionOptions) SetRev(rev string) *UpdateVersionOptions { + _options.Rev = core.StringPtr(rev) + return _options +} + +// SetURL : Allow user to set URL +func (_options *UpdateVersionOptions) SetURL(url string) *UpdateVersionOptions { + _options.URL = core.StringPtr(url) + return _options +} + +// SetCRN : Allow user to set CRN +func (_options *UpdateVersionOptions) SetCRN(crn string) *UpdateVersionOptions { + _options.CRN = core.StringPtr(crn) + return _options +} + +// SetLabel : Allow user to set Label +func (_options *UpdateVersionOptions) SetLabel(label string) *UpdateVersionOptions { + _options.Label = core.StringPtr(label) + return _options +} + +// SetLabelI18n : Allow user to set LabelI18n +func (_options *UpdateVersionOptions) SetLabelI18n(labelI18n map[string]string) *UpdateVersionOptions { + _options.LabelI18n = labelI18n + return _options +} + +// SetName : Allow user to set Name +func (_options *UpdateVersionOptions) SetName(name string) *UpdateVersionOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetOfferingIconURL : Allow user to set OfferingIconURL +func (_options *UpdateVersionOptions) SetOfferingIconURL(offeringIconURL string) *UpdateVersionOptions { + _options.OfferingIconURL = core.StringPtr(offeringIconURL) + return _options +} + +// SetOfferingDocsURL : Allow user to set OfferingDocsURL +func (_options *UpdateVersionOptions) SetOfferingDocsURL(offeringDocsURL string) *UpdateVersionOptions { + _options.OfferingDocsURL = core.StringPtr(offeringDocsURL) + return _options +} + +// SetOfferingSupportURL : Allow user to set OfferingSupportURL +func (_options *UpdateVersionOptions) SetOfferingSupportURL(offeringSupportURL string) *UpdateVersionOptions { + _options.OfferingSupportURL = core.StringPtr(offeringSupportURL) + return _options +} + +// SetTags : Allow user to set Tags +func (_options *UpdateVersionOptions) SetTags(tags []string) *UpdateVersionOptions { + _options.Tags = tags + return _options +} + +// SetKeywords : Allow user to set Keywords +func (_options *UpdateVersionOptions) SetKeywords(keywords []string) *UpdateVersionOptions { + _options.Keywords = keywords + return _options +} + +// SetRating : Allow user to set Rating +func (_options *UpdateVersionOptions) SetRating(rating *Rating) *UpdateVersionOptions { + _options.Rating = rating + return _options +} + +// SetCreated : Allow user to set Created +func (_options *UpdateVersionOptions) SetCreated(created *strfmt.DateTime) *UpdateVersionOptions { + _options.Created = created + return _options +} + +// SetUpdated : Allow user to set Updated +func (_options *UpdateVersionOptions) SetUpdated(updated *strfmt.DateTime) *UpdateVersionOptions { + _options.Updated = updated + return _options +} + +// SetShortDescription : Allow user to set ShortDescription +func (_options *UpdateVersionOptions) SetShortDescription(shortDescription string) *UpdateVersionOptions { + _options.ShortDescription = core.StringPtr(shortDescription) + return _options +} + +// SetShortDescriptionI18n : Allow user to set ShortDescriptionI18n +func (_options *UpdateVersionOptions) SetShortDescriptionI18n(shortDescriptionI18n map[string]string) *UpdateVersionOptions { + _options.ShortDescriptionI18n = shortDescriptionI18n + return _options +} + +// SetLongDescription : Allow user to set LongDescription +func (_options *UpdateVersionOptions) SetLongDescription(longDescription string) *UpdateVersionOptions { + _options.LongDescription = core.StringPtr(longDescription) + return _options +} + +// SetLongDescriptionI18n : Allow user to set LongDescriptionI18n +func (_options *UpdateVersionOptions) SetLongDescriptionI18n(longDescriptionI18n map[string]string) *UpdateVersionOptions { + _options.LongDescriptionI18n = longDescriptionI18n + return _options +} + +// SetFeatures : Allow user to set Features +func (_options *UpdateVersionOptions) SetFeatures(features []Feature) *UpdateVersionOptions { + _options.Features = features + return _options +} + +// SetKinds : Allow user to set Kinds +func (_options *UpdateVersionOptions) SetKinds(kinds []Kind) *UpdateVersionOptions { + _options.Kinds = kinds + return _options +} + +// SetPublish : Allow user to set Publish +func (_options *UpdateVersionOptions) SetPublish(publish *PublishObject) *UpdateVersionOptions { + _options.Publish = publish + return _options +} + +// SetPcManaged : Allow user to set PcManaged +func (_options *UpdateVersionOptions) SetPcManaged(pcManaged bool) *UpdateVersionOptions { + _options.PcManaged = core.BoolPtr(pcManaged) + return _options +} + +// SetPublishApproved : Allow user to set PublishApproved +func (_options *UpdateVersionOptions) SetPublishApproved(publishApproved bool) *UpdateVersionOptions { + _options.PublishApproved = core.BoolPtr(publishApproved) + return _options +} + +// SetShareWithAll : Allow user to set ShareWithAll +func (_options *UpdateVersionOptions) SetShareWithAll(shareWithAll bool) *UpdateVersionOptions { + _options.ShareWithAll = core.BoolPtr(shareWithAll) + return _options +} + +// SetShareWithIBM : Allow user to set ShareWithIBM +func (_options *UpdateVersionOptions) SetShareWithIBM(shareWithIBM bool) *UpdateVersionOptions { + _options.ShareWithIBM = core.BoolPtr(shareWithIBM) + return _options +} + +// SetShareEnabled : Allow user to set ShareEnabled +func (_options *UpdateVersionOptions) SetShareEnabled(shareEnabled bool) *UpdateVersionOptions { + _options.ShareEnabled = core.BoolPtr(shareEnabled) + return _options +} + +// SetPublicOriginalCRN : Allow user to set PublicOriginalCRN +func (_options *UpdateVersionOptions) SetPublicOriginalCRN(publicOriginalCRN string) *UpdateVersionOptions { + _options.PublicOriginalCRN = core.StringPtr(publicOriginalCRN) + return _options +} + +// SetPublishPublicCRN : Allow user to set PublishPublicCRN +func (_options *UpdateVersionOptions) SetPublishPublicCRN(publishPublicCRN string) *UpdateVersionOptions { + _options.PublishPublicCRN = core.StringPtr(publishPublicCRN) + return _options +} + +// SetPortalApprovalRecord : Allow user to set PortalApprovalRecord +func (_options *UpdateVersionOptions) SetPortalApprovalRecord(portalApprovalRecord string) *UpdateVersionOptions { + _options.PortalApprovalRecord = core.StringPtr(portalApprovalRecord) + return _options +} + +// SetPortalUIURL : Allow user to set PortalUIURL +func (_options *UpdateVersionOptions) SetPortalUIURL(portalUIURL string) *UpdateVersionOptions { + _options.PortalUIURL = core.StringPtr(portalUIURL) + return _options } -// SetID : Allow user to set ID -func (_options *UpdateCatalogAccountOptions) SetID(id string) *UpdateCatalogAccountOptions { - _options.ID = core.StringPtr(id) +// SetCatalogID : Allow user to set CatalogID +func (_options *UpdateVersionOptions) SetCatalogID(catalogID string) *UpdateVersionOptions { + _options.CatalogID = core.StringPtr(catalogID) return _options } -// SetRev : Allow user to set Rev -func (_options *UpdateCatalogAccountOptions) SetRev(rev string) *UpdateCatalogAccountOptions { - _options.Rev = core.StringPtr(rev) +// SetCatalogName : Allow user to set CatalogName +func (_options *UpdateVersionOptions) SetCatalogName(catalogName string) *UpdateVersionOptions { + _options.CatalogName = core.StringPtr(catalogName) return _options } -// SetHideIBMCloudCatalog : Allow user to set HideIBMCloudCatalog -func (_options *UpdateCatalogAccountOptions) SetHideIBMCloudCatalog(hideIBMCloudCatalog bool) *UpdateCatalogAccountOptions { - _options.HideIBMCloudCatalog = core.BoolPtr(hideIBMCloudCatalog) +// SetMetadata : Allow user to set Metadata +func (_options *UpdateVersionOptions) SetMetadata(metadata map[string]interface{}) *UpdateVersionOptions { + _options.Metadata = metadata return _options } -// SetAccountFilters : Allow user to set AccountFilters -func (_options *UpdateCatalogAccountOptions) SetAccountFilters(accountFilters *Filters) *UpdateCatalogAccountOptions { - _options.AccountFilters = accountFilters +// SetDisclaimer : Allow user to set Disclaimer +func (_options *UpdateVersionOptions) SetDisclaimer(disclaimer string) *UpdateVersionOptions { + _options.Disclaimer = core.StringPtr(disclaimer) return _options } -// SetHeaders : Allow user to set Headers -func (options *UpdateCatalogAccountOptions) SetHeaders(param map[string]string) *UpdateCatalogAccountOptions { - options.Headers = param - return options +// SetHidden : Allow user to set Hidden +func (_options *UpdateVersionOptions) SetHidden(hidden bool) *UpdateVersionOptions { + _options.Hidden = core.BoolPtr(hidden) + return _options } -// UpdateOfferingOptions : The UpdateOffering options. -type UpdateOfferingOptions struct { - // Catalog identifier. - CatalogIdentifier *string `json:"catalog_identifier" validate:"required,ne="` +// SetProvider : Allow user to set Provider +// Deprecated: this method is deprecated and may be removed in a future release. +func (_options *UpdateVersionOptions) SetProvider(provider string) *UpdateVersionOptions { + _options.Provider = core.StringPtr(provider) + return _options +} - // Offering identification. - OfferingID *string `json:"offering_id" validate:"required,ne="` +// SetProviderInfo : Allow user to set ProviderInfo +func (_options *UpdateVersionOptions) SetProviderInfo(providerInfo *ProviderInfo) *UpdateVersionOptions { + _options.ProviderInfo = providerInfo + return _options +} - // Offering etag contained in quotes. - IfMatch *string `json:"If-Match" validate:"required"` +// SetRepoInfo : Allow user to set RepoInfo +func (_options *UpdateVersionOptions) SetRepoInfo(repoInfo *RepoInfo) *UpdateVersionOptions { + _options.RepoInfo = repoInfo + return _options +} - Updates []JSONPatchOperation `json:"updates,omitempty"` +// SetImagePullKeys : Allow user to set ImagePullKeys +func (_options *UpdateVersionOptions) SetImagePullKeys(imagePullKeys []ImagePullKey) *UpdateVersionOptions { + _options.ImagePullKeys = imagePullKeys + return _options +} - // Allows users to set headers on API requests - Headers map[string]string +// SetSupport : Allow user to set Support +func (_options *UpdateVersionOptions) SetSupport(support *Support) *UpdateVersionOptions { + _options.Support = support + return _options } -// NewUpdateOfferingOptions : Instantiate UpdateOfferingOptions -func (*CatalogManagementV1) NewUpdateOfferingOptions(catalogIdentifier string, offeringID string, ifMatch string) *UpdateOfferingOptions { - return &UpdateOfferingOptions{ - CatalogIdentifier: core.StringPtr(catalogIdentifier), - OfferingID: core.StringPtr(offeringID), - IfMatch: core.StringPtr(ifMatch), - } +// SetMedia : Allow user to set Media +func (_options *UpdateVersionOptions) SetMedia(media []MediaItem) *UpdateVersionOptions { + _options.Media = media + return _options } -// SetCatalogIdentifier : Allow user to set CatalogIdentifier -func (_options *UpdateOfferingOptions) SetCatalogIdentifier(catalogIdentifier string) *UpdateOfferingOptions { - _options.CatalogIdentifier = core.StringPtr(catalogIdentifier) +// SetDeprecatePending : Allow user to set DeprecatePending +func (_options *UpdateVersionOptions) SetDeprecatePending(deprecatePending *DeprecatePending) *UpdateVersionOptions { + _options.DeprecatePending = deprecatePending return _options } -// SetOfferingID : Allow user to set OfferingID -func (_options *UpdateOfferingOptions) SetOfferingID(offeringID string) *UpdateOfferingOptions { - _options.OfferingID = core.StringPtr(offeringID) +// SetProductKind : Allow user to set ProductKind +func (_options *UpdateVersionOptions) SetProductKind(productKind string) *UpdateVersionOptions { + _options.ProductKind = core.StringPtr(productKind) return _options } -// SetIfMatch : Allow user to set IfMatch -func (_options *UpdateOfferingOptions) SetIfMatch(ifMatch string) *UpdateOfferingOptions { - _options.IfMatch = core.StringPtr(ifMatch) +// SetBadges : Allow user to set Badges +func (_options *UpdateVersionOptions) SetBadges(badges []Badge) *UpdateVersionOptions { + _options.Badges = badges return _options } -// SetUpdates : Allow user to set Updates -func (_options *UpdateOfferingOptions) SetUpdates(updates []JSONPatchOperation) *UpdateOfferingOptions { - _options.Updates = updates +// SetPlans : Allow user to set Plans +func (_options *UpdateVersionOptions) SetPlans(plans []Plan) *UpdateVersionOptions { + _options.Plans = plans return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateOfferingOptions) SetHeaders(param map[string]string) *UpdateOfferingOptions { +func (options *UpdateVersionOptions) SetHeaders(param map[string]string) *UpdateVersionOptions { options.Headers = param return options } -// UpdateShareApprovalListAsSourceOptions : The UpdateShareApprovalListAsSource options. -type UpdateShareApprovalListAsSourceOptions struct { - // The type for the object. - ObjectType *string `json:"object_type" validate:"required,ne="` - - // The different possible approval states for share requests or access request. - ApprovalStateIdentifier *string `json:"approval_state_identifier" validate:"required,ne="` +// ValidateInputsOptions : The ValidateInputs options. +type ValidateInputsOptions struct { + // A dotted value of `catalogID`.`versionID`. + VersionLocID *string `json:"version_loc_id" validate:"required,ne="` - // A list of accesses to update to the specified approval state. - Accesses []string `json:"accesses" validate:"required"` + // A deployment variable to validate. + Input1 *string `json:"input1,omitempty"` - // Execute the request in the context of an enterprise or enterpise account group ID. Use '-ent-enterpriseid' for an - // enterprise and '-entgrp-enterprisegroupid for an enterprise group. - EnterpriseID *string `json:"enterprise_id,omitempty"` + // Another deployment variable to validate. + Input2 *string `json:"input2,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } -// Constants associated with the UpdateShareApprovalListAsSourceOptions.ObjectType property. -// The type for the object. -const ( - UpdateShareApprovalListAsSourceOptionsObjectTypeOfferingConst = "offering" - UpdateShareApprovalListAsSourceOptionsObjectTypePresetConfigurationConst = "preset_configuration" - UpdateShareApprovalListAsSourceOptionsObjectTypeProxySourceConst = "proxy_source" - UpdateShareApprovalListAsSourceOptionsObjectTypeVpeConst = "vpe" -) - -// Constants associated with the UpdateShareApprovalListAsSourceOptions.ApprovalStateIdentifier property. -// The different possible approval states for share requests or access request. -const ( - UpdateShareApprovalListAsSourceOptionsApprovalStateIdentifierApprovedConst = "approved" - UpdateShareApprovalListAsSourceOptionsApprovalStateIdentifierPendingConst = "pending" - UpdateShareApprovalListAsSourceOptionsApprovalStateIdentifierRejectedConst = "rejected" -) - -// NewUpdateShareApprovalListAsSourceOptions : Instantiate UpdateShareApprovalListAsSourceOptions -func (*CatalogManagementV1) NewUpdateShareApprovalListAsSourceOptions(objectType string, approvalStateIdentifier string, accesses []string) *UpdateShareApprovalListAsSourceOptions { - return &UpdateShareApprovalListAsSourceOptions{ - ObjectType: core.StringPtr(objectType), - ApprovalStateIdentifier: core.StringPtr(approvalStateIdentifier), - Accesses: accesses, +// NewValidateInputsOptions : Instantiate ValidateInputsOptions +func (*CatalogManagementV1) NewValidateInputsOptions(versionLocID string) *ValidateInputsOptions { + return &ValidateInputsOptions{ + VersionLocID: core.StringPtr(versionLocID), } } -// SetObjectType : Allow user to set ObjectType -func (_options *UpdateShareApprovalListAsSourceOptions) SetObjectType(objectType string) *UpdateShareApprovalListAsSourceOptions { - _options.ObjectType = core.StringPtr(objectType) - return _options -} - -// SetApprovalStateIdentifier : Allow user to set ApprovalStateIdentifier -func (_options *UpdateShareApprovalListAsSourceOptions) SetApprovalStateIdentifier(approvalStateIdentifier string) *UpdateShareApprovalListAsSourceOptions { - _options.ApprovalStateIdentifier = core.StringPtr(approvalStateIdentifier) +// SetVersionLocID : Allow user to set VersionLocID +func (_options *ValidateInputsOptions) SetVersionLocID(versionLocID string) *ValidateInputsOptions { + _options.VersionLocID = core.StringPtr(versionLocID) return _options } -// SetAccesses : Allow user to set Accesses -func (_options *UpdateShareApprovalListAsSourceOptions) SetAccesses(accesses []string) *UpdateShareApprovalListAsSourceOptions { - _options.Accesses = accesses +// SetInput1 : Allow user to set Input1 +func (_options *ValidateInputsOptions) SetInput1(input1 string) *ValidateInputsOptions { + _options.Input1 = core.StringPtr(input1) return _options } -// SetEnterpriseID : Allow user to set EnterpriseID -func (_options *UpdateShareApprovalListAsSourceOptions) SetEnterpriseID(enterpriseID string) *UpdateShareApprovalListAsSourceOptions { - _options.EnterpriseID = core.StringPtr(enterpriseID) +// SetInput2 : Allow user to set Input2 +func (_options *ValidateInputsOptions) SetInput2(input2 string) *ValidateInputsOptions { + _options.Input2 = core.StringPtr(input2) return _options } // SetHeaders : Allow user to set Headers -func (options *UpdateShareApprovalListAsSourceOptions) SetHeaders(param map[string]string) *UpdateShareApprovalListAsSourceOptions { +func (options *ValidateInputsOptions) SetHeaders(param map[string]string) *ValidateInputsOptions { options.Headers = param return options } @@ -22652,6 +24557,9 @@ type ValidateInstallOptions struct { // Validation override values. Required for virtual server image for VPC. OverrideValues *DeployRequestBodyOverrideValues `json:"override_values,omitempty"` + // Used when the product has required dependencies, to indicated existing dependencies to reuse during validation. + DependencyConfigs []string `json:"dependency_configs,omitempty"` + // Schematics environment variables to use with this workspace. EnvironmentVariables []DeployRequestBodyEnvironmentVariablesItem `json:"environment_variables,omitempty"` @@ -22697,7 +24605,7 @@ type ValidateInstallOptions struct { // The name of a target account context on a catalog. TargetContextName *string `json:"targetContextName,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -22757,6 +24665,12 @@ func (_options *ValidateInstallOptions) SetOverrideValues(overrideValues *Deploy return _options } +// SetDependencyConfigs : Allow user to set DependencyConfigs +func (_options *ValidateInstallOptions) SetDependencyConfigs(dependencyConfigs []string) *ValidateInstallOptions { + _options.DependencyConfigs = dependencyConfigs + return _options +} + // SetEnvironmentVariables : Allow user to set EnvironmentVariables func (_options *ValidateInstallOptions) SetEnvironmentVariables(environmentVariables []DeployRequestBodyEnvironmentVariablesItem) *ValidateInstallOptions { _options.EnvironmentVariables = environmentVariables @@ -23220,54 +25134,193 @@ func UnmarshalVersion(m map[string]json.RawMessage, result interface{}) (err err err = core.SDKErrorf(err, "", "long_description-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "long_description_i18n", &obj.LongDescriptionI18n) + err = core.UnmarshalPrimitive(m, "long_description_i18n", &obj.LongDescriptionI18n) + if err != nil { + err = core.SDKErrorf(err, "", "long_description_i18n-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "whitelisted_accounts", &obj.WhitelistedAccounts) + if err != nil { + err = core.SDKErrorf(err, "", "whitelisted_accounts-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "image_pull_key_name", &obj.ImagePullKeyName) + if err != nil { + err = core.SDKErrorf(err, "", "image_pull_key_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "deprecate_pending", &obj.DeprecatePending, UnmarshalDeprecatePending) + if err != nil { + err = core.SDKErrorf(err, "", "deprecate_pending-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "solution_info", &obj.SolutionInfo, UnmarshalSolutionInfo) + if err != nil { + err = core.SDKErrorf(err, "", "solution_info-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "is_consumable", &obj.IsConsumable) + if err != nil { + err = core.SDKErrorf(err, "", "is_consumable-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "compliance_v3", &obj.ComplianceV3, UnmarshalCompliance) + if err != nil { + err = core.SDKErrorf(err, "", "compliance_v3-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "change_notices", &obj.ChangeNotices, UnmarshalChangeNotices) + if err != nil { + err = core.SDKErrorf(err, "", "change_notices-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "plan_ids", &obj.PlanIds) + if err != nil { + err = core.SDKErrorf(err, "", "plan_ids-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "stack", &obj.Stack) + if err != nil { + err = core.SDKErrorf(err, "", "stack-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VersionDependant : Version dependency on a VersionLocator. +type VersionDependant struct { + // The start token used for this response. + Start *string `json:"start,omitempty"` + + // The limit that was applied to this response. It may be smaller than in the request because that was too large. + Limit *int64 `json:"limit" validate:"required"` + + // The total count of resources in the system that matches the request. + TotalCount *int64 `json:"total_count,omitempty"` + + // The number of resources returned in this response. + ResourceCount *int64 `json:"resource_count" validate:"required"` + + Version *VersionDependantVersion `json:"version,omitempty"` + + // Link response on a token paginated query. + Next *PaginationTokenLink `json:"next,omitempty"` + + // Link response on a token paginated query. + Prev *PaginationTokenLink `json:"prev,omitempty"` + + // Link response on a token paginated query. + Last *PaginationTokenLink `json:"last,omitempty"` +} + +// UnmarshalVersionDependant unmarshals an instance of VersionDependant from the specified map of raw messages. +func UnmarshalVersionDependant(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VersionDependant) + err = core.UnmarshalPrimitive(m, "start", &obj.Start) + if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_count", &obj.ResourceCount) + if err != nil { + err = core.SDKErrorf(err, "", "resource_count-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "version", &obj.Version, UnmarshalVersionDependantVersion) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationTokenLink) if err != nil { - err = core.SDKErrorf(err, "", "long_description_i18n-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "whitelisted_accounts", &obj.WhitelistedAccounts) + err = core.UnmarshalModel(m, "prev", &obj.Prev, UnmarshalPaginationTokenLink) if err != nil { - err = core.SDKErrorf(err, "", "whitelisted_accounts-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "prev-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "image_pull_key_name", &obj.ImagePullKeyName) + err = core.UnmarshalModel(m, "last", &obj.Last, UnmarshalPaginationTokenLink) if err != nil { - err = core.SDKErrorf(err, "", "image_pull_key_name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "last-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "deprecate_pending", &obj.DeprecatePending, UnmarshalDeprecatePending) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VersionDependantVersion : VersionDependantVersion struct +type VersionDependantVersion struct { + // Dependant account. + AccountID *string `json:"account_id,omitempty"` + + // Dependant Catalog. + CatalogID *string `json:"catalog_id,omitempty"` + + // Dependant Offering. + OfferingID *string `json:"offering_id,omitempty"` + + // Dependant Version. + VersionID *string `json:"version_id,omitempty"` + + // Dependant (semver) version. + Version *string `json:"version,omitempty"` + + // Dependant variation. + Flavor *string `json:"flavor,omitempty"` + + // Dependencies semver range. + Semver *string `json:"semver,omitempty"` +} + +// UnmarshalVersionDependantVersion unmarshals an instance of VersionDependantVersion from the specified map of raw messages. +func UnmarshalVersionDependantVersion(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VersionDependantVersion) + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) if err != nil { - err = core.SDKErrorf(err, "", "deprecate_pending-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "solution_info", &obj.SolutionInfo, UnmarshalSolutionInfo) + err = core.UnmarshalPrimitive(m, "catalog_id", &obj.CatalogID) if err != nil { - err = core.SDKErrorf(err, "", "solution_info-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "catalog_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "is_consumable", &obj.IsConsumable) + err = core.UnmarshalPrimitive(m, "offering_id", &obj.OfferingID) if err != nil { - err = core.SDKErrorf(err, "", "is_consumable-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "offering_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "compliance_v3", &obj.ComplianceV3, UnmarshalCompliance) + err = core.UnmarshalPrimitive(m, "version_id", &obj.VersionID) if err != nil { - err = core.SDKErrorf(err, "", "compliance_v3-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "version_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "change_notices", &obj.ChangeNotices, UnmarshalChangeNotices) + err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "change_notices-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "plan_ids", &obj.PlanIds) + err = core.UnmarshalPrimitive(m, "flavor", &obj.Flavor) if err != nil { - err = core.SDKErrorf(err, "", "plan_ids-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "flavor-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "stack", &obj.Stack) + err = core.UnmarshalPrimitive(m, "semver", &obj.Semver) if err != nil { - err = core.SDKErrorf(err, "", "stack-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "semver-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -23324,6 +25377,79 @@ func UnmarshalVersionEntitlement(m map[string]json.RawMessage, result interface{ return } +// VersionInputValidationResponse : Validate deployment variables. +type VersionInputValidationResponse struct { + // Failure message. + Message *string `json:"message,omitempty"` + + // Response code. + Code *string `json:"code,omitempty"` + + // Transaction ID. + GlobalTransactionID *string `json:"global_transaction_id,omitempty"` + + // Transaction ID. + Errors []VersionInputValidationResponseErrorsItem `json:"errors,omitempty"` +} + +// UnmarshalVersionInputValidationResponse unmarshals an instance of VersionInputValidationResponse from the specified map of raw messages. +func UnmarshalVersionInputValidationResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VersionInputValidationResponse) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "global_transaction_id", &obj.GlobalTransactionID) + if err != nil { + err = core.SDKErrorf(err, "", "global_transaction_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalVersionInputValidationResponseErrorsItem) + if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VersionInputValidationResponseErrorsItem : VersionInputValidationResponseErrorsItem struct +type VersionInputValidationResponseErrorsItem struct { + Message *string `json:"message,omitempty"` + + Entity *string `json:"entity,omitempty"` + + ErrorCode *string `json:"error_code,omitempty"` +} + +// UnmarshalVersionInputValidationResponseErrorsItem unmarshals an instance of VersionInputValidationResponseErrorsItem from the specified map of raw messages. +func UnmarshalVersionInputValidationResponseErrorsItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VersionInputValidationResponseErrorsItem) + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "entity", &obj.Entity) + if err != nil { + err = core.SDKErrorf(err, "", "entity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "error_code", &obj.ErrorCode) + if err != nil { + err = core.SDKErrorf(err, "", "error_code-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VersionRange : Version range information. type VersionRange struct { // Format kinds that this plan applies to in the current offering. If empty, applies to all kinds. @@ -23441,6 +25567,96 @@ func UnmarshalVersionUpdateDescriptor(m map[string]json.RawMessage, result inter return } +// VersionsResult : Paginated search result for Versions. +type VersionsResult struct { + // The start token used for this response. + Start *string `json:"start,omitempty"` + + // The limit that was applied to this response. It may be smaller than in the request because that was too large. + Limit *int64 `json:"limit" validate:"required"` + + // The total count of resources in the system that matches the request. + TotalCount *int64 `json:"total_count,omitempty"` + + // The number of resources returned in this response. + ResourceCount *int64 `json:"resource_count" validate:"required"` + + // Link response on a token paginated query. + First *PaginationTokenLink `json:"first" validate:"required"` + + // Link response on a token paginated query. + Next *PaginationTokenLink `json:"next,omitempty"` + + // Link response on a token paginated query. + Prev *PaginationTokenLink `json:"prev,omitempty"` + + // Link response on a token paginated query. + Last *PaginationTokenLink `json:"last,omitempty"` + + // A list of versions. + Versions []Version `json:"versions" validate:"required"` +} + +// UnmarshalVersionsResult unmarshals an instance of VersionsResult from the specified map of raw messages. +func UnmarshalVersionsResult(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VersionsResult) + err = core.UnmarshalPrimitive(m, "start", &obj.Start) + if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_count", &obj.ResourceCount) + if err != nil { + err = core.SDKErrorf(err, "", "resource_count-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "prev", &obj.Prev, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "prev-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "last", &obj.Last, UnmarshalPaginationTokenLink) + if err != nil { + err = core.SDKErrorf(err, "", "last-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalVersion) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) + 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 *VersionsResult) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + // WeeklyMetricBucket : Statistics for a given week. type WeeklyMetricBucket struct { // ISO based YearWeek index yyyyww, e.g., 202303 for third week in 2003. @@ -24270,6 +26486,91 @@ func (pager *GetOfferingAccessListPager) GetAll() (allItems []Access, err error) return } +// GetVersionsPager can be used to simplify the use of the "GetVersions" method. +type GetVersionsPager struct { + hasNext bool + options *GetVersionsOptions + client *CatalogManagementV1 + pageContext struct { + next *string + } +} + +// NewGetVersionsPager returns a new GetVersionsPager instance. +func (catalogManagement *CatalogManagementV1) NewGetVersionsPager(options *GetVersionsOptions) (pager *GetVersionsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy GetVersionsOptions = *options + pager = &GetVersionsPager{ + hasNext: true, + options: &optionsCopy, + client: catalogManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *GetVersionsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *GetVersionsPager) GetNextWithContext(ctx context.Context) (page []Version, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.GetVersionsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Versions + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *GetVersionsPager) GetAllWithContext(ctx context.Context) (allItems []Version, err error) { + for pager.HasNext() { + var nextPage []Version + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *GetVersionsPager) GetNext() (page []Version, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *GetVersionsPager) GetAll() (allItems []Version, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // GetNamespacesPager can be used to simplify the use of the "GetNamespaces" method. type GetNamespacesPager struct { hasNext bool diff --git a/catalogmanagementv1/catalog_management_v1_examples_test.go b/catalogmanagementv1/catalog_management_v1_examples_test.go index 5b0bde50..a0985523 100644 --- a/catalogmanagementv1/catalog_management_v1_examples_test.go +++ b/catalogmanagementv1/catalog_management_v1_examples_test.go @@ -63,12 +63,14 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() { catalogID string objectCatalogID string offeringID string + kindID string clusterID string objectID string offeringInstanceID string versionLocatorID string planID string approverToken string + offeringVersion *catalogmanagementv1.Offering ) var shouldSkipTest = func() { @@ -420,6 +422,7 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() { versionLocatorID = *offering.Kinds[0].Versions[0].VersionLocator offeringID = *offering.ID + kindID = *offering.Kinds[0].ID }) It(`GetOfferingChangeNotices request example`, func() { @@ -537,6 +540,46 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() { Expect(account).ToNot(BeNil()) }) + It(`ListRegions request example`, func() { + fmt.Println("\nListRegions() result:") + // begin-list_regions + + listRegionOptions := catalogManagementService.NewListRegionsOptions() + + regions, response, err := catalogManagementService.ListRegions(listRegionOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(regions, "", " ") + fmt.Println(string(b)) + + // end-list_regions + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(regions).ToNot(BeNil()) + }) + + It(`PreviewRegions request example`, func() { + fmt.Println("\nPreviewRegions() result:") + // begin-preview_regions + + previewRegionOptions := catalogManagementService.NewPreviewRegionsOptions() + + regions, response, err := catalogManagementService.PreviewRegions(previewRegionOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(regions, "", " ") + fmt.Println(string(b)) + + // end-preview_regions + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(regions).ToNot(BeNil()) + }) + It(`UpdateCatalogAccount request example`, func() { Skip("Skipped bby design.") // begin-update_catalog_account @@ -770,6 +813,165 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() { Expect(offering).ToNot(BeNil()) }) + It(`GetVersions request example`, func() { + fmt.Println("\nGetVersions() result:") + // begin-get_versions + + getVersionsOptions := catalogManagementService.NewGetVersionsOptions( + catalogID, + offeringID, + kindID, + ) + + versions, response, err := catalogManagementService.GetVersions(getVersionsOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(versions, "", " ") + fmt.Println(string(b)) + + // end-get_versions + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(versions).ToNot(BeNil()) + }) + + It(`GetVersion request example`, func() { + fmt.Println("\nGetVersion() result:") + // begin-get_version + + getVersionOptions := catalogManagementService.NewGetVersionOptions( + versionLocatorID, + ) + + offering, response, err := catalogManagementService.GetVersion(getVersionOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(offering, "", " ") + fmt.Println(string(b)) + + // end-get_version + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(offering).ToNot(BeNil()) + + offeringVersion = offering + }) + + It(`GetVersionDependencies request example`, func() { + fmt.Println("\nGetVersionDependencies() result:") + // begin-get_version_dependencies + + getVersionDependenciesOptions := catalogManagementService.NewGetVersionDependenciesOptions( + versionLocatorID, + ) + + version, response, err := catalogManagementService.GetVersionDependencies(getVersionDependenciesOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(version, "", " ") + fmt.Println(string(b)) + + // end-get_version_dependencies + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(version).ToNot(BeNil()) + }) + + It(`ValidateInputs request example`, func() { + fmt.Println("\nValidateInputs() result:") + // begin-validate_inputs + + validateInputsOptions := catalogManagementService.NewValidateInputsOptions( + versionLocatorID, + ) + validateInputsOptions.SetInput1("testString1") + validateInputsOptions.SetInput2("testString2") + + resp, response, err := catalogManagementService.ValidateInputs(validateInputsOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(resp, "", " ") + fmt.Println(string(b)) + + // end-validate_inputs + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(resp).ToNot(BeNil()) + }) + + It(`UpdateVersion request example`, func() { + fmt.Println("\nUpdateVersion() result:") + // begin-update_version + + updateVersionOptions := catalogManagementService.NewUpdateVersionOptions( + versionLocatorID, + ) + + updateVersionOptions.ID = offeringVersion.ID + updateVersionOptions.CatalogID = offeringVersion.CatalogID + updateVersionOptions.Rev = offeringVersion.Rev + updateVersionOptions.URL = offeringVersion.URL + updateVersionOptions.CRN = offeringVersion.CRN + updateVersionOptions.Label = offeringVersion.Label + updateVersionOptions.Kinds = offeringVersion.Kinds + + offering, response, err := catalogManagementService.UpdateVersion(updateVersionOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(offering, "", " ") + fmt.Println(string(b)) + + // end-update_version + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(offering).ToNot(BeNil()) + + offeringVersion = offering + }) + + It(`PatchUpdateVersion request example`, func() { + fmt.Println("\nPatchUpdateVersion() result:") + // begin-patch_update_version + + jsonPatchOperationModel := &catalogmanagementv1.JSONPatchOperation{ + Op: core.StringPtr("replace"), + Path: core.StringPtr("/kinds/0/versions/0/long_description"), + Value: core.StringPtr("testString"), + } + + patchUpdateVersionOptions := catalogManagementService.NewPatchUpdateVersionOptions( + versionLocatorID, + fmt.Sprintf("\"%s\"", *offeringVersion.Rev), + ) + + patchUpdateVersionOptions.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + + offering, response, err := catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptions) + if err != nil { + panic(err) + } + b, _ := json.MarshalIndent(offering, "", " ") + fmt.Println(string(b)) + + // end-patch_update_version + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(offering).ToNot(BeNil()) + + offeringVersion = offering + }) + // Offering must be "managed in Partner Center" before we can perform plan operations // Done with helper API call as we do not expose this route in our api definition It(`SetAllowPublishOffering`, func() { @@ -777,7 +979,7 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() { "X-Approver-Token": approverToken, } - response, err := catalogManagementService.SetAllowPublishOffering(catalogID, offeringID, headers) + response, err := catalogManagementService.SetAllowPublishOffering(catalogID, offeringID, "publish_approved", true, headers) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) }) @@ -1774,6 +1976,17 @@ var _ = Describe(`CatalogManagementV1 Examples Tests`, func() { Expect(response.StatusCode).To(Equal(200)) }) + // Unset pc managed + It(`SetAllowPublishOffering`, func() { + headers := map[string]string{ + "X-Approver-Token": approverToken, + } + + response, err := catalogManagementService.SetAllowPublishOffering(catalogID, offeringID, "pc_managed", false, headers) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + }) + It(`DeleteOffering request example`, func() { // begin-delete_offering diff --git a/catalogmanagementv1/catalog_management_v1_integration_test.go b/catalogmanagementv1/catalog_management_v1_integration_test.go index 76562a19..5402773c 100644 --- a/catalogmanagementv1/catalog_management_v1_integration_test.go +++ b/catalogmanagementv1/catalog_management_v1_integration_test.go @@ -66,8 +66,10 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() { offeringRevLink string versionIDLink string versionLocatorLink string + kindIDLink string versionRevLink string planIDLink string + offeringVersion *catalogmanagementv1.Offering ) var shouldSkipTest = func() { @@ -151,6 +153,34 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() { }) }) + Describe(`ListRegions - get list of available regions`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`ListRegions`, func() { + listRegionOptions := catalogManagementService.NewListRegionsOptions() + + regions, response, err := catalogManagementService.ListRegions(listRegionOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(regions).ToNot(BeNil()) + }) + }) + + Describe(`PreviewRegions - preview list of available regions`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`PreviewRegions`, func() { + previewRegionOptions := catalogManagementService.NewPreviewRegionsOptions() + + regions, response, err := catalogManagementService.PreviewRegions(previewRegionOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(regions).ToNot(BeNil()) + }) + }) + Describe(`UpdateCatalogAccount - Update account settings`, func() { BeforeEach(func() { shouldSkipTest() @@ -861,6 +891,8 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() { offeringIDLink = *offering.ID fmt.Fprintf(GinkgoWriter, "Saved offeringIDLink value: %v\n", offeringIDLink) + kindIDLink = *offering.Kinds[0].ID + fmt.Fprintf(GinkgoWriter, "Saved kindIDLink value: %v\n", kindIDLink) offeringRevLink = *offering.Rev fmt.Fprintf(GinkgoWriter, "Saved offeringRevLink value: %v\n", offeringRevLink) versionLocatorLink = *offering.Kinds[0].Versions[0].VersionLocator @@ -872,6 +904,129 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() { }) }) + Describe(`GetVersions - get versions for a kind`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`GetVersions`, func() { + getVersionsOptions := catalogManagementService.NewGetVersionsOptions( + catalogIDLink, + offeringIDLink, + kindIDLink, + ) + + versions, response, err := catalogManagementService.GetVersions(getVersionsOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(versions).ToNot(BeNil()) + }) + }) + + Describe(`GetVersion - get a single version`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`GetVersion`, func() { + getVersionOptions := catalogManagementService.NewGetVersionOptions( + versionLocatorLink, + ) + + offering, response, err := catalogManagementService.GetVersion(getVersionOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(offering).ToNot(BeNil()) + + offeringVersion = offering + }) + }) + + Describe(`GetVersionDependencies - get a versions dependencies`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`GetVersionDependencies`, func() { + getVersionDependenciesOptions := catalogManagementService.NewGetVersionDependenciesOptions( + versionLocatorLink, + ) + + version, response, err := catalogManagementService.GetVersionDependencies(getVersionDependenciesOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(version).ToNot(BeNil()) + }) + }) + + Describe(`ValidateInputs - validate a versions inputs`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`ValidateInputs`, func() { + validateInputsOptions := catalogManagementService.NewValidateInputsOptions( + versionLocatorLink, + ) + validateInputsOptions.SetInput1("testString1") + validateInputsOptions.SetInput2("testString2") + + resp, response, err := catalogManagementService.ValidateInputs(validateInputsOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(resp).ToNot(BeNil()) + }) + }) + + Describe(`UpdateVersion - update a single version`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`UpdateVersion`, func() { + updateVersionOptions := catalogManagementService.NewUpdateVersionOptions( + versionLocatorLink, + ) + + updateVersionOptions.ID = offeringVersion.ID + updateVersionOptions.CatalogID = offeringVersion.CatalogID + updateVersionOptions.Rev = offeringVersion.Rev + updateVersionOptions.URL = offeringVersion.URL + updateVersionOptions.CRN = offeringVersion.CRN + updateVersionOptions.Label = offeringVersion.Label + updateVersionOptions.Kinds = offeringVersion.Kinds + + offering, response, err := catalogManagementService.UpdateVersion(updateVersionOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(offering).ToNot(BeNil()) + + offeringVersion = offering + }) + }) + + Describe(`PatchUpdateVersion - get a single version`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`PatchUpdateVersion`, func() { + jsonPatchOperationModel := &catalogmanagementv1.JSONPatchOperation{ + Op: core.StringPtr("replace"), + Path: core.StringPtr("/kinds/0/versions/0/long_description"), + Value: core.StringPtr("testString"), + } + + patchUpdateVersionOptions := catalogManagementService.NewPatchUpdateVersionOptions( + versionLocatorLink, + fmt.Sprintf("\"%s\"", *offeringVersion.Rev), + ) + + patchUpdateVersionOptions.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + + offering, response, err := catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(offering).ToNot(BeNil()) + + offeringVersion = offering + }) + }) + // Offering must be "managed in Partner Center" before we can perform plan operations // Done with helper API call as we do not expose this route in our api definition Describe(`SetAllowPublishOffering - mark offering as pc managed`, func() { @@ -883,7 +1038,7 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() { "X-Approver-Token": approverToken, } - response, err := catalogManagementService.SetAllowPublishOffering(catalogIDLink, offeringIDLink, headers) + response, err := catalogManagementService.SetAllowPublishOffering(catalogIDLink, offeringIDLink, "publish_approved", true, headers) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) }) @@ -3346,6 +3501,22 @@ var _ = Describe(`CatalogManagementV1 Integration Tests`, func() { }) }) + // Unset pc managed + Describe(`SetAllowPublishOffering - mark offering as not pc managed`, func() { + BeforeEach(func() { + shouldSkipTest() + }) + It(`SetAllowPublishOffering`, func() { + headers := map[string]string{ + "X-Approver-Token": approverToken, + } + + response, err := catalogManagementService.SetAllowPublishOffering(catalogIDLink, offeringIDLink, "pc_managed", false, headers) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + }) + }) + Describe(`DeleteOffering - Delete offering`, func() { BeforeEach(func() { shouldSkipTest() diff --git a/catalogmanagementv1/catalog_management_v1_test.go b/catalogmanagementv1/catalog_management_v1_test.go index 5c5298a3..f60e2c65 100644 --- a/catalogmanagementv1/catalog_management_v1_test.go +++ b/catalogmanagementv1/catalog_management_v1_test.go @@ -223,7 +223,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}, "region_filters": ["RegionFilters"], "filtered_regions": ["FilteredRegions"], "filter_regions": false}`) })) }) It(`Invoke GetCatalogAccount successfully with retries`, func() { @@ -276,7 +276,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}, "region_filters": ["RegionFilters"], "filtered_regions": ["FilteredRegions"], "filter_regions": false}`) })) }) It(`Invoke GetCatalogAccount successfully`, func() { @@ -412,6 +412,9 @@ var _ = Describe(`CatalogManagementV1`, func() { updateCatalogAccountOptionsModel.Rev = core.StringPtr("testString") updateCatalogAccountOptionsModel.HideIBMCloudCatalog = core.BoolPtr(true) updateCatalogAccountOptionsModel.AccountFilters = filtersModel + updateCatalogAccountOptionsModel.RegionFilters = []string{"testString"} + updateCatalogAccountOptionsModel.FilteredRegions = []string{"testString"} + updateCatalogAccountOptionsModel.FilterRegions = core.BoolPtr(true) updateCatalogAccountOptionsModel.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 := catalogManagementService.UpdateCatalogAccount(updateCatalogAccountOptionsModel) @@ -464,7 +467,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}, "region_filters": ["RegionFilters"], "filtered_regions": ["FilteredRegions"], "filter_regions": false}`) })) }) It(`Invoke UpdateCatalogAccount successfully with retries`, func() { @@ -503,6 +506,9 @@ var _ = Describe(`CatalogManagementV1`, func() { updateCatalogAccountOptionsModel.Rev = core.StringPtr("testString") updateCatalogAccountOptionsModel.HideIBMCloudCatalog = core.BoolPtr(true) updateCatalogAccountOptionsModel.AccountFilters = filtersModel + updateCatalogAccountOptionsModel.RegionFilters = []string{"testString"} + updateCatalogAccountOptionsModel.FilteredRegions = []string{"testString"} + updateCatalogAccountOptionsModel.FilterRegions = core.BoolPtr(true) updateCatalogAccountOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -558,7 +564,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "hide_IBM_cloud_catalog": false, "account_filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}, "region_filters": ["RegionFilters"], "filtered_regions": ["FilteredRegions"], "filter_regions": false}`) })) }) It(`Invoke UpdateCatalogAccount successfully`, func() { @@ -602,6 +608,9 @@ var _ = Describe(`CatalogManagementV1`, func() { updateCatalogAccountOptionsModel.Rev = core.StringPtr("testString") updateCatalogAccountOptionsModel.HideIBMCloudCatalog = core.BoolPtr(true) updateCatalogAccountOptionsModel.AccountFilters = filtersModel + updateCatalogAccountOptionsModel.RegionFilters = []string{"testString"} + updateCatalogAccountOptionsModel.FilteredRegions = []string{"testString"} + updateCatalogAccountOptionsModel.FilterRegions = core.BoolPtr(true) updateCatalogAccountOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -646,6 +655,9 @@ var _ = Describe(`CatalogManagementV1`, func() { updateCatalogAccountOptionsModel.Rev = core.StringPtr("testString") updateCatalogAccountOptionsModel.HideIBMCloudCatalog = core.BoolPtr(true) updateCatalogAccountOptionsModel.AccountFilters = filtersModel + updateCatalogAccountOptionsModel.RegionFilters = []string{"testString"} + updateCatalogAccountOptionsModel.FilteredRegions = []string{"testString"} + updateCatalogAccountOptionsModel.FilterRegions = core.BoolPtr(true) updateCatalogAccountOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") @@ -704,6 +716,9 @@ var _ = Describe(`CatalogManagementV1`, func() { updateCatalogAccountOptionsModel.Rev = core.StringPtr("testString") updateCatalogAccountOptionsModel.HideIBMCloudCatalog = core.BoolPtr(true) updateCatalogAccountOptionsModel.AccountFilters = filtersModel + updateCatalogAccountOptionsModel.RegionFilters = []string{"testString"} + updateCatalogAccountOptionsModel.FilteredRegions = []string{"testString"} + updateCatalogAccountOptionsModel.FilterRegions = core.BoolPtr(true) updateCatalogAccountOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -1318,7 +1333,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"hide_IBM_cloud_catalog": false, "account_filters": [{"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}], "catalog_filters": [{"catalog": {"id": "ID", "name": "Name"}, "filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}]}`) + fmt.Fprintf(res, "%s", `{"hide_IBM_cloud_catalog": false, "account_filters": [{"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}], "catalog_filters": [{"catalog": {"id": "ID", "name": "Name"}, "filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}], "region_filters": ["RegionFilters"], "filtered_regions": ["FilteredRegions"], "filter_regions": false}`) })) }) It(`Invoke GetCatalogAccountFilters successfully with retries`, func() { @@ -1373,7 +1388,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"hide_IBM_cloud_catalog": false, "account_filters": [{"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}], "catalog_filters": [{"catalog": {"id": "ID", "name": "Name"}, "filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}]}`) + fmt.Fprintf(res, "%s", `{"hide_IBM_cloud_catalog": false, "account_filters": [{"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}], "catalog_filters": [{"catalog": {"id": "ID", "name": "Name"}, "filters": {"include_all": true, "category_filters": {"mapKey": {"include": false, "filter": {"filter_terms": ["FilterTerms"]}}}, "id_filters": {"include": {"filter_terms": ["FilterTerms"]}, "exclude": {"filter_terms": ["FilterTerms"]}}}}], "region_filters": ["RegionFilters"], "filtered_regions": ["FilteredRegions"], "filter_regions": false}`) })) }) It(`Invoke GetCatalogAccountFilters successfully`, func() { @@ -5610,7 +5625,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) })) }) It(`Invoke GetConsumptionOfferings successfully with retries`, func() { @@ -5675,7 +5690,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) })) }) It(`Invoke GetConsumptionOfferings successfully`, func() { @@ -5826,9 +5841,9 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) requestNumber++ if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}]}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) + fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}],"all_versions":{"first":{"href":"Href","start":"Start"},"next":{"href":"Href","start":"Start"}}}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}]}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}],"all_versions":{"first":{"href":"Href","start":"Start"},"next":{"href":"Href","start":"Start"}}}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) } else { res.WriteHeader(400) } @@ -5970,7 +5985,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) })) }) It(`Invoke ListOfferings successfully with retries`, func() { @@ -6036,7 +6051,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}]}`) })) }) It(`Invoke ListOfferings successfully`, func() { @@ -6197,9 +6212,9 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) requestNumber++ if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}]}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) + fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}],"all_versions":{"first":{"href":"Href","start":"Start"},"next":{"href":"Href","start":"Start"}}}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}]}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","offering_icon_url":"OfferingIconURL","offering_docs_url":"OfferingDocsURL","offering_support_url":"OfferingSupportURL","tags":["Tags"],"keywords":["Keywords"],"rating":{"one_star_count":12,"two_star_count":12,"three_star_count":14,"four_star_count":13},"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"kinds":[{"id":"ID","format_kind":"FormatKind","format_kind_label":"FormatKindLabel","install_kind":"InstallKind","install_kind_label":"InstallKindLabel","target_kind":"TargetKind","target_kind_label":"TargetKindLabel","metadata":{"anyKey":"anyValue"},"tags":["Tags"],"additional_features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}],"all_versions":{"first":{"href":"Href","start":"Start"},"next":{"href":"Href","start":"Start"}}}],"publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"pc_managed":false,"publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"public_original_crn":"PublicOriginalCRN","publish_public_crn":"PublishPublicCRN","portal_approval_record":"PortalApprovalRecord","portal_ui_url":"PortalUIURL","catalog_id":"CatalogID","catalog_name":"CatalogName","metadata":{"anyKey":"anyValue"},"disclaimer":"Disclaimer","hidden":true,"provider":"Provider","provider_info":{"id":"ID","name":"Name"},"repo_info":{"token":"Token","type":"Type"},"image_pull_keys":[{"name":"Name","value":"Value","description":"Description"}],"support":{"url":"URL","process":"Process","process_i18n":{"mapKey":"Inner"},"locations":["Locations"],"support_details":[{"type":"Type","contact":"Contact","response_wait_time":{"value":5,"type":"Type"},"availability":{"times":[{"day":3,"start_time":"StartTime","end_time":"EndTime"}],"timezone":"Timezone","always_available":false}}],"support_escalation":{"escalation_wait_time":{"value":5,"type":"Type"},"response_wait_time":{"value":5,"type":"Type"},"contact":"Contact"},"support_type":"SupportType"},"media":[{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"}],"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"product_kind":"ProductKind","badges":[{"id":"ID","label":"Label","label_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"},"icon":"Icon","authority":"Authority","tag":"Tag","learn_more_links":{"first_party":"FirstParty","third_party":"ThirdParty"},"constraints":[{"type":"Type","rule":"anyValue"}]}],"plans":[{"id":"ID","_rev":"Rev","url":"URL","crn":"CRN","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","label":"Label","label_i18n":{"mapKey":"Inner"},"name":"Name","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"pricing_tags":["PricingTags"],"version_range":{"kinds":["Kinds"],"version":"Version","flavors":["Flavors"]},"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"metadata":{"anyKey":"anyValue"},"publish_approved":false}]}]}`) } else { res.WriteHeader(400) } @@ -6649,6 +6664,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -6664,6 +6689,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -6885,7 +6911,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke CreateOffering successfully with retries`, func() { @@ -7260,6 +7286,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -7275,6 +7311,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -7499,7 +7536,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke CreateOffering successfully`, func() { @@ -7879,6 +7916,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -7894,6 +7941,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -8443,6 +8491,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -8458,6 +8516,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -9028,6 +9087,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -9043,6 +9112,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -9297,6 +9367,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingVersionOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingVersionOptionsModel.OfferingID = core.StringPtr("testString") importOfferingVersionOptionsModel.Tags = []string{"testString"} + importOfferingVersionOptionsModel.Keywords = []string{"testString"} importOfferingVersionOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingVersionOptionsModel.Name = core.StringPtr("testString") importOfferingVersionOptionsModel.Label = core.StringPtr("testString") @@ -9376,7 +9447,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ImportOfferingVersion successfully with retries`, func() { @@ -9428,6 +9499,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingVersionOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingVersionOptionsModel.OfferingID = core.StringPtr("testString") importOfferingVersionOptionsModel.Tags = []string{"testString"} + importOfferingVersionOptionsModel.Keywords = []string{"testString"} importOfferingVersionOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingVersionOptionsModel.Name = core.StringPtr("testString") importOfferingVersionOptionsModel.Label = core.StringPtr("testString") @@ -9510,7 +9582,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ImportOfferingVersion successfully`, func() { @@ -9567,6 +9639,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingVersionOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingVersionOptionsModel.OfferingID = core.StringPtr("testString") importOfferingVersionOptionsModel.Tags = []string{"testString"} + importOfferingVersionOptionsModel.Keywords = []string{"testString"} importOfferingVersionOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingVersionOptionsModel.Name = core.StringPtr("testString") importOfferingVersionOptionsModel.Label = core.StringPtr("testString") @@ -9644,6 +9717,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingVersionOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingVersionOptionsModel.OfferingID = core.StringPtr("testString") importOfferingVersionOptionsModel.Tags = []string{"testString"} + importOfferingVersionOptionsModel.Keywords = []string{"testString"} importOfferingVersionOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingVersionOptionsModel.Name = core.StringPtr("testString") importOfferingVersionOptionsModel.Label = core.StringPtr("testString") @@ -9742,6 +9816,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingVersionOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingVersionOptionsModel.OfferingID = core.StringPtr("testString") importOfferingVersionOptionsModel.Tags = []string{"testString"} + importOfferingVersionOptionsModel.Keywords = []string{"testString"} importOfferingVersionOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingVersionOptionsModel.Name = core.StringPtr("testString") importOfferingVersionOptionsModel.Label = core.StringPtr("testString") @@ -9847,6 +9922,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingOptionsModel := new(catalogmanagementv1.ImportOfferingOptions) importOfferingOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingOptionsModel.Tags = []string{"testString"} + importOfferingOptionsModel.Keywords = []string{"testString"} importOfferingOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingOptionsModel.Name = core.StringPtr("testString") importOfferingOptionsModel.Label = core.StringPtr("testString") @@ -9928,7 +10004,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ImportOffering successfully with retries`, func() { @@ -9979,6 +10055,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingOptionsModel := new(catalogmanagementv1.ImportOfferingOptions) importOfferingOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingOptionsModel.Tags = []string{"testString"} + importOfferingOptionsModel.Keywords = []string{"testString"} importOfferingOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingOptionsModel.Name = core.StringPtr("testString") importOfferingOptionsModel.Label = core.StringPtr("testString") @@ -10063,7 +10140,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ImportOffering successfully`, func() { @@ -10119,6 +10196,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingOptionsModel := new(catalogmanagementv1.ImportOfferingOptions) importOfferingOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingOptionsModel.Tags = []string{"testString"} + importOfferingOptionsModel.Keywords = []string{"testString"} importOfferingOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingOptionsModel.Name = core.StringPtr("testString") importOfferingOptionsModel.Label = core.StringPtr("testString") @@ -10196,6 +10274,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingOptionsModel := new(catalogmanagementv1.ImportOfferingOptions) importOfferingOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingOptionsModel.Tags = []string{"testString"} + importOfferingOptionsModel.Keywords = []string{"testString"} importOfferingOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingOptionsModel.Name = core.StringPtr("testString") importOfferingOptionsModel.Label = core.StringPtr("testString") @@ -10294,6 +10373,7 @@ var _ = Describe(`CatalogManagementV1`, func() { importOfferingOptionsModel := new(catalogmanagementv1.ImportOfferingOptions) importOfferingOptionsModel.CatalogIdentifier = core.StringPtr("testString") importOfferingOptionsModel.Tags = []string{"testString"} + importOfferingOptionsModel.Keywords = []string{"testString"} importOfferingOptionsModel.Content = CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=") importOfferingOptionsModel.Name = core.StringPtr("testString") importOfferingOptionsModel.Label = core.StringPtr("testString") @@ -10374,6 +10454,7 @@ var _ = Describe(`CatalogManagementV1`, func() { reloadOfferingOptionsModel.FormatKind = core.StringPtr("testString") reloadOfferingOptionsModel.Flavor = flavorModel reloadOfferingOptionsModel.WorkingDirectory = core.StringPtr("testString") + reloadOfferingOptionsModel.InstallType = core.StringPtr("testString") reloadOfferingOptionsModel.Zipurl = core.StringPtr("testString") reloadOfferingOptionsModel.RepoType = core.StringPtr("testString") reloadOfferingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -10431,7 +10512,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ReloadOffering successfully with retries`, func() { @@ -10461,6 +10542,7 @@ var _ = Describe(`CatalogManagementV1`, func() { reloadOfferingOptionsModel.FormatKind = core.StringPtr("testString") reloadOfferingOptionsModel.Flavor = flavorModel reloadOfferingOptionsModel.WorkingDirectory = core.StringPtr("testString") + reloadOfferingOptionsModel.InstallType = core.StringPtr("testString") reloadOfferingOptionsModel.Zipurl = core.StringPtr("testString") reloadOfferingOptionsModel.RepoType = core.StringPtr("testString") reloadOfferingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -10521,7 +10603,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ReloadOffering successfully`, func() { @@ -10556,6 +10638,7 @@ var _ = Describe(`CatalogManagementV1`, func() { reloadOfferingOptionsModel.FormatKind = core.StringPtr("testString") reloadOfferingOptionsModel.Flavor = flavorModel reloadOfferingOptionsModel.WorkingDirectory = core.StringPtr("testString") + reloadOfferingOptionsModel.InstallType = core.StringPtr("testString") reloadOfferingOptionsModel.Zipurl = core.StringPtr("testString") reloadOfferingOptionsModel.RepoType = core.StringPtr("testString") reloadOfferingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -10593,6 +10676,7 @@ var _ = Describe(`CatalogManagementV1`, func() { reloadOfferingOptionsModel.FormatKind = core.StringPtr("testString") reloadOfferingOptionsModel.Flavor = flavorModel reloadOfferingOptionsModel.WorkingDirectory = core.StringPtr("testString") + reloadOfferingOptionsModel.InstallType = core.StringPtr("testString") reloadOfferingOptionsModel.Zipurl = core.StringPtr("testString") reloadOfferingOptionsModel.RepoType = core.StringPtr("testString") reloadOfferingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -10651,6 +10735,7 @@ var _ = Describe(`CatalogManagementV1`, func() { reloadOfferingOptionsModel.FormatKind = core.StringPtr("testString") reloadOfferingOptionsModel.Flavor = flavorModel reloadOfferingOptionsModel.WorkingDirectory = core.StringPtr("testString") + reloadOfferingOptionsModel.InstallType = core.StringPtr("testString") reloadOfferingOptionsModel.Zipurl = core.StringPtr("testString") reloadOfferingOptionsModel.RepoType = core.StringPtr("testString") reloadOfferingOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -10737,7 +10822,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke GetOffering successfully with retries`, func() { @@ -10796,7 +10881,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke GetOffering successfully`, func() { @@ -11287,6 +11372,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -11302,6 +11397,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -11526,7 +11622,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ReplaceOffering successfully with retries`, func() { @@ -11901,6 +11997,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -11916,6 +12022,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -12143,7 +12250,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke ReplaceOffering successfully`, func() { @@ -12523,6 +12630,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -12538,6 +12655,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -13090,6 +13208,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -13105,6 +13233,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -13678,6 +13807,16 @@ var _ = Describe(`CatalogManagementV1`, func() { versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} versionModel.Scripts["foo"] = *scriptRefModel + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) kindModel.ID = core.StringPtr("testString") @@ -13693,6 +13832,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -13972,7 +14112,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke UpdateOffering successfully with retries`, func() { @@ -14054,7 +14194,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) It(`Invoke UpdateOffering successfully`, func() { @@ -17955,6 +18095,359 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) + Describe(`GetVersions(getVersionsOptions *GetVersionsOptions) - Operation response error`, func() { + getVersionsPath := "/catalogs/testString/offerings/testString/kinds/testString/versions" + 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(getVersionsPath)) + Expect(req.Method).To(Equal("GET")) + // TODO: Add check for digest query parameter + // TODO: Add check for catalog query parameter + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetVersions with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetVersionsOptions model + getVersionsOptionsModel := new(catalogmanagementv1.GetVersionsOptions) + getVersionsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getVersionsOptionsModel.OfferingID = core.StringPtr("testString") + getVersionsOptionsModel.KindID = core.StringPtr("testString") + getVersionsOptionsModel.Digest = core.BoolPtr(true) + getVersionsOptionsModel.Catalog = core.BoolPtr(true) + getVersionsOptionsModel.Start = core.StringPtr("testString") + getVersionsOptionsModel.Limit = core.Int64Ptr(int64(10)) + getVersionsOptionsModel.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 := catalogManagementService.GetVersions(getVersionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetVersions(getVersionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetVersions(getVersionsOptions *GetVersionsOptions)`, func() { + getVersionsPath := "/catalogs/testString/offerings/testString/kinds/testString/versions" + 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(getVersionsPath)) + Expect(req.Method).To(Equal("GET")) + + // TODO: Add check for digest query parameter + // TODO: Add check for catalog query parameter + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // 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", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}`) + })) + }) + It(`Invoke GetVersions successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the GetVersionsOptions model + getVersionsOptionsModel := new(catalogmanagementv1.GetVersionsOptions) + getVersionsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getVersionsOptionsModel.OfferingID = core.StringPtr("testString") + getVersionsOptionsModel.KindID = core.StringPtr("testString") + getVersionsOptionsModel.Digest = core.BoolPtr(true) + getVersionsOptionsModel.Catalog = core.BoolPtr(true) + getVersionsOptionsModel.Start = core.StringPtr("testString") + getVersionsOptionsModel.Limit = core.Int64Ptr(int64(10)) + getVersionsOptionsModel.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 := catalogManagementService.GetVersionsWithContext(ctx, getVersionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetVersions(getVersionsOptionsModel) + 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 = catalogManagementService.GetVersionsWithContext(ctx, getVersionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + 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(getVersionsPath)) + Expect(req.Method).To(Equal("GET")) + + // TODO: Add check for digest query parameter + // TODO: Add check for catalog query parameter + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}`) + })) + }) + It(`Invoke GetVersions successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetVersions(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the GetVersionsOptions model + getVersionsOptionsModel := new(catalogmanagementv1.GetVersionsOptions) + getVersionsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getVersionsOptionsModel.OfferingID = core.StringPtr("testString") + getVersionsOptionsModel.KindID = core.StringPtr("testString") + getVersionsOptionsModel.Digest = core.BoolPtr(true) + getVersionsOptionsModel.Catalog = core.BoolPtr(true) + getVersionsOptionsModel.Start = core.StringPtr("testString") + getVersionsOptionsModel.Limit = core.Int64Ptr(int64(10)) + getVersionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetVersions(getVersionsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke GetVersions with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetVersionsOptions model + getVersionsOptionsModel := new(catalogmanagementv1.GetVersionsOptions) + getVersionsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getVersionsOptionsModel.OfferingID = core.StringPtr("testString") + getVersionsOptionsModel.KindID = core.StringPtr("testString") + getVersionsOptionsModel.Digest = core.BoolPtr(true) + getVersionsOptionsModel.Catalog = core.BoolPtr(true) + getVersionsOptionsModel.Start = core.StringPtr("testString") + getVersionsOptionsModel.Limit = core.Int64Ptr(int64(10)) + getVersionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetVersions(getVersionsOptionsModel) + 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 GetVersionsOptions model with no property values + getVersionsOptionsModelNew := new(catalogmanagementv1.GetVersionsOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetVersions(getVersionsOptionsModelNew) + 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 GetVersions successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetVersionsOptions model + getVersionsOptionsModel := new(catalogmanagementv1.GetVersionsOptions) + getVersionsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getVersionsOptionsModel.OfferingID = core.StringPtr("testString") + getVersionsOptionsModel.KindID = core.StringPtr("testString") + getVersionsOptionsModel.Digest = core.BoolPtr(true) + getVersionsOptionsModel.Catalog = core.BoolPtr(true) + getVersionsOptionsModel.Start = core.StringPtr("testString") + getVersionsOptionsModel.Limit = core.Int64Ptr(int64(10)) + getVersionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.GetVersions(getVersionsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextStart successfully`, func() { + responseObject := new(catalogmanagementv1.VersionsResult) + nextObject := new(catalogmanagementv1.PaginationTokenLink) + 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(catalogmanagementv1.VersionsResult) + + value, err := responseObject.GetNextStart() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + }) + Context(`Using mock server endpoint - paginated response`, func() { + BeforeEach(func() { + var requestNumber int = 0 + 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(getVersionsPath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}],"total_count":2,"limit":1}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"versions":[{"id":"ID","_rev":"Rev","crn":"CRN","version":"Version","flavor":{"name":"Name","label":"Label","label_i18n":{"mapKey":"Inner"},"index":5},"sha":"Sha","created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","offering_id":"OfferingID","catalog_id":"CatalogID","kind_id":"KindID","tags":["Tags"],"repo_url":"RepoURL","source_url":"SourceURL","tgz_url":"TgzURL","configuration":[{"key":"Key","type":"Type","default_value":"anyValue","display_name":"DisplayName","value_constraint":"ValueConstraint","description":"Description","required":true,"options":["anyValue"],"hidden":true,"custom_config":{"type":"Type","grouping":"Grouping","original_grouping":"OriginalGrouping","grouping_index":13,"config_constraints":{"anyKey":"anyValue"},"associations":{"parameters":[{"name":"Name","optionsRefresh":true}]}},"type_metadata":"TypeMetadata"}],"outputs":[{"key":"Key","description":"Description"}],"iam_permissions":[{"service_name":"ServiceName","role_crns":["RoleCrns"],"resources":[{"name":"Name","description":"Description","role_crns":["RoleCrns"]}]}],"metadata":{"anyKey":"anyValue"},"validation":{"validated":"2019-01-01T12:00:00.000Z","requested":"2019-01-01T12:00:00.000Z","state":"State","last_operation":"LastOperation","target":{"anyKey":"anyValue"},"message":"Message"},"required_resources":[{"type":"mem","value":"anyValue"}],"single_instance":true,"schematics_env_values":{"value":"[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]","sm_ref":"cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"},"install":{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"},"pre_install":[{"instructions":"Instructions","instructions_i18n":{"mapKey":"Inner"},"script":"Script","script_permission":"ScriptPermission","delete_script":"DeleteScript","scope":"Scope"}],"scripts":{"mapKey":{"short_description":"ShortDescription","type":"ansible","path":"scripts/validate-post-ansible-playbook.yaml","stage":"pre","action":"validate"}},"entitlement":{"provider_name":"ProviderName","provider_id":"ProviderID","product_id":"ProductID","part_numbers":["PartNumbers"],"image_repo_name":"ImageRepoName"},"licenses":[{"id":"ID","name":"Name","type":"Type","url":"URL","description":"Description"}],"image_manifest_url":"ImageManifestURL","deprecated":true,"package_version":"PackageVersion","state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"version_locator":"VersionLocator","long_description":"LongDescription","long_description_i18n":{"mapKey":"Inner"},"whitelisted_accounts":["WhitelistedAccounts"],"image_pull_key_name":"ImagePullKeyName","deprecate_pending":{"deprecate_date":"2019-01-01T12:00:00.000Z","deprecate_state":"DeprecateState","description":"Description"},"solution_info":{"architecture_diagrams":[{"diagram":{"url":"URL","api_url":"APIURL","url_proxy":{"url":"URL","sha":"Sha"},"caption":"Caption","caption_i18n":{"mapKey":"Inner"},"type":"Type","thumbnail_url":"ThumbnailURL"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"features":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"cost_estimate":{"version":"Version","currency":"Currency","projects":[{"name":"Name","metadata":{"anyKey":"anyValue"},"pastBreakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"breakdown":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"diff":{"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","resources":[{"name":"Name","metadata":{"anyKey":"anyValue"},"hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost","costComponents":[{"name":"Name","unit":"Unit","hourlyQuantity":"HourlyQuantity","monthlyQuantity":"MonthlyQuantity","price":"Price","hourlyCost":"HourlyCost","monthlyCost":"MonthlyCost"}]}]},"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}}}],"summary":{"totalDetectedResources":22,"totalSupportedResources":23,"totalUnsupportedResources":25,"totalUsageBasedResources":24,"totalNoPriceResources":21,"unsupportedResourceCounts":{"mapKey":5},"noPriceResourceCounts":{"mapKey":5}},"totalHourlyCost":"TotalHourlyCost","totalMonthlyCost":"TotalMonthlyCost","pastTotalHourlyCost":"PastTotalHourlyCost","pastTotalMonthlyCost":"PastTotalMonthlyCost","diffTotalHourlyCost":"DiffTotalHourlyCost","diffTotalMonthlyCost":"DiffTotalMonthlyCost","timeGenerated":"2019-01-01T12:00:00.000Z"},"dependencies":[{"catalog_id":"CatalogID","id":"ID","name":"Name","kind":"Kind","version":"Version","flavors":["Flavors"]}],"install_type":"InstallType"},"is_consumable":true,"compliance_v3":{"authority":"Authority","claims":{"profiles":[{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"}],"controls":[{"profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"names":["Names"]}]},"evaluations":[{"scan_id":"ScanID","account_id":"AccountID","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"result":{"failure_count":12,"scan_time":"2019-01-01T12:00:00.000Z","error_message":"ErrorMessage","complete_scan":true,"unscanned_resources":["UnscannedResources"]},"controls":[{"id":"ID","name":"Name","description":"Description","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"failure_count":12,"pass_count":9,"parent":{"id":"ID","name":"Name","version":"Version","description":"Description","profile":{"id":"ID","name":"Name","version":"Version","description":"Description","type":"Type","ui_href":"UIHref"},"parent_name":"ParentName","specifications":[{"id":"ID","description":"Description","component_name":"ComponentName","assessments":[{"id":"ID","description":"Description","version":"Version","type":"Type","method":"Method","ui_href":"UIHref"}],"ui_href":"UIHref"}],"ui_href":"UIHref"},"ui_href":"UIHref"}]}]},"change_notices":{"breaking":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"new":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}],"update":[{"title":"Title","title_i18n":{"mapKey":"Inner"},"description":"Description","description_i18n":{"mapKey":"Inner"}}]},"plan_ids":["PlanIds"],"stack":{"anyKey":"anyValue"}}],"total_count":2,"limit":1}`) + } else { + res.WriteHeader(400) + } + })) + }) + It(`Use GetVersionsPager.GetNext successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + getVersionsOptionsModel := &catalogmanagementv1.GetVersionsOptions{ + CatalogIdentifier: core.StringPtr("testString"), + OfferingID: core.StringPtr("testString"), + KindID: core.StringPtr("testString"), + Digest: core.BoolPtr(true), + Catalog: core.BoolPtr(true), + Limit: core.Int64Ptr(int64(10)), + } + + pager, err := catalogManagementService.NewGetVersionsPager(getVersionsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + var allResults []catalogmanagementv1.Version + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) + }) + It(`Use GetVersionsPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + getVersionsOptionsModel := &catalogmanagementv1.GetVersionsOptions{ + CatalogIdentifier: core.StringPtr("testString"), + OfferingID: core.StringPtr("testString"), + KindID: core.StringPtr("testString"), + Digest: core.BoolPtr(true), + Catalog: core.BoolPtr(true), + Limit: core.Int64Ptr(int64(10)), + } + + pager, err := catalogManagementService.NewGetVersionsPager(getVersionsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) + }) + }) + }) Describe(`GetOfferingAbout(getOfferingAboutOptions *GetOfferingAboutOptions)`, func() { getOfferingAboutPath := "/versions/testString/about" Context(`Using mock server endpoint with timeout`, func() { @@ -19206,6 +19699,7 @@ var _ = Describe(`CatalogManagementV1`, func() { copyVersionOptionsModel.FormatKind = core.StringPtr("testString") copyVersionOptionsModel.Flavor = flavorModel copyVersionOptionsModel.WorkingDirectory = core.StringPtr("testString") + copyVersionOptionsModel.InstallType = core.StringPtr("testString") copyVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -19237,6 +19731,7 @@ var _ = Describe(`CatalogManagementV1`, func() { copyVersionOptionsModel.FormatKind = core.StringPtr("testString") copyVersionOptionsModel.Flavor = flavorModel copyVersionOptionsModel.WorkingDirectory = core.StringPtr("testString") + copyVersionOptionsModel.InstallType = core.StringPtr("testString") copyVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") @@ -19541,22 +20036,22 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetVersion(getVersionOptions *GetVersionOptions) - Operation response error`, func() { - getVersionPath := "/versions/testString" + Describe(`ValidateInputs(validateInputsOptions *ValidateInputsOptions) - Operation response error`, func() { + validateInputsPath := "/versions/testString/validateInputs" 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(getVersionPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(validateInputsPath)) + 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 GetVersion with error: Operation response processing error`, func() { + It(`Invoke ValidateInputs with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19564,19 +20059,21 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetVersionOptions model - getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) - getVersionOptionsModel.VersionLocID = core.StringPtr("testString") - getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ValidateInputsOptions model + validateInputsOptionsModel := new(catalogmanagementv1.ValidateInputsOptions) + validateInputsOptionsModel.VersionLocID = core.StringPtr("testString") + validateInputsOptionsModel.Input1 = core.StringPtr("testString") + validateInputsOptionsModel.Input2 = core.StringPtr("testString") + validateInputsOptionsModel.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 := catalogManagementService.GetVersion(getVersionOptionsModel) + result, response, operationErr := catalogManagementService.ValidateInputs(validateInputsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetVersion(getVersionOptionsModel) + result, response, operationErr = catalogManagementService.ValidateInputs(validateInputsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -19586,16 +20083,32 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetVersion(getVersionOptions *GetVersionOptions)`, func() { - getVersionPath := "/versions/testString" + Describe(`ValidateInputs(validateInputsOptions *ValidateInputsOptions)`, func() { + validateInputsPath := "/versions/testString/validateInputs" 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(getVersionPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(validateInputsPath)) + 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()) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) @@ -19603,10 +20116,10 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"message": "Message", "code": "Code", "global_transaction_id": "GlobalTransactionID", "errors": [{"message": "Message", "entity": "Entity", "error_code": "ErrorCode"}]}`) })) }) - It(`Invoke GetVersion successfully with retries`, func() { + It(`Invoke ValidateInputs successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19615,21 +20128,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetVersionOptions model - getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) - getVersionOptionsModel.VersionLocID = core.StringPtr("testString") - getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ValidateInputsOptions model + validateInputsOptionsModel := new(catalogmanagementv1.ValidateInputsOptions) + validateInputsOptionsModel.VersionLocID = core.StringPtr("testString") + validateInputsOptionsModel.Input1 = core.StringPtr("testString") + validateInputsOptionsModel.Input2 = core.StringPtr("testString") + validateInputsOptionsModel.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 := catalogManagementService.GetVersionWithContext(ctx, getVersionOptionsModel) + _, _, operationErr := catalogManagementService.ValidateInputsWithContext(ctx, validateInputsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) + result, response, operationErr := catalogManagementService.ValidateInputs(validateInputsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -19637,7 +20152,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetVersionWithContext(ctx, getVersionOptionsModel) + _, _, operationErr = catalogManagementService.ValidateInputsWithContext(ctx, validateInputsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -19651,16 +20166,32 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getVersionPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(validateInputsPath)) + 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()) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"message": "Message", "code": "Code", "global_transaction_id": "GlobalTransactionID", "errors": [{"message": "Message", "entity": "Entity", "error_code": "ErrorCode"}]}`) })) }) - It(`Invoke GetVersion successfully`, func() { + It(`Invoke ValidateInputs successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19669,24 +20200,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetVersion(nil) + result, response, operationErr := catalogManagementService.ValidateInputs(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetVersionOptions model - getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) - getVersionOptionsModel.VersionLocID = core.StringPtr("testString") - getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ValidateInputsOptions model + validateInputsOptionsModel := new(catalogmanagementv1.ValidateInputsOptions) + validateInputsOptionsModel.VersionLocID = core.StringPtr("testString") + validateInputsOptionsModel.Input1 = core.StringPtr("testString") + validateInputsOptionsModel.Input2 = core.StringPtr("testString") + validateInputsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetVersion(getVersionOptionsModel) + result, response, operationErr = catalogManagementService.ValidateInputs(validateInputsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetVersion with error: Operation validation and request error`, func() { + It(`Invoke ValidateInputs with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19694,22 +20227,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetVersionOptions model - getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) - getVersionOptionsModel.VersionLocID = core.StringPtr("testString") - getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ValidateInputsOptions model + validateInputsOptionsModel := new(catalogmanagementv1.ValidateInputsOptions) + validateInputsOptionsModel.VersionLocID = core.StringPtr("testString") + validateInputsOptionsModel.Input1 = core.StringPtr("testString") + validateInputsOptionsModel.Input2 = core.StringPtr("testString") + validateInputsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) + result, response, operationErr := catalogManagementService.ValidateInputs(validateInputsOptionsModel) 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 GetVersionOptions model with no property values - getVersionOptionsModelNew := new(catalogmanagementv1.GetVersionOptions) + // Construct a second instance of the ValidateInputsOptions model with no property values + validateInputsOptionsModelNew := new(catalogmanagementv1.ValidateInputsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetVersion(getVersionOptionsModelNew) + result, response, operationErr = catalogManagementService.ValidateInputs(validateInputsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -19727,7 +20262,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetVersion successfully`, func() { + It(`Invoke ValidateInputs successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19735,13 +20270,15 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetVersionOptions model - getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) - getVersionOptionsModel.VersionLocID = core.StringPtr("testString") - getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ValidateInputsOptions model + validateInputsOptionsModel := new(catalogmanagementv1.ValidateInputsOptions) + validateInputsOptionsModel.VersionLocID = core.StringPtr("testString") + validateInputsOptionsModel.Input1 = core.StringPtr("testString") + validateInputsOptionsModel.Input2 = core.StringPtr("testString") + validateInputsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) + result, response, operationErr := catalogManagementService.ValidateInputs(validateInputsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -19753,161 +20290,22 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`DeleteVersion(deleteVersionOptions *DeleteVersionOptions)`, func() { - deleteVersionPath := "/versions/testString" - 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(deleteVersionPath)) - Expect(req.Method).To(Equal("DELETE")) - - res.WriteHeader(200) - })) - }) - It(`Invoke DeleteVersion successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeleteVersion(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the DeleteVersionOptions model - deleteVersionOptionsModel := new(catalogmanagementv1.DeleteVersionOptions) - deleteVersionOptionsModel.VersionLocID = core.StringPtr("testString") - deleteVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeleteVersion(deleteVersionOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke DeleteVersion with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the DeleteVersionOptions model - deleteVersionOptionsModel := new(catalogmanagementv1.DeleteVersionOptions) - deleteVersionOptionsModel.VersionLocID = core.StringPtr("testString") - deleteVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeleteVersion(deleteVersionOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the DeleteVersionOptions model with no property values - deleteVersionOptionsModelNew := new(catalogmanagementv1.DeleteVersionOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeleteVersion(deleteVersionOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`DeprecateVersion(deprecateVersionOptions *DeprecateVersionOptions)`, func() { - deprecateVersionPath := "/versions/testString/deprecate" - 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(deprecateVersionPath)) - Expect(req.Method).To(Equal("POST")) - - res.WriteHeader(202) - })) - }) - It(`Invoke DeprecateVersion successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeprecateVersion(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the DeprecateVersionOptions model - deprecateVersionOptionsModel := new(catalogmanagementv1.DeprecateVersionOptions) - deprecateVersionOptionsModel.VersionLocID = core.StringPtr("testString") - deprecateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeprecateVersion(deprecateVersionOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke DeprecateVersion with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the DeprecateVersionOptions model - deprecateVersionOptionsModel := new(catalogmanagementv1.DeprecateVersionOptions) - deprecateVersionOptionsModel.VersionLocID = core.StringPtr("testString") - deprecateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeprecateVersion(deprecateVersionOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the DeprecateVersionOptions model with no property values - deprecateVersionOptionsModelNew := new(catalogmanagementv1.DeprecateVersionOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeprecateVersion(deprecateVersionOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetCluster(getClusterOptions *GetClusterOptions) - Operation response error`, func() { - getClusterPath := "/deploy/kubernetes/clusters/testString" + Describe(`GetVersion(getVersionOptions *GetVersionOptions) - Operation response error`, func() { + getVersionPath := "/versions/testString" 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(getClusterPath)) + Expect(req.URL.EscapedPath()).To(Equal(getVersionPath)) Expect(req.Method).To(Equal("GET")) - 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()["region"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetCluster with error: Operation response processing error`, func() { + It(`Invoke GetVersion with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19915,21 +20313,19 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetClusterOptions model - getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) - getClusterOptionsModel.ClusterID = core.StringPtr("testString") - getClusterOptionsModel.Region = core.StringPtr("testString") - getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionOptions model + getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) + getVersionOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionOptionsModel.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 := catalogManagementService.GetCluster(getClusterOptionsModel) + result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetCluster(getClusterOptionsModel) + result, response, operationErr = catalogManagementService.GetVersion(getVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -19939,30 +20335,27 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetCluster(getClusterOptions *GetClusterOptions)`, func() { - getClusterPath := "/deploy/kubernetes/clusters/testString" + Describe(`GetVersion(getVersionOptions *GetVersionOptions)`, func() { + getVersionPath := "/versions/testString" 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(getClusterPath)) + Expect(req.URL.EscapedPath()).To(Equal(getVersionPath)) Expect(req.Method).To(Equal("GET")) - 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()["region"]).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(200) - fmt.Fprintf(res, "%s", `{"resource_group_id": "ResourceGroupID", "resource_group_name": "ResourceGroupName", "id": "ID", "name": "Name", "region": "Region", "ingress_hostname": "IngressHostname", "provider": "Provider", "status": "Status"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) - It(`Invoke GetCluster successfully with retries`, func() { + It(`Invoke GetVersion successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -19971,23 +20364,21 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetClusterOptions model - getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) - getClusterOptionsModel.ClusterID = core.StringPtr("testString") - getClusterOptionsModel.Region = core.StringPtr("testString") - getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionOptions model + getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) + getVersionOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionOptionsModel.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 := catalogManagementService.GetClusterWithContext(ctx, getClusterOptionsModel) + _, _, operationErr := catalogManagementService.GetVersionWithContext(ctx, getVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) + result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -19995,7 +20386,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetClusterWithContext(ctx, getClusterOptionsModel) + _, _, operationErr = catalogManagementService.GetVersionWithContext(ctx, getVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -20009,19 +20400,16 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getClusterPath)) + Expect(req.URL.EscapedPath()).To(Equal(getVersionPath)) Expect(req.Method).To(Equal("GET")) - 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()["region"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"resource_group_id": "ResourceGroupID", "resource_group_name": "ResourceGroupName", "id": "ID", "name": "Name", "region": "Region", "ingress_hostname": "IngressHostname", "provider": "Provider", "status": "Status"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) - It(`Invoke GetCluster successfully`, func() { + It(`Invoke GetVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -20030,26 +20418,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetCluster(nil) + result, response, operationErr := catalogManagementService.GetVersion(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetClusterOptions model - getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) - getClusterOptionsModel.ClusterID = core.StringPtr("testString") - getClusterOptionsModel.Region = core.StringPtr("testString") - getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionOptions model + getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) + getVersionOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetCluster(getClusterOptionsModel) + result, response, operationErr = catalogManagementService.GetVersion(getVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetCluster with error: Operation validation and request error`, func() { + It(`Invoke GetVersion with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -20057,24 +20443,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetClusterOptions model - getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) - getClusterOptionsModel.ClusterID = core.StringPtr("testString") - getClusterOptionsModel.Region = core.StringPtr("testString") - getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionOptions model + getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) + getVersionOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) + result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) 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 GetClusterOptions model with no property values - getClusterOptionsModelNew := new(catalogmanagementv1.GetClusterOptions) + // Construct a second instance of the GetVersionOptions model with no property values + getVersionOptionsModelNew := new(catalogmanagementv1.GetVersionOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetCluster(getClusterOptionsModelNew) + result, response, operationErr = catalogManagementService.GetVersion(getVersionOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -20092,7 +20476,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetCluster successfully`, func() { + It(`Invoke GetVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -20100,15 +20484,13 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetClusterOptions model - getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) - getClusterOptionsModel.ClusterID = core.StringPtr("testString") - getClusterOptionsModel.Region = core.StringPtr("testString") - getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionOptions model + getVersionOptionsModel := new(catalogmanagementv1.GetVersionOptions) + getVersionOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) + result, response, operationErr := catalogManagementService.GetVersion(getVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -20120,27 +20502,22 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetNamespaces(getNamespacesOptions *GetNamespacesOptions) - Operation response error`, func() { - getNamespacesPath := "/deploy/kubernetes/clusters/testString/namespaces" + Describe(`UpdateVersion(updateVersionOptions *UpdateVersionOptions) - Operation response error`, func() { + updateVersionPath := "/versions/testString" 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(getNamespacesPath)) - Expect(req.Method).To(Equal("GET")) - 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()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.EscapedPath()).To(Equal(updateVersionPath)) + Expect(req.Method).To(Equal("PUT")) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetNamespaces with error: Operation response processing error`, func() { + It(`Invoke UpdateVersion with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -20148,663 +20525,576 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetNamespacesOptions model - getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) - getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") - getNamespacesOptionsModel.Region = core.StringPtr("testString") - getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) - getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) - getNamespacesOptionsModel.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 := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetNamespaces(getNamespacesOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetNamespaces(getNamespacesOptions *GetNamespacesOptions)`, func() { - getNamespacesPath := "/deploy/kubernetes/clusters/testString/namespaces" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - 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()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": ["Resources"]}`) - })) - }) - It(`Invoke GetNamespaces successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) - // Construct an instance of the GetNamespacesOptions model - getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) - getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") - getNamespacesOptionsModel.Region = core.StringPtr("testString") - getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) - getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) - getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.GetNamespacesWithContext(ctx, getNamespacesOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetNamespacesWithContext(ctx, getNamespacesOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} - 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()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": ["Resources"]}`) - })) - }) - It(`Invoke GetNamespaces successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetNamespaces(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") - // Construct an instance of the GetNamespacesOptions model - getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) - getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") - getNamespacesOptionsModel.Region = core.StringPtr("testString") - getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) - getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) - getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetNamespaces(getNamespacesOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") - }) - It(`Invoke GetNamespaces with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") - // Construct an instance of the GetNamespacesOptions model - getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) - getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") - getNamespacesOptionsModel.Region = core.StringPtr("testString") - getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) - getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) - getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) - 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 GetNamespacesOptions model with no property values - getNamespacesOptionsModelNew := new(catalogmanagementv1.GetNamespacesOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetNamespaces(getNamespacesOptionsModelNew) - 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() + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke GetNamespaces successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") - // Construct an instance of the GetNamespacesOptions model - getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) - getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") - getNamespacesOptionsModel.Region = core.StringPtr("testString") - getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) - getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) - getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") - // Invoke operation - result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextOffset successfully`, func() { - responseObject := new(catalogmanagementv1.NamespaceSearchResult) - responseObject.Next = core.StringPtr("ibm.com?offset=135") + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(Equal(core.Int64Ptr(int64(135)))) - }) - It(`Invoke GetNextOffset without a "Next" property in the response`, func() { - responseObject := new(catalogmanagementv1.NamespaceSearchResult) + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.NamespaceSearchResult) - responseObject.Next = core.StringPtr("ibm.com") + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.NamespaceSearchResult) - responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} - value, err := responseObject.GetNextOffset() - Expect(err).NotTo(BeNil()) - Expect(value).To(BeNil()) - }) - }) - Context(`Using mock server endpoint - paginated response`, func() { - BeforeEach(func() { - var requestNumber int = 0 - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - requestNumber++ - if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":["Resources"]}`) - } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":["Resources"]}`) - } else { - res.WriteHeader(400) - } - })) - }) - It(`Use GetNamespacesPager.GetNext successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} - getNamespacesOptionsModel := &catalogmanagementv1.GetNamespacesOptions{ - ClusterID: core.StringPtr("testString"), - Region: core.StringPtr("testString"), - XAuthRefreshToken: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - } + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} - pager, err := catalogManagementService.NewGetNamespacesPager(getNamespacesOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel - var allResults []string - for pager.HasNext() { - nextPage, err := pager.GetNext() - Expect(err).To(BeNil()) - Expect(nextPage).ToNot(BeNil()) - allResults = append(allResults, nextPage...) - } - Expect(len(allResults)).To(Equal(2)) - }) - It(`Use GetNamespacesPager.GetAll successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - getNamespacesOptionsModel := &catalogmanagementv1.GetNamespacesOptions{ - ClusterID: core.StringPtr("testString"), - Region: core.StringPtr("testString"), - XAuthRefreshToken: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - } + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} - pager, err := catalogManagementService.NewGetNamespacesPager(getNamespacesOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") - allResults, err := pager.GetAll() - Expect(err).To(BeNil()) - Expect(allResults).ToNot(BeNil()) - Expect(len(allResults)).To(Equal(2)) - }) - }) - }) - Describe(`DeployOperators(deployOperatorsOptions *DeployOperatorsOptions) - Operation response error`, func() { - deployOperatorsPath := "/deploy/kubernetes/olm/operator" - 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() + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(deployOperatorsPath)) - 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"))) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke DeployOperators with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} - // Construct an instance of the DeployOperatorsOptions model - deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) - deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deployOperatorsOptionsModel.Region = core.StringPtr("testString") - deployOperatorsOptionsModel.Namespaces = []string{"testString"} - deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deployOperatorsOptionsModel.Channel = core.StringPtr("testString") - deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - deployOperatorsOptionsModel.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 := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.DeployOperators(deployOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`DeployOperators(deployOperatorsOptions *DeployOperatorsOptions)`, func() { - deployOperatorsPath := "/deploy/kubernetes/olm/operator" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(deployOperatorsPath)) - Expect(req.Method).To(Equal("POST")) + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") - // 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()) + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) - })) - }) - It(`Invoke DeployOperators successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} - // Construct an instance of the DeployOperatorsOptions model - deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) - deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deployOperatorsOptionsModel.Region = core.StringPtr("testString") - deployOperatorsOptionsModel.Namespaces = []string{"testString"} - deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deployOperatorsOptionsModel.Channel = core.StringPtr("testString") - deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.DeployOperatorsWithContext(ctx, deployOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.DeployOperatorsWithContext(ctx, deployOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(deployOperatorsPath)) - Expect(req.Method).To(Equal("POST")) + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel - // 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()) + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) - })) - }) - It(`Invoke DeployOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.DeployOperators(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") - // Construct an instance of the DeployOperatorsOptions model - deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) - deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deployOperatorsOptionsModel.Region = core.StringPtr("testString") - deployOperatorsOptionsModel.Namespaces = []string{"testString"} - deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deployOperatorsOptionsModel.Channel = core.StringPtr("testString") - deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.DeployOperators(deployOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") - }) - It(`Invoke DeployOperators with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") - // Construct an instance of the DeployOperatorsOptions model - deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) - deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deployOperatorsOptionsModel.Region = core.StringPtr("testString") - deployOperatorsOptionsModel.Namespaces = []string{"testString"} - deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deployOperatorsOptionsModel.Channel = core.StringPtr("testString") - deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) - 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 DeployOperatorsOptions model with no property values - deployOperatorsOptionsModelNew := new(catalogmanagementv1.DeployOperatorsOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.DeployOperators(deployOperatorsOptionsModelNew) - 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() + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke DeployOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel - // Construct an instance of the DeployOperatorsOptions model - deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) - deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deployOperatorsOptionsModel.Region = core.StringPtr("testString") - deployOperatorsOptionsModel.Namespaces = []string{"testString"} - deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deployOperatorsOptionsModel.Channel = core.StringPtr("testString") - deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") - // Invoke operation - result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ListOperators(listOperatorsOptions *ListOperatorsOptions) - Operation response error`, func() { - listOperatorsPath := "/deploy/kubernetes/olm/operator" - 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() + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listOperatorsPath)) - Expect(req.Method).To(Equal("GET")) - 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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["version_locator_id"]).To(Equal([]string{"testString"})) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke ListOperators with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" - // Construct an instance of the ListOperatorsOptions model - listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) - listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - listOperatorsOptionsModel.Region = core.StringPtr("testString") - listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + + // Construct an instance of the UpdateVersionOptions model + updateVersionOptionsModel := new(catalogmanagementv1.UpdateVersionOptions) + updateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + updateVersionOptionsModel.ID = core.StringPtr("testString") + updateVersionOptionsModel.Rev = core.StringPtr("testString") + updateVersionOptionsModel.URL = core.StringPtr("testString") + updateVersionOptionsModel.CRN = core.StringPtr("testString") + updateVersionOptionsModel.Label = core.StringPtr("testString") + updateVersionOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Name = core.StringPtr("testString") + updateVersionOptionsModel.OfferingIconURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingDocsURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingSupportURL = core.StringPtr("testString") + updateVersionOptionsModel.Tags = []string{"testString"} + updateVersionOptionsModel.Keywords = []string{"testString"} + updateVersionOptionsModel.Rating = ratingModel + updateVersionOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.ShortDescription = core.StringPtr("testString") + updateVersionOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.LongDescription = core.StringPtr("testString") + updateVersionOptionsModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Features = []catalogmanagementv1.Feature{*featureModel} + updateVersionOptionsModel.Kinds = []catalogmanagementv1.Kind{*kindModel} + updateVersionOptionsModel.Publish = publishObjectModel + updateVersionOptionsModel.PcManaged = core.BoolPtr(true) + updateVersionOptionsModel.PublishApproved = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithAll = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithIBM = core.BoolPtr(true) + updateVersionOptionsModel.ShareEnabled = core.BoolPtr(true) + updateVersionOptionsModel.PublicOriginalCRN = core.StringPtr("testString") + updateVersionOptionsModel.PublishPublicCRN = core.StringPtr("testString") + updateVersionOptionsModel.PortalApprovalRecord = core.StringPtr("testString") + updateVersionOptionsModel.PortalUIURL = core.StringPtr("testString") + updateVersionOptionsModel.CatalogID = core.StringPtr("testString") + updateVersionOptionsModel.CatalogName = core.StringPtr("testString") + updateVersionOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + updateVersionOptionsModel.Disclaimer = core.StringPtr("testString") + updateVersionOptionsModel.Hidden = core.BoolPtr(true) + updateVersionOptionsModel.Provider = core.StringPtr("testString") + updateVersionOptionsModel.ProviderInfo = providerInfoModel + updateVersionOptionsModel.RepoInfo = repoInfoModel + updateVersionOptionsModel.ImagePullKeys = []catalogmanagementv1.ImagePullKey{*imagePullKeyModel} + updateVersionOptionsModel.Support = supportModel + updateVersionOptionsModel.Media = []catalogmanagementv1.MediaItem{*mediaItemModel} + updateVersionOptionsModel.DeprecatePending = deprecatePendingModel + updateVersionOptionsModel.ProductKind = core.StringPtr("testString") + updateVersionOptionsModel.Badges = []catalogmanagementv1.Badge{*badgeModel} + updateVersionOptionsModel.Plans = []catalogmanagementv1.Plan{*planModel} + updateVersionOptionsModel.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 := catalogManagementService.ListOperators(listOperatorsOptionsModel) + result, response, operationErr := catalogManagementService.UpdateVersion(updateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ListOperators(listOperatorsOptionsModel) + result, response, operationErr = catalogManagementService.UpdateVersion(updateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -20814,32 +21104,43 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ListOperators(listOperatorsOptions *ListOperatorsOptions)`, func() { - listOperatorsPath := "/deploy/kubernetes/olm/operator" + Describe(`UpdateVersion(updateVersionOptions *UpdateVersionOptions)`, func() { + updateVersionPath := "/versions/testString" 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(listOperatorsPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(updateVersionPath)) + Expect(req.Method).To(Equal("PUT")) + + // 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.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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["version_locator_id"]).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(200) - fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) - It(`Invoke ListOperators successfully with retries`, func() { + It(`Invoke UpdateVersion successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -20848,717 +21149,601 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ListOperatorsOptions model - listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) - listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - listOperatorsOptionsModel.Region = core.StringPtr("testString") - listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.ListOperatorsWithContext(ctx, listOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.ListOperatorsWithContext(ctx, listOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listOperatorsPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} - 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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["version_locator_id"]).To(Equal([]string{"testString"})) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) - })) - }) - It(`Invoke ListOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ListOperators(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") - // Construct an instance of the ListOperatorsOptions model - listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) - listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - listOperatorsOptionsModel.Region = core.StringPtr("testString") - listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ListOperators(listOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} - }) - It(`Invoke ListOperators with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the ListOperatorsOptions model - listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) - listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - listOperatorsOptionsModel.Region = core.StringPtr("testString") - listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) - 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 ListOperatorsOptions model with no property values - listOperatorsOptionsModelNew := new(catalogmanagementv1.ListOperatorsOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ListOperators(listOperatorsOptionsModelNew) - 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 ListOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} - // Construct an instance of the ListOperatorsOptions model - listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) - listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - listOperatorsOptionsModel.Region = core.StringPtr("testString") - listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") - // Invoke operation - result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ReplaceOperators(replaceOperatorsOptions *ReplaceOperatorsOptions) - Operation response error`, func() { - replaceOperatorsPath := "/deploy/kubernetes/olm/operator" - 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() + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(replaceOperatorsPath)) - Expect(req.Method).To(Equal("PUT")) - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke ReplaceOperators with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") - // Construct an instance of the ReplaceOperatorsOptions model - replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) - replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Region = core.StringPtr("testString") - replaceOperatorsOptionsModel.Namespaces = []string{"testString"} - replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") - replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - replaceOperatorsOptionsModel.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 := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ReplaceOperators(replaceOperatorsOptions *ReplaceOperatorsOptions)`, func() { - replaceOperatorsPath := "/deploy/kubernetes/olm/operator" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(replaceOperatorsPath)) - Expect(req.Method).To(Equal("PUT")) + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") - // 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()) + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) - })) - }) - It(`Invoke ReplaceOperators successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") - // Construct an instance of the ReplaceOperatorsOptions model - replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) - replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Region = core.StringPtr("testString") - replaceOperatorsOptionsModel.Namespaces = []string{"testString"} - replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") - replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.ReplaceOperatorsWithContext(ctx, replaceOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.ReplaceOperatorsWithContext(ctx, replaceOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(replaceOperatorsPath)) - Expect(req.Method).To(Equal("PUT")) + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel - // 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()) + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) - })) - }) - It(`Invoke ReplaceOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ReplaceOperators(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") - // Construct an instance of the ReplaceOperatorsOptions model - replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) - replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Region = core.StringPtr("testString") - replaceOperatorsOptionsModel.Namespaces = []string{"testString"} - replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") - replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} - }) - It(`Invoke ReplaceOperators with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} - // Construct an instance of the ReplaceOperatorsOptions model - replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) - replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Region = core.StringPtr("testString") - replaceOperatorsOptionsModel.Namespaces = []string{"testString"} - replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") - replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) - 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 ReplaceOperatorsOptions model with no property values - replaceOperatorsOptionsModelNew := new(catalogmanagementv1.ReplaceOperatorsOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModelNew) - 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() + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke ReplaceOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") - // Construct an instance of the ReplaceOperatorsOptions model - replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) - replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Region = core.StringPtr("testString") - replaceOperatorsOptionsModel.Namespaces = []string{"testString"} - replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) - replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") - replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") - replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") - // Invoke operation - result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`DeleteOperators(deleteOperatorsOptions *DeleteOperatorsOptions)`, func() { - deleteOperatorsPath := "/deploy/kubernetes/olm/operator" - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(deleteOperatorsPath)) - Expect(req.Method).To(Equal("DELETE")) + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} - 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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["version_locator_id"]).To(Equal([]string{"testString"})) - res.WriteHeader(200) - })) - }) - It(`Invoke DeleteOperators successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeleteOperators(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} - // Construct an instance of the DeleteOperatorsOptions model - deleteOperatorsOptionsModel := new(catalogmanagementv1.DeleteOperatorsOptions) - deleteOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deleteOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deleteOperatorsOptionsModel.Region = core.StringPtr("testString") - deleteOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deleteOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeleteOperators(deleteOperatorsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke DeleteOperators with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") - // Construct an instance of the DeleteOperatorsOptions model - deleteOperatorsOptionsModel := new(catalogmanagementv1.DeleteOperatorsOptions) - deleteOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deleteOperatorsOptionsModel.ClusterID = core.StringPtr("testString") - deleteOperatorsOptionsModel.Region = core.StringPtr("testString") - deleteOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") - deleteOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeleteOperators(deleteOperatorsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the DeleteOperatorsOptions model with no property values - deleteOperatorsOptionsModelNew := new(catalogmanagementv1.DeleteOperatorsOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeleteOperators(deleteOperatorsOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`InstallVersion(installVersionOptions *InstallVersionOptions)`, func() { - installVersionPath := "/versions/testString/install" - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(installVersionPath)) - Expect(req.Method).To(Equal("POST")) + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) - // 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()) + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - res.WriteHeader(202) - })) - }) - It(`Invoke InstallVersion successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.InstallVersion(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) - // Construct an instance of the InstallVersionOptions model - installVersionOptionsModel := new(catalogmanagementv1.InstallVersionOptions) - installVersionOptionsModel.VersionLocID = core.StringPtr("testString") - installVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - installVersionOptionsModel.ClusterID = core.StringPtr("testString") - installVersionOptionsModel.Region = core.StringPtr("testString") - installVersionOptionsModel.Namespace = core.StringPtr("testString") - installVersionOptionsModel.Namespaces = []string{"testString"} - installVersionOptionsModel.AllNamespaces = core.BoolPtr(true) - installVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel - installVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} - installVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") - installVersionOptionsModel.Schematics = deployRequestBodySchematicsModel - installVersionOptionsModel.Script = core.StringPtr("testString") - installVersionOptionsModel.ScriptID = core.StringPtr("testString") - installVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") - installVersionOptionsModel.VcenterID = core.StringPtr("testString") - installVersionOptionsModel.VcenterLocation = core.StringPtr("testString") - installVersionOptionsModel.VcenterUser = core.StringPtr("testString") - installVersionOptionsModel.VcenterPassword = core.StringPtr("testString") - installVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") - installVersionOptionsModel.PlanID = core.StringPtr("testString") - installVersionOptionsModel.Channel = core.StringPtr("testString") - installVersionOptionsModel.InstallPlan = core.StringPtr("testString") - installVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.InstallVersion(installVersionOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke InstallVersion with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" - // Construct an instance of the InstallVersionOptions model - installVersionOptionsModel := new(catalogmanagementv1.InstallVersionOptions) - installVersionOptionsModel.VersionLocID = core.StringPtr("testString") - installVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - installVersionOptionsModel.ClusterID = core.StringPtr("testString") - installVersionOptionsModel.Region = core.StringPtr("testString") - installVersionOptionsModel.Namespace = core.StringPtr("testString") - installVersionOptionsModel.Namespaces = []string{"testString"} - installVersionOptionsModel.AllNamespaces = core.BoolPtr(true) - installVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel - installVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} - installVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") - installVersionOptionsModel.Schematics = deployRequestBodySchematicsModel - installVersionOptionsModel.Script = core.StringPtr("testString") - installVersionOptionsModel.ScriptID = core.StringPtr("testString") - installVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") - installVersionOptionsModel.VcenterID = core.StringPtr("testString") - installVersionOptionsModel.VcenterLocation = core.StringPtr("testString") - installVersionOptionsModel.VcenterUser = core.StringPtr("testString") - installVersionOptionsModel.VcenterPassword = core.StringPtr("testString") - installVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") - installVersionOptionsModel.PlanID = core.StringPtr("testString") - installVersionOptionsModel.Channel = core.StringPtr("testString") - installVersionOptionsModel.InstallPlan = core.StringPtr("testString") - installVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.InstallVersion(installVersionOptionsModel) + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + + // Construct an instance of the UpdateVersionOptions model + updateVersionOptionsModel := new(catalogmanagementv1.UpdateVersionOptions) + updateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + updateVersionOptionsModel.ID = core.StringPtr("testString") + updateVersionOptionsModel.Rev = core.StringPtr("testString") + updateVersionOptionsModel.URL = core.StringPtr("testString") + updateVersionOptionsModel.CRN = core.StringPtr("testString") + updateVersionOptionsModel.Label = core.StringPtr("testString") + updateVersionOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Name = core.StringPtr("testString") + updateVersionOptionsModel.OfferingIconURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingDocsURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingSupportURL = core.StringPtr("testString") + updateVersionOptionsModel.Tags = []string{"testString"} + updateVersionOptionsModel.Keywords = []string{"testString"} + updateVersionOptionsModel.Rating = ratingModel + updateVersionOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.ShortDescription = core.StringPtr("testString") + updateVersionOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.LongDescription = core.StringPtr("testString") + updateVersionOptionsModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Features = []catalogmanagementv1.Feature{*featureModel} + updateVersionOptionsModel.Kinds = []catalogmanagementv1.Kind{*kindModel} + updateVersionOptionsModel.Publish = publishObjectModel + updateVersionOptionsModel.PcManaged = core.BoolPtr(true) + updateVersionOptionsModel.PublishApproved = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithAll = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithIBM = core.BoolPtr(true) + updateVersionOptionsModel.ShareEnabled = core.BoolPtr(true) + updateVersionOptionsModel.PublicOriginalCRN = core.StringPtr("testString") + updateVersionOptionsModel.PublishPublicCRN = core.StringPtr("testString") + updateVersionOptionsModel.PortalApprovalRecord = core.StringPtr("testString") + updateVersionOptionsModel.PortalUIURL = core.StringPtr("testString") + updateVersionOptionsModel.CatalogID = core.StringPtr("testString") + updateVersionOptionsModel.CatalogName = core.StringPtr("testString") + updateVersionOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + updateVersionOptionsModel.Disclaimer = core.StringPtr("testString") + updateVersionOptionsModel.Hidden = core.BoolPtr(true) + updateVersionOptionsModel.Provider = core.StringPtr("testString") + updateVersionOptionsModel.ProviderInfo = providerInfoModel + updateVersionOptionsModel.RepoInfo = repoInfoModel + updateVersionOptionsModel.ImagePullKeys = []catalogmanagementv1.ImagePullKey{*imagePullKeyModel} + updateVersionOptionsModel.Support = supportModel + updateVersionOptionsModel.Media = []catalogmanagementv1.MediaItem{*mediaItemModel} + updateVersionOptionsModel.DeprecatePending = deprecatePendingModel + updateVersionOptionsModel.ProductKind = core.StringPtr("testString") + updateVersionOptionsModel.Badges = []catalogmanagementv1.Badge{*badgeModel} + updateVersionOptionsModel.Plans = []catalogmanagementv1.Plan{*planModel} + updateVersionOptionsModel.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 := catalogManagementService.UpdateVersionWithContext(ctx, updateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the InstallVersionOptions model with no property values - installVersionOptionsModelNew := new(catalogmanagementv1.InstallVersionOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.InstallVersion(installVersionOptionsModelNew) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.UpdateVersion(updateVersionOptionsModel) + 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 = catalogManagementService.UpdateVersionWithContext(ctx, updateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) AfterEach(func() { testServer.Close() }) }) - }) - Describe(`PreinstallVersion(preinstallVersionOptions *PreinstallVersionOptions)`, func() { - preinstallVersionPath := "/versions/testString/preinstall" 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(preinstallVersionPath)) - Expect(req.Method).To(Equal("POST")) + Expect(req.URL.EscapedPath()).To(Equal(updateVersionPath)) + Expect(req.Method).To(Equal("PUT")) // For gzip-disabled operation, verify Content-Encoding is not set. Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) @@ -21576,12 +21761,13 @@ var _ = Describe(`CatalogManagementV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - res.WriteHeader(202) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) - It(`Invoke PreinstallVersion successfully`, func() { + It(`Invoke UpdateVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -21590,1566 +21776,1307 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.PreinstallVersion(nil) + result, response, operationErr := catalogManagementService.UpdateVersion(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) - // Construct an instance of the PreinstallVersionOptions model - preinstallVersionOptionsModel := new(catalogmanagementv1.PreinstallVersionOptions) - preinstallVersionOptionsModel.VersionLocID = core.StringPtr("testString") - preinstallVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - preinstallVersionOptionsModel.ClusterID = core.StringPtr("testString") - preinstallVersionOptionsModel.Region = core.StringPtr("testString") - preinstallVersionOptionsModel.Namespace = core.StringPtr("testString") - preinstallVersionOptionsModel.Namespaces = []string{"testString"} - preinstallVersionOptionsModel.AllNamespaces = core.BoolPtr(true) - preinstallVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel - preinstallVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} - preinstallVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") - preinstallVersionOptionsModel.Schematics = deployRequestBodySchematicsModel - preinstallVersionOptionsModel.Script = core.StringPtr("testString") - preinstallVersionOptionsModel.ScriptID = core.StringPtr("testString") - preinstallVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterID = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterLocation = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterUser = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterPassword = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") - preinstallVersionOptionsModel.PlanID = core.StringPtr("testString") - preinstallVersionOptionsModel.Channel = core.StringPtr("testString") - preinstallVersionOptionsModel.InstallPlan = core.StringPtr("testString") - preinstallVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.PreinstallVersion(preinstallVersionOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke PreinstallVersion with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") - // Construct an instance of the PreinstallVersionOptions model - preinstallVersionOptionsModel := new(catalogmanagementv1.PreinstallVersionOptions) - preinstallVersionOptionsModel.VersionLocID = core.StringPtr("testString") - preinstallVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - preinstallVersionOptionsModel.ClusterID = core.StringPtr("testString") - preinstallVersionOptionsModel.Region = core.StringPtr("testString") - preinstallVersionOptionsModel.Namespace = core.StringPtr("testString") - preinstallVersionOptionsModel.Namespaces = []string{"testString"} - preinstallVersionOptionsModel.AllNamespaces = core.BoolPtr(true) - preinstallVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel - preinstallVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} - preinstallVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") - preinstallVersionOptionsModel.Schematics = deployRequestBodySchematicsModel - preinstallVersionOptionsModel.Script = core.StringPtr("testString") - preinstallVersionOptionsModel.ScriptID = core.StringPtr("testString") - preinstallVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterID = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterLocation = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterUser = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterPassword = core.StringPtr("testString") - preinstallVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") - preinstallVersionOptionsModel.PlanID = core.StringPtr("testString") - preinstallVersionOptionsModel.Channel = core.StringPtr("testString") - preinstallVersionOptionsModel.InstallPlan = core.StringPtr("testString") - preinstallVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.PreinstallVersion(preinstallVersionOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the PreinstallVersionOptions model with no property values - preinstallVersionOptionsModelNew := new(catalogmanagementv1.PreinstallVersionOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.PreinstallVersion(preinstallVersionOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetPreinstall(getPreinstallOptions *GetPreinstallOptions) - Operation response error`, func() { - getPreinstallPath := "/versions/testString/preinstall" - 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() + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getPreinstallPath)) - Expect(req.Method).To(Equal("GET")) - 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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["namespace"]).To(Equal([]string{"testString"})) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke GetPreinstall with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} - // Construct an instance of the GetPreinstallOptions model - getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) - getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") - getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") - getPreinstallOptionsModel.Region = core.StringPtr("testString") - getPreinstallOptionsModel.Namespace = core.StringPtr("testString") - getPreinstallOptionsModel.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 := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetPreinstall(getPreinstallOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetPreinstall(getPreinstallOptions *GetPreinstallOptions)`, func() { - getPreinstallPath := "/versions/testString/preinstall" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getPreinstallPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" - 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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["namespace"]).To(Equal([]string{"testString"})) - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"metadata": {"cluster_id": "ClusterID", "region": "Region", "namespace": "Namespace", "workspace_id": "WorkspaceID", "workspace_name": "WorkspaceName"}, "release": {"deployments": [{"anyKey": "anyValue"}], "replicasets": [{"anyKey": "anyValue"}], "statefulsets": [{"anyKey": "anyValue"}], "pods": [{"anyKey": "anyValue"}], "errors": [{"mapKey": "Inner"}]}, "content_mgmt": {"pods": [{"mapKey": "Inner"}], "errors": [{"mapKey": "Inner"}]}}`) - })) - }) - It(`Invoke GetPreinstall successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") - // Construct an instance of the GetPreinstallOptions model - getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) - getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") - getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") - getPreinstallOptionsModel.Region = core.StringPtr("testString") - getPreinstallOptionsModel.Namespace = core.StringPtr("testString") - getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.GetPreinstallWithContext(ctx, getPreinstallOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetPreinstallWithContext(ctx, getPreinstallOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getPreinstallPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") - 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()["cluster_id"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["namespace"]).To(Equal([]string{"testString"})) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"metadata": {"cluster_id": "ClusterID", "region": "Region", "namespace": "Namespace", "workspace_id": "WorkspaceID", "workspace_name": "WorkspaceName"}, "release": {"deployments": [{"anyKey": "anyValue"}], "replicasets": [{"anyKey": "anyValue"}], "statefulsets": [{"anyKey": "anyValue"}], "pods": [{"anyKey": "anyValue"}], "errors": [{"mapKey": "Inner"}]}, "content_mgmt": {"pods": [{"mapKey": "Inner"}], "errors": [{"mapKey": "Inner"}]}}`) - })) - }) - It(`Invoke GetPreinstall successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetPreinstall(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") - // Construct an instance of the GetPreinstallOptions model - getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) - getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") - getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") - getPreinstallOptionsModel.Region = core.StringPtr("testString") - getPreinstallOptionsModel.Namespace = core.StringPtr("testString") - getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetPreinstall(getPreinstallOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") - }) - It(`Invoke GetPreinstall with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} - // Construct an instance of the GetPreinstallOptions model - getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) - getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") - getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") - getPreinstallOptionsModel.Region = core.StringPtr("testString") - getPreinstallOptionsModel.Namespace = core.StringPtr("testString") - getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) - 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 GetPreinstallOptions model with no property values - getPreinstallOptionsModelNew := new(catalogmanagementv1.GetPreinstallOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetPreinstall(getPreinstallOptionsModelNew) - 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() + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke GetPreinstall successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} - // Construct an instance of the GetPreinstallOptions model - getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) - getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") - getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") - getPreinstallOptionsModel.Region = core.StringPtr("testString") - getPreinstallOptionsModel.Namespace = core.StringPtr("testString") - getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel - // Invoke operation - result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ValidateInstall(validateInstallOptions *ValidateInstallOptions)`, func() { - validateInstallPath := "/versions/testString/validation/install" - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(validateInstallPath)) - Expect(req.Method).To(Equal("POST")) + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") - // 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()) + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} - 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()["targetContextName"]).To(Equal([]string{"testString"})) - res.WriteHeader(202) - })) - }) - It(`Invoke ValidateInstall successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.ValidateInstall(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") - // Construct an instance of the ValidateInstallOptions model - validateInstallOptionsModel := new(catalogmanagementv1.ValidateInstallOptions) - validateInstallOptionsModel.VersionLocID = core.StringPtr("testString") - validateInstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - validateInstallOptionsModel.ClusterID = core.StringPtr("testString") - validateInstallOptionsModel.Region = core.StringPtr("testString") - validateInstallOptionsModel.Namespace = core.StringPtr("testString") - validateInstallOptionsModel.Namespaces = []string{"testString"} - validateInstallOptionsModel.AllNamespaces = core.BoolPtr(true) - validateInstallOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel - validateInstallOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} - validateInstallOptionsModel.EntitlementApikey = core.StringPtr("testString") - validateInstallOptionsModel.Schematics = deployRequestBodySchematicsModel - validateInstallOptionsModel.Script = core.StringPtr("testString") - validateInstallOptionsModel.ScriptID = core.StringPtr("testString") - validateInstallOptionsModel.VersionLocatorID = core.StringPtr("testString") - validateInstallOptionsModel.VcenterID = core.StringPtr("testString") - validateInstallOptionsModel.VcenterLocation = core.StringPtr("testString") - validateInstallOptionsModel.VcenterUser = core.StringPtr("testString") - validateInstallOptionsModel.VcenterPassword = core.StringPtr("testString") - validateInstallOptionsModel.VcenterDatastore = core.StringPtr("testString") - validateInstallOptionsModel.PlanID = core.StringPtr("testString") - validateInstallOptionsModel.Channel = core.StringPtr("testString") - validateInstallOptionsModel.InstallPlan = core.StringPtr("testString") - validateInstallOptionsModel.TargetContextName = core.StringPtr("testString") - validateInstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.ValidateInstall(validateInstallOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke ValidateInstall with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel - // Construct an instance of the ValidateInstallOptions model - validateInstallOptionsModel := new(catalogmanagementv1.ValidateInstallOptions) - validateInstallOptionsModel.VersionLocID = core.StringPtr("testString") - validateInstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - validateInstallOptionsModel.ClusterID = core.StringPtr("testString") - validateInstallOptionsModel.Region = core.StringPtr("testString") - validateInstallOptionsModel.Namespace = core.StringPtr("testString") - validateInstallOptionsModel.Namespaces = []string{"testString"} - validateInstallOptionsModel.AllNamespaces = core.BoolPtr(true) - validateInstallOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel - validateInstallOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} - validateInstallOptionsModel.EntitlementApikey = core.StringPtr("testString") - validateInstallOptionsModel.Schematics = deployRequestBodySchematicsModel - validateInstallOptionsModel.Script = core.StringPtr("testString") - validateInstallOptionsModel.ScriptID = core.StringPtr("testString") - validateInstallOptionsModel.VersionLocatorID = core.StringPtr("testString") - validateInstallOptionsModel.VcenterID = core.StringPtr("testString") - validateInstallOptionsModel.VcenterLocation = core.StringPtr("testString") - validateInstallOptionsModel.VcenterUser = core.StringPtr("testString") - validateInstallOptionsModel.VcenterPassword = core.StringPtr("testString") - validateInstallOptionsModel.VcenterDatastore = core.StringPtr("testString") - validateInstallOptionsModel.PlanID = core.StringPtr("testString") - validateInstallOptionsModel.Channel = core.StringPtr("testString") - validateInstallOptionsModel.InstallPlan = core.StringPtr("testString") - validateInstallOptionsModel.TargetContextName = core.StringPtr("testString") - validateInstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.ValidateInstall(validateInstallOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the ValidateInstallOptions model with no property values - validateInstallOptionsModelNew := new(catalogmanagementv1.ValidateInstallOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.ValidateInstall(validateInstallOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetValidationStatus(getValidationStatusOptions *GetValidationStatusOptions) - Operation response error`, func() { - getValidationStatusPath := "/versions/testString/validation/install" - 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() + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getValidationStatusPath)) - Expect(req.Method).To(Equal("GET")) - 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()["targetContextName"]).To(Equal([]string{"testString"})) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke GetValidationStatus with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel - // Construct an instance of the GetValidationStatusOptions model - getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) - getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") - getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") - getValidationStatusOptionsModel.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 := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetValidationStatus(getValidationStatusOptions *GetValidationStatusOptions)`, func() { - getValidationStatusPath := "/versions/testString/validation/install" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getValidationStatusPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") - 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()["targetContextName"]).To(Equal([]string{"testString"})) - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") + + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") + + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") + + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") + + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) + + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel + + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") + + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") + + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") + + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" + + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + + // Construct an instance of the UpdateVersionOptions model + updateVersionOptionsModel := new(catalogmanagementv1.UpdateVersionOptions) + updateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + updateVersionOptionsModel.ID = core.StringPtr("testString") + updateVersionOptionsModel.Rev = core.StringPtr("testString") + updateVersionOptionsModel.URL = core.StringPtr("testString") + updateVersionOptionsModel.CRN = core.StringPtr("testString") + updateVersionOptionsModel.Label = core.StringPtr("testString") + updateVersionOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Name = core.StringPtr("testString") + updateVersionOptionsModel.OfferingIconURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingDocsURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingSupportURL = core.StringPtr("testString") + updateVersionOptionsModel.Tags = []string{"testString"} + updateVersionOptionsModel.Keywords = []string{"testString"} + updateVersionOptionsModel.Rating = ratingModel + updateVersionOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.ShortDescription = core.StringPtr("testString") + updateVersionOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.LongDescription = core.StringPtr("testString") + updateVersionOptionsModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Features = []catalogmanagementv1.Feature{*featureModel} + updateVersionOptionsModel.Kinds = []catalogmanagementv1.Kind{*kindModel} + updateVersionOptionsModel.Publish = publishObjectModel + updateVersionOptionsModel.PcManaged = core.BoolPtr(true) + updateVersionOptionsModel.PublishApproved = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithAll = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithIBM = core.BoolPtr(true) + updateVersionOptionsModel.ShareEnabled = core.BoolPtr(true) + updateVersionOptionsModel.PublicOriginalCRN = core.StringPtr("testString") + updateVersionOptionsModel.PublishPublicCRN = core.StringPtr("testString") + updateVersionOptionsModel.PortalApprovalRecord = core.StringPtr("testString") + updateVersionOptionsModel.PortalUIURL = core.StringPtr("testString") + updateVersionOptionsModel.CatalogID = core.StringPtr("testString") + updateVersionOptionsModel.CatalogName = core.StringPtr("testString") + updateVersionOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + updateVersionOptionsModel.Disclaimer = core.StringPtr("testString") + updateVersionOptionsModel.Hidden = core.BoolPtr(true) + updateVersionOptionsModel.Provider = core.StringPtr("testString") + updateVersionOptionsModel.ProviderInfo = providerInfoModel + updateVersionOptionsModel.RepoInfo = repoInfoModel + updateVersionOptionsModel.ImagePullKeys = []catalogmanagementv1.ImagePullKey{*imagePullKeyModel} + updateVersionOptionsModel.Support = supportModel + updateVersionOptionsModel.Media = []catalogmanagementv1.MediaItem{*mediaItemModel} + updateVersionOptionsModel.DeprecatePending = deprecatePendingModel + updateVersionOptionsModel.ProductKind = core.StringPtr("testString") + updateVersionOptionsModel.Badges = []catalogmanagementv1.Badge{*badgeModel} + updateVersionOptionsModel.Plans = []catalogmanagementv1.Plan{*planModel} + updateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.UpdateVersion(updateVersionOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}`) - })) }) - It(`Invoke GetValidationStatus successfully with retries`, func() { + It(`Invoke UpdateVersion with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetValidationStatusOptions model - getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) - getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") - getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") - getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.GetValidationStatusWithContext(ctx, getValidationStatusOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetValidationStatusWithContext(ctx, getValidationStatusOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getValidationStatusPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} - 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()["targetContextName"]).To(Equal([]string{"testString"})) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}`) - })) - }) - It(`Invoke GetValidationStatus successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetValidationStatus(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") - // Construct an instance of the GetValidationStatusOptions model - getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) - getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") - getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") - getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} - }) - It(`Invoke GetValidationStatus with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} - // Construct an instance of the GetValidationStatusOptions model - getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) - getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") - getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") - getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) - 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 GetValidationStatusOptions model with no property values - getValidationStatusOptionsModelNew := new(catalogmanagementv1.GetValidationStatusOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetValidationStatus(getValidationStatusOptionsModelNew) - 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() + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke GetValidationStatus successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" - // Construct an instance of the GetValidationStatusOptions model - getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) - getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") - getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") - getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") - // Invoke operation - result, response, operationErr := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`SearchObjects(searchObjectsOptions *SearchObjectsOptions) - Operation response error`, func() { - searchObjectsPath := "/objects" - 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() + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(searchObjectsPath)) - Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["query"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["kind"]).To(Equal([]string{"vpe"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - // TODO: Add check for collapse query parameter - // TODO: Add check for digest query parameter - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke SearchObjects with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") - // Construct an instance of the SearchObjectsOptions model - searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) - searchObjectsOptionsModel.Query = core.StringPtr("testString") - searchObjectsOptionsModel.Kind = core.StringPtr("vpe") - searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - searchObjectsOptionsModel.Collapse = core.BoolPtr(true) - searchObjectsOptionsModel.Digest = core.BoolPtr(true) - searchObjectsOptionsModel.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 := catalogManagementService.SearchObjects(searchObjectsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.SearchObjects(searchObjectsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`SearchObjects(searchObjectsOptions *SearchObjectsOptions)`, func() { - searchObjectsPath := "/objects" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(searchObjectsPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") - Expect(req.URL.Query()["query"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["kind"]).To(Equal([]string{"vpe"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - // TODO: Add check for collapse query parameter - // TODO: Add check for digest query parameter - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) - })) - }) - It(`Invoke SearchObjects successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") - // Construct an instance of the SearchObjectsOptions model - searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) - searchObjectsOptionsModel.Query = core.StringPtr("testString") - searchObjectsOptionsModel.Kind = core.StringPtr("vpe") - searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - searchObjectsOptionsModel.Collapse = core.BoolPtr(true) - searchObjectsOptionsModel.Digest = core.BoolPtr(true) - searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.SearchObjectsWithContext(ctx, searchObjectsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.SearchObjectsWithContext(ctx, searchObjectsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(searchObjectsPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} - Expect(req.URL.Query()["query"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["kind"]).To(Equal([]string{"vpe"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - // TODO: Add check for collapse query parameter - // TODO: Add check for digest query parameter - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) - })) - }) - It(`Invoke SearchObjects successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.SearchObjects(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - // Construct an instance of the SearchObjectsOptions model - searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) - searchObjectsOptionsModel.Query = core.StringPtr("testString") - searchObjectsOptionsModel.Kind = core.StringPtr("vpe") - searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - searchObjectsOptionsModel.Collapse = core.BoolPtr(true) - searchObjectsOptionsModel.Digest = core.BoolPtr(true) - searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.SearchObjects(searchObjectsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") - }) - It(`Invoke SearchObjects with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") - // Construct an instance of the SearchObjectsOptions model - searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) - searchObjectsOptionsModel.Query = core.StringPtr("testString") - searchObjectsOptionsModel.Kind = core.StringPtr("vpe") - searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - searchObjectsOptionsModel.Collapse = core.BoolPtr(true) - searchObjectsOptionsModel.Digest = core.BoolPtr(true) - searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) - 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 SearchObjectsOptions model with no property values - searchObjectsOptionsModelNew := new(catalogmanagementv1.SearchObjectsOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.SearchObjects(searchObjectsOptionsModelNew) - 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() + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} - // Set success status code with no respoonse body - res.WriteHeader(200) - })) - }) - It(`Invoke SearchObjects successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} - // Construct an instance of the SearchObjectsOptions model - searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) - searchObjectsOptionsModel.Query = core.StringPtr("testString") - searchObjectsOptionsModel.Kind = core.StringPtr("vpe") - searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - searchObjectsOptionsModel.Collapse = core.BoolPtr(true) - searchObjectsOptionsModel.Digest = core.BoolPtr(true) - searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} - // Invoke operation - result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextOffset successfully`, func() { - responseObject := new(catalogmanagementv1.ObjectSearchResult) - responseObject.Next = core.StringPtr("ibm.com?offset=135") + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(Equal(core.Int64Ptr(int64(135)))) - }) - It(`Invoke GetNextOffset without a "Next" property in the response`, func() { - responseObject := new(catalogmanagementv1.ObjectSearchResult) + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.ObjectSearchResult) - responseObject.Next = core.StringPtr("ibm.com") + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.ObjectSearchResult) - responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} - value, err := responseObject.GetNextOffset() - Expect(err).NotTo(BeNil()) - Expect(value).To(BeNil()) - }) - }) - Context(`Using mock server endpoint - paginated response`, func() { - BeforeEach(func() { - var requestNumber int = 0 - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(searchObjectsPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - requestNumber++ - if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) - } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) - } else { - res.WriteHeader(400) - } - })) - }) - It(`Use SearchObjectsPager.GetNext successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel - searchObjectsOptionsModel := &catalogmanagementv1.SearchObjectsOptions{ - Query: core.StringPtr("testString"), - Kind: core.StringPtr("vpe"), - Limit: core.Int64Ptr(int64(10)), - Collapse: core.BoolPtr(true), - Digest: core.BoolPtr(true), - } + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") - pager, err := catalogManagementService.NewSearchObjectsPager(searchObjectsOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel - var allResults []catalogmanagementv1.CatalogObject - for pager.HasNext() { - nextPage, err := pager.GetNext() - Expect(err).To(BeNil()) - Expect(nextPage).ToNot(BeNil()) - allResults = append(allResults, nextPage...) - } - Expect(len(allResults)).To(Equal(2)) - }) - It(`Use SearchObjectsPager.GetAll successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel - searchObjectsOptionsModel := &catalogmanagementv1.SearchObjectsOptions{ - Query: core.StringPtr("testString"), - Kind: core.StringPtr("vpe"), - Limit: core.Int64Ptr(int64(10)), - Collapse: core.BoolPtr(true), - Digest: core.BoolPtr(true), - } + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) - pager, err := catalogManagementService.NewSearchObjectsPager(searchObjectsOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") - allResults, err := pager.GetAll() - Expect(err).To(BeNil()) - Expect(allResults).ToNot(BeNil()) - Expect(len(allResults)).To(Equal(2)) - }) - }) - }) - Describe(`ListObjects(listObjectsOptions *ListObjectsOptions) - Operation response error`, func() { - listObjectsPath := "/catalogs/testString/objects" - 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() + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listObjectsPath)) - Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - Expect(req.URL.Query()["name"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["sort"]).To(Equal([]string{"testString"})) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke ListObjects with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") - // Construct an instance of the ListObjectsOptions model - listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) - listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - listObjectsOptionsModel.Name = core.StringPtr("testString") - listObjectsOptionsModel.Sort = core.StringPtr("testString") - listObjectsOptionsModel.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 := catalogManagementService.ListObjects(listObjectsOptionsModel) + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") + + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") + + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) + + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel + + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") + + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") + + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") + + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" + + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + + // Construct an instance of the UpdateVersionOptions model + updateVersionOptionsModel := new(catalogmanagementv1.UpdateVersionOptions) + updateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + updateVersionOptionsModel.ID = core.StringPtr("testString") + updateVersionOptionsModel.Rev = core.StringPtr("testString") + updateVersionOptionsModel.URL = core.StringPtr("testString") + updateVersionOptionsModel.CRN = core.StringPtr("testString") + updateVersionOptionsModel.Label = core.StringPtr("testString") + updateVersionOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Name = core.StringPtr("testString") + updateVersionOptionsModel.OfferingIconURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingDocsURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingSupportURL = core.StringPtr("testString") + updateVersionOptionsModel.Tags = []string{"testString"} + updateVersionOptionsModel.Keywords = []string{"testString"} + updateVersionOptionsModel.Rating = ratingModel + updateVersionOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.ShortDescription = core.StringPtr("testString") + updateVersionOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.LongDescription = core.StringPtr("testString") + updateVersionOptionsModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Features = []catalogmanagementv1.Feature{*featureModel} + updateVersionOptionsModel.Kinds = []catalogmanagementv1.Kind{*kindModel} + updateVersionOptionsModel.Publish = publishObjectModel + updateVersionOptionsModel.PcManaged = core.BoolPtr(true) + updateVersionOptionsModel.PublishApproved = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithAll = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithIBM = core.BoolPtr(true) + updateVersionOptionsModel.ShareEnabled = core.BoolPtr(true) + updateVersionOptionsModel.PublicOriginalCRN = core.StringPtr("testString") + updateVersionOptionsModel.PublishPublicCRN = core.StringPtr("testString") + updateVersionOptionsModel.PortalApprovalRecord = core.StringPtr("testString") + updateVersionOptionsModel.PortalUIURL = core.StringPtr("testString") + updateVersionOptionsModel.CatalogID = core.StringPtr("testString") + updateVersionOptionsModel.CatalogName = core.StringPtr("testString") + updateVersionOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + updateVersionOptionsModel.Disclaimer = core.StringPtr("testString") + updateVersionOptionsModel.Hidden = core.BoolPtr(true) + updateVersionOptionsModel.Provider = core.StringPtr("testString") + updateVersionOptionsModel.ProviderInfo = providerInfoModel + updateVersionOptionsModel.RepoInfo = repoInfoModel + updateVersionOptionsModel.ImagePullKeys = []catalogmanagementv1.ImagePullKey{*imagePullKeyModel} + updateVersionOptionsModel.Support = supportModel + updateVersionOptionsModel.Media = []catalogmanagementv1.MediaItem{*mediaItemModel} + updateVersionOptionsModel.DeprecatePending = deprecatePendingModel + updateVersionOptionsModel.ProductKind = core.StringPtr("testString") + updateVersionOptionsModel.Badges = []catalogmanagementv1.Badge{*badgeModel} + updateVersionOptionsModel.Plans = []catalogmanagementv1.Plan{*planModel} + updateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.UpdateVersion(updateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) Expect(result).To(BeNil()) - - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ListObjects(listObjectsOptionsModel) + // Construct a second instance of the UpdateVersionOptions model with no property values + updateVersionOptionsModelNew := new(catalogmanagementv1.UpdateVersionOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.UpdateVersion(updateVersionOptionsModelNew) Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) + Expect(response).To(BeNil()) Expect(result).To(BeNil()) }) AfterEach(func() { testServer.Close() }) }) - }) - Describe(`ListObjects(listObjectsOptions *ListObjectsOptions)`, func() { - listObjectsPath := "/catalogs/testString/objects" - Context(`Using mock server endpoint with timeout`, func() { + 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() - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listObjectsPath)) - Expect(req.Method).To(Equal("GET")) - - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - Expect(req.URL.Query()["name"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["sort"]).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") + // Set success status code with no respoonse body res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) })) }) - It(`Invoke ListObjects successfully with retries`, func() { + It(`Invoke UpdateVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ListObjectsOptions model - listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) - listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - listObjectsOptionsModel.Name = core.StringPtr("testString") - listObjectsOptionsModel.Sort = core.StringPtr("testString") - listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) - // Invoke operation with a Context to test a timeout error - ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc() - _, _, operationErr := catalogManagementService.ListObjectsWithContext(ctx, listObjectsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.ListObjectsWithContext(ctx, listObjectsOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - 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(listObjectsPath)) - Expect(req.Method).To(Equal("GET")) - - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) - Expect(req.URL.Query()["name"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["sort"]).To(Equal([]string{"testString"})) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) - })) - }) - It(`Invoke ListObjects successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ListObjects(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - Expect(result).To(BeNil()) - - // Construct an instance of the ListObjectsOptions model - listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) - listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - listObjectsOptionsModel.Name = core.StringPtr("testString") - listObjectsOptionsModel.Sort = core.StringPtr("testString") - listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ListObjects(listObjectsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) - - }) - It(`Invoke ListObjects with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the ListObjectsOptions model - listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) - listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - listObjectsOptionsModel.Name = core.StringPtr("testString") - listObjectsOptionsModel.Sort = core.StringPtr("testString") - listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) - 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 ListObjectsOptions model with no property values - listObjectsOptionsModelNew := new(catalogmanagementv1.ListObjectsOptions) - // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ListObjects(listObjectsOptionsModelNew) - 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 ListObjects successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the ListObjectsOptions model - listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) - listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) - listObjectsOptionsModel.Name = core.StringPtr("testString") - listObjectsOptionsModel.Sort = core.StringPtr("testString") - listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation - result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - - // Verify a nil result - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextOffset successfully`, func() { - responseObject := new(catalogmanagementv1.ObjectListResult) - responseObject.Next = core.StringPtr("ibm.com?offset=135") - - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(Equal(core.Int64Ptr(int64(135)))) - }) - It(`Invoke GetNextOffset without a "Next" property in the response`, func() { - responseObject := new(catalogmanagementv1.ObjectListResult) + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.ObjectListResult) - responseObject.Next = core.StringPtr("ibm.com") + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.ObjectListResult) - responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel - value, err := responseObject.GetNextOffset() - Expect(err).NotTo(BeNil()) - Expect(value).To(BeNil()) - }) - }) - Context(`Using mock server endpoint - paginated response`, func() { - BeforeEach(func() { - var requestNumber int = 0 - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listObjectsPath)) - Expect(req.Method).To(Equal("GET")) + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - requestNumber++ - if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) - } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) - } else { - res.WriteHeader(400) - } - })) - }) - It(`Use ObjectsPager.GetNext successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} - listObjectsOptionsModel := &catalogmanagementv1.ListObjectsOptions{ - CatalogIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Name: core.StringPtr("testString"), - Sort: core.StringPtr("testString"), - } + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} - pager, err := catalogManagementService.NewObjectsPager(listObjectsOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") - var allResults []catalogmanagementv1.CatalogObject - for pager.HasNext() { - nextPage, err := pager.GetNext() - Expect(err).To(BeNil()) - Expect(nextPage).ToNot(BeNil()) - allResults = append(allResults, nextPage...) - } - Expect(len(allResults)).To(Equal(2)) - }) - It(`Use ObjectsPager.GetAll successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" - listObjectsOptionsModel := &catalogmanagementv1.ListObjectsOptions{ - CatalogIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Name: core.StringPtr("testString"), - Sort: core.StringPtr("testString"), - } + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") - pager, err := catalogManagementService.NewObjectsPager(listObjectsOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") - allResults, err := pager.GetAll() - Expect(err).To(BeNil()) - Expect(allResults).ToNot(BeNil()) - Expect(len(allResults)).To(Equal(2)) - }) - }) - }) - Describe(`CreateObject(createObjectOptions *CreateObjectOptions) - Operation response error`, func() { - createObjectPath := "/catalogs/testString/objects" - 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() + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(createObjectPath)) - Expect(req.Method).To(Equal("POST")) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke CreateObject with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") // Construct an instance of the State model stateModel := new(catalogmanagementv1.State) @@ -23159,145 +23086,578 @@ var _ = Describe(`CatalogManagementV1`, func() { stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") stateModel.Previous = core.StringPtr("testString") - // Construct an instance of the CreateObjectOptions model - createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) - createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectOptionsModel.Name = core.StringPtr("testString") - createObjectOptionsModel.CRN = core.StringPtr("testString") - createObjectOptionsModel.URL = core.StringPtr("testString") - createObjectOptionsModel.ParentID = core.StringPtr("testString") - createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Label = core.StringPtr("testString") - createObjectOptionsModel.Tags = []string{"testString"} - createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.ShortDescription = core.StringPtr("testString") - createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Kind = core.StringPtr("testString") - createObjectOptionsModel.Publish = publishObjectModel - createObjectOptionsModel.State = stateModel - createObjectOptionsModel.CatalogID = core.StringPtr("testString") - createObjectOptionsModel.CatalogName = core.StringPtr("testString") - createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - createObjectOptionsModel.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 := catalogManagementService.CreateObject(createObjectOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.CreateObject(createObjectOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`CreateObject(createObjectOptions *CreateObjectOptions)`, func() { - createObjectPath := "/catalogs/testString/objects" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(createObjectPath)) - Expect(req.Method).To(Equal("POST")) + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") - // For gzip-disabled operation, verify Content-Encoding is not set. - Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} - // 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()) + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") - // Sleep a short time to support a timeout test - time.Sleep(100 * time.Millisecond) + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) - })) - }) - It(`Invoke CreateObject successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel - // Construct an instance of the CreateObjectOptions model - createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) - createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectOptionsModel.Name = core.StringPtr("testString") - createObjectOptionsModel.CRN = core.StringPtr("testString") - createObjectOptionsModel.URL = core.StringPtr("testString") - createObjectOptionsModel.ParentID = core.StringPtr("testString") - createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Label = core.StringPtr("testString") - createObjectOptionsModel.Tags = []string{"testString"} - createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.ShortDescription = core.StringPtr("testString") - createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Kind = core.StringPtr("testString") - createObjectOptionsModel.Publish = publishObjectModel - createObjectOptionsModel.State = stateModel - createObjectOptionsModel.CatalogID = core.StringPtr("testString") - createObjectOptionsModel.CatalogName = core.StringPtr("testString") - createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} + + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") + + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") + + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} + + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} + + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} + + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") + + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") + + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") + + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") + + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} + + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} + + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} + + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel + + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel + + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") + + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") + + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") + + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") + + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") + + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) + + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel + + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") + + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") + + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") + + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" + + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + + // Construct an instance of the UpdateVersionOptions model + updateVersionOptionsModel := new(catalogmanagementv1.UpdateVersionOptions) + updateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + updateVersionOptionsModel.ID = core.StringPtr("testString") + updateVersionOptionsModel.Rev = core.StringPtr("testString") + updateVersionOptionsModel.URL = core.StringPtr("testString") + updateVersionOptionsModel.CRN = core.StringPtr("testString") + updateVersionOptionsModel.Label = core.StringPtr("testString") + updateVersionOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Name = core.StringPtr("testString") + updateVersionOptionsModel.OfferingIconURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingDocsURL = core.StringPtr("testString") + updateVersionOptionsModel.OfferingSupportURL = core.StringPtr("testString") + updateVersionOptionsModel.Tags = []string{"testString"} + updateVersionOptionsModel.Keywords = []string{"testString"} + updateVersionOptionsModel.Rating = ratingModel + updateVersionOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + updateVersionOptionsModel.ShortDescription = core.StringPtr("testString") + updateVersionOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.LongDescription = core.StringPtr("testString") + updateVersionOptionsModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + updateVersionOptionsModel.Features = []catalogmanagementv1.Feature{*featureModel} + updateVersionOptionsModel.Kinds = []catalogmanagementv1.Kind{*kindModel} + updateVersionOptionsModel.Publish = publishObjectModel + updateVersionOptionsModel.PcManaged = core.BoolPtr(true) + updateVersionOptionsModel.PublishApproved = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithAll = core.BoolPtr(true) + updateVersionOptionsModel.ShareWithIBM = core.BoolPtr(true) + updateVersionOptionsModel.ShareEnabled = core.BoolPtr(true) + updateVersionOptionsModel.PublicOriginalCRN = core.StringPtr("testString") + updateVersionOptionsModel.PublishPublicCRN = core.StringPtr("testString") + updateVersionOptionsModel.PortalApprovalRecord = core.StringPtr("testString") + updateVersionOptionsModel.PortalUIURL = core.StringPtr("testString") + updateVersionOptionsModel.CatalogID = core.StringPtr("testString") + updateVersionOptionsModel.CatalogName = core.StringPtr("testString") + updateVersionOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + updateVersionOptionsModel.Disclaimer = core.StringPtr("testString") + updateVersionOptionsModel.Hidden = core.BoolPtr(true) + updateVersionOptionsModel.Provider = core.StringPtr("testString") + updateVersionOptionsModel.ProviderInfo = providerInfoModel + updateVersionOptionsModel.RepoInfo = repoInfoModel + updateVersionOptionsModel.ImagePullKeys = []catalogmanagementv1.ImagePullKey{*imagePullKeyModel} + updateVersionOptionsModel.Support = supportModel + updateVersionOptionsModel.Media = []catalogmanagementv1.MediaItem{*mediaItemModel} + updateVersionOptionsModel.DeprecatePending = deprecatePendingModel + updateVersionOptionsModel.ProductKind = core.StringPtr("testString") + updateVersionOptionsModel.Badges = []catalogmanagementv1.Badge{*badgeModel} + updateVersionOptionsModel.Plans = []catalogmanagementv1.Plan{*planModel} + updateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.UpdateVersion(updateVersionOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`PatchUpdateVersion(patchUpdateVersionOptions *PatchUpdateVersionOptions) - Operation response error`, func() { + patchUpdateVersionPath := "/versions/testString" + 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(patchUpdateVersionPath)) + Expect(req.Method).To(Equal("PATCH")) + Expect(req.Header["If-Match"]).ToNot(BeNil()) + Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke PatchUpdateVersion with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") + + // Construct an instance of the PatchUpdateVersionOptions model + patchUpdateVersionOptionsModel := new(catalogmanagementv1.PatchUpdateVersionOptions) + patchUpdateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + patchUpdateVersionOptionsModel.IfMatch = core.StringPtr("testString") + patchUpdateVersionOptionsModel.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + patchUpdateVersionOptionsModel.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 := catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`PatchUpdateVersion(patchUpdateVersionOptions *PatchUpdateVersionOptions)`, func() { + patchUpdateVersionPath := "/versions/testString" + 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(patchUpdateVersionPath)) + Expect(req.Method).To(Equal("PATCH")) + + // 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.Header["If-Match"]).ToNot(BeNil()) + Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "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(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + })) + }) + It(`Invoke PatchUpdateVersion successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") + + // Construct an instance of the PatchUpdateVersionOptions model + patchUpdateVersionOptionsModel := new(catalogmanagementv1.PatchUpdateVersionOptions) + patchUpdateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + patchUpdateVersionOptionsModel.IfMatch = core.StringPtr("testString") + patchUpdateVersionOptionsModel.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + patchUpdateVersionOptionsModel.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 := catalogManagementService.CreateObjectWithContext(ctx, createObjectOptionsModel) + _, _, operationErr := catalogManagementService.PatchUpdateVersionWithContext(ctx, patchUpdateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) + result, response, operationErr := catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -23305,7 +23665,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.CreateObjectWithContext(ctx, createObjectOptionsModel) + _, _, operationErr = catalogManagementService.PatchUpdateVersionWithContext(ctx, patchUpdateVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -23319,8 +23679,8 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(createObjectPath)) - Expect(req.Method).To(Equal("POST")) + Expect(req.URL.EscapedPath()).To(Equal(patchUpdateVersionPath)) + Expect(req.Method).To(Equal("PATCH")) // For gzip-disabled operation, verify Content-Encoding is not set. Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) @@ -23338,13 +23698,15 @@ var _ = Describe(`CatalogManagementV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["If-Match"]).ToNot(BeNil()) + Expect(req.Header["If-Match"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) // Set mock response res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) })) }) - It(`Invoke CreateObject successfully`, func() { + It(`Invoke PatchUpdateVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23353,64 +23715,33 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.CreateObject(nil) + result, response, operationErr := catalogManagementService.PatchUpdateVersion(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") - // Construct an instance of the CreateObjectOptions model - createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) - createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectOptionsModel.Name = core.StringPtr("testString") - createObjectOptionsModel.CRN = core.StringPtr("testString") - createObjectOptionsModel.URL = core.StringPtr("testString") - createObjectOptionsModel.ParentID = core.StringPtr("testString") - createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Label = core.StringPtr("testString") - createObjectOptionsModel.Tags = []string{"testString"} - createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.ShortDescription = core.StringPtr("testString") - createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Kind = core.StringPtr("testString") - createObjectOptionsModel.Publish = publishObjectModel - createObjectOptionsModel.State = stateModel - createObjectOptionsModel.CatalogID = core.StringPtr("testString") - createObjectOptionsModel.CatalogName = core.StringPtr("testString") - createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PatchUpdateVersionOptions model + patchUpdateVersionOptionsModel := new(catalogmanagementv1.PatchUpdateVersionOptions) + patchUpdateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + patchUpdateVersionOptionsModel.IfMatch = core.StringPtr("testString") + patchUpdateVersionOptionsModel.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + patchUpdateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.CreateObject(createObjectOptionsModel) + result, response, operationErr = catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke CreateObject with error: Operation validation and request error`, func() { + It(`Invoke PatchUpdateVersion with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23418,62 +23749,31 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - - // Construct an instance of the CreateObjectOptions model - createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) - createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectOptionsModel.Name = core.StringPtr("testString") - createObjectOptionsModel.CRN = core.StringPtr("testString") - createObjectOptionsModel.URL = core.StringPtr("testString") - createObjectOptionsModel.ParentID = core.StringPtr("testString") - createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Label = core.StringPtr("testString") - createObjectOptionsModel.Tags = []string{"testString"} - createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.ShortDescription = core.StringPtr("testString") - createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Kind = core.StringPtr("testString") - createObjectOptionsModel.Publish = publishObjectModel - createObjectOptionsModel.State = stateModel - createObjectOptionsModel.CatalogID = core.StringPtr("testString") - createObjectOptionsModel.CatalogName = core.StringPtr("testString") - createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PatchUpdateVersionOptions model + patchUpdateVersionOptionsModel := new(catalogmanagementv1.PatchUpdateVersionOptions) + patchUpdateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + patchUpdateVersionOptionsModel.IfMatch = core.StringPtr("testString") + patchUpdateVersionOptionsModel.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + patchUpdateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) + result, response, operationErr := catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModel) 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 CreateObjectOptions model with no property values - createObjectOptionsModelNew := new(catalogmanagementv1.CreateObjectOptions) + // Construct a second instance of the PatchUpdateVersionOptions model with no property values + patchUpdateVersionOptionsModelNew := new(catalogmanagementv1.PatchUpdateVersionOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.CreateObject(createObjectOptionsModelNew) + result, response, operationErr = catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -23488,10 +23788,10 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Set success status code with no respoonse body - res.WriteHeader(201) + res.WriteHeader(200) })) }) - It(`Invoke CreateObject successfully`, func() { + It(`Invoke PatchUpdateVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23499,53 +23799,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") - // Construct an instance of the CreateObjectOptions model - createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) - createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectOptionsModel.Name = core.StringPtr("testString") - createObjectOptionsModel.CRN = core.StringPtr("testString") - createObjectOptionsModel.URL = core.StringPtr("testString") - createObjectOptionsModel.ParentID = core.StringPtr("testString") - createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Label = core.StringPtr("testString") - createObjectOptionsModel.Tags = []string{"testString"} - createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createObjectOptionsModel.ShortDescription = core.StringPtr("testString") - createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - createObjectOptionsModel.Kind = core.StringPtr("testString") - createObjectOptionsModel.Publish = publishObjectModel - createObjectOptionsModel.State = stateModel - createObjectOptionsModel.CatalogID = core.StringPtr("testString") - createObjectOptionsModel.CatalogName = core.StringPtr("testString") - createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PatchUpdateVersionOptions model + patchUpdateVersionOptionsModel := new(catalogmanagementv1.PatchUpdateVersionOptions) + patchUpdateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + patchUpdateVersionOptionsModel.IfMatch = core.StringPtr("testString") + patchUpdateVersionOptionsModel.Updates = []catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel} + patchUpdateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) + result, response, operationErr := catalogManagementService.PatchUpdateVersion(patchUpdateVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -23557,22 +23826,90 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObject(getObjectOptions *GetObjectOptions) - Operation response error`, func() { - getObjectPath := "/catalogs/testString/objects/testString" + Describe(`DeleteVersion(deleteVersionOptions *DeleteVersionOptions)`, func() { + deleteVersionPath := "/versions/testString" + 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(deleteVersionPath)) + Expect(req.Method).To(Equal("DELETE")) + + res.WriteHeader(200) + })) + }) + It(`Invoke DeleteVersion successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeleteVersion(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the DeleteVersionOptions model + deleteVersionOptionsModel := new(catalogmanagementv1.DeleteVersionOptions) + deleteVersionOptionsModel.VersionLocID = core.StringPtr("testString") + deleteVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeleteVersion(deleteVersionOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke DeleteVersion with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeleteVersionOptions model + deleteVersionOptionsModel := new(catalogmanagementv1.DeleteVersionOptions) + deleteVersionOptionsModel.VersionLocID = core.StringPtr("testString") + deleteVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.DeleteVersion(deleteVersionOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeleteVersionOptions model with no property values + deleteVersionOptionsModelNew := new(catalogmanagementv1.DeleteVersionOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeleteVersion(deleteVersionOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetVersionDependencies(getVersionDependenciesOptions *GetVersionDependenciesOptions) - Operation response error`, func() { + getVersionDependenciesPath := "/versions/testString/dependencies" 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(getObjectPath)) + Expect(req.URL.EscapedPath()).To(Equal(getVersionDependenciesPath)) Expect(req.Method).To(Equal("GET")) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetObject with error: Operation response processing error`, func() { + It(`Invoke GetVersionDependencies with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23580,20 +23917,19 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectOptions model - getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) - getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionDependenciesOptions model + getVersionDependenciesOptionsModel := new(catalogmanagementv1.GetVersionDependenciesOptions) + getVersionDependenciesOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionDependenciesOptionsModel.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 := catalogManagementService.GetObject(getObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetObject(getObjectOptionsModel) + result, response, operationErr = catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -23603,15 +23939,15 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObject(getObjectOptions *GetObjectOptions)`, func() { - getObjectPath := "/catalogs/testString/objects/testString" + Describe(`GetVersionDependencies(getVersionDependenciesOptions *GetVersionDependenciesOptions)`, func() { + getVersionDependenciesPath := "/versions/testString/dependencies" 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(getObjectPath)) + Expect(req.URL.EscapedPath()).To(Equal(getVersionDependenciesPath)) Expect(req.Method).To(Equal("GET")) // Sleep a short time to support a timeout test @@ -23620,10 +23956,10 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "version": {"account_id": "AccountID", "catalog_id": "CatalogID", "offering_id": "OfferingID", "version_id": "VersionID", "version": "Version", "flavor": "Flavor", "semver": "Semver"}, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}}`) })) }) - It(`Invoke GetObject successfully with retries`, func() { + It(`Invoke GetVersionDependencies successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23632,22 +23968,21 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetObjectOptions model - getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) - getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionDependenciesOptions model + getVersionDependenciesOptionsModel := new(catalogmanagementv1.GetVersionDependenciesOptions) + getVersionDependenciesOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionDependenciesOptionsModel.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 := catalogManagementService.GetObjectWithContext(ctx, getObjectOptionsModel) + _, _, operationErr := catalogManagementService.GetVersionDependenciesWithContext(ctx, getVersionDependenciesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -23655,7 +23990,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetObjectWithContext(ctx, getObjectOptionsModel) + _, _, operationErr = catalogManagementService.GetVersionDependenciesWithContext(ctx, getVersionDependenciesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -23669,16 +24004,16 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getObjectPath)) + Expect(req.URL.EscapedPath()).To(Equal(getVersionDependenciesPath)) Expect(req.Method).To(Equal("GET")) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "version": {"account_id": "AccountID", "catalog_id": "CatalogID", "offering_id": "OfferingID", "version_id": "VersionID", "version": "Version", "flavor": "Flavor", "semver": "Semver"}, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}}`) })) }) - It(`Invoke GetObject successfully`, func() { + It(`Invoke GetVersionDependencies successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23687,25 +24022,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetObject(nil) + result, response, operationErr := catalogManagementService.GetVersionDependencies(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetObjectOptions model - getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) - getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionDependenciesOptions model + getVersionDependenciesOptionsModel := new(catalogmanagementv1.GetVersionDependenciesOptions) + getVersionDependenciesOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionDependenciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetObject(getObjectOptionsModel) + result, response, operationErr = catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetObject with error: Operation validation and request error`, func() { + It(`Invoke GetVersionDependencies with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23713,23 +24047,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectOptions model - getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) - getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionDependenciesOptions model + getVersionDependenciesOptionsModel := new(catalogmanagementv1.GetVersionDependenciesOptions) + getVersionDependenciesOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionDependenciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModel) 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 GetObjectOptions model with no property values - getObjectOptionsModelNew := new(catalogmanagementv1.GetObjectOptions) + // Construct a second instance of the GetVersionDependenciesOptions model with no property values + getVersionDependenciesOptionsModelNew := new(catalogmanagementv1.GetVersionDependenciesOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetObject(getObjectOptionsModelNew) + result, response, operationErr = catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -23747,7 +24080,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetObject successfully`, func() { + It(`Invoke GetVersionDependencies successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23755,14 +24088,13 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectOptions model - getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) - getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetVersionDependenciesOptions model + getVersionDependenciesOptionsModel := new(catalogmanagementv1.GetVersionDependenciesOptions) + getVersionDependenciesOptionsModel.VersionLocID = core.StringPtr("testString") + getVersionDependenciesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetVersionDependencies(getVersionDependenciesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -23774,22 +24106,93 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ReplaceObject(replaceObjectOptions *ReplaceObjectOptions) - Operation response error`, func() { - replaceObjectPath := "/catalogs/testString/objects/testString" + Describe(`DeprecateVersion(deprecateVersionOptions *DeprecateVersionOptions)`, func() { + deprecateVersionPath := "/versions/testString/deprecate" + 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(deprecateVersionPath)) + Expect(req.Method).To(Equal("POST")) + + res.WriteHeader(202) + })) + }) + It(`Invoke DeprecateVersion successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeprecateVersion(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the DeprecateVersionOptions model + deprecateVersionOptionsModel := new(catalogmanagementv1.DeprecateVersionOptions) + deprecateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + deprecateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeprecateVersion(deprecateVersionOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke DeprecateVersion with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeprecateVersionOptions model + deprecateVersionOptionsModel := new(catalogmanagementv1.DeprecateVersionOptions) + deprecateVersionOptionsModel.VersionLocID = core.StringPtr("testString") + deprecateVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.DeprecateVersion(deprecateVersionOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeprecateVersionOptions model with no property values + deprecateVersionOptionsModelNew := new(catalogmanagementv1.DeprecateVersionOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeprecateVersion(deprecateVersionOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetCluster(getClusterOptions *GetClusterOptions) - Operation response error`, func() { + getClusterPath := "/deploy/kubernetes/clusters/testString" 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(replaceObjectPath)) - Expect(req.Method).To(Equal("PUT")) + Expect(req.URL.EscapedPath()).To(Equal(getClusterPath)) + Expect(req.Method).To(Equal("GET")) + 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()["region"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke ReplaceObject with error: Operation response processing error`, func() { + It(`Invoke GetCluster with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23797,62 +24200,21 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - - // Construct an instance of the ReplaceObjectOptions model - replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) - replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ID = core.StringPtr("testString") - replaceObjectOptionsModel.Rev = core.StringPtr("testString") - replaceObjectOptionsModel.Name = core.StringPtr("testString") - replaceObjectOptionsModel.CRN = core.StringPtr("testString") - replaceObjectOptionsModel.URL = core.StringPtr("testString") - replaceObjectOptionsModel.ParentID = core.StringPtr("testString") - replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Label = core.StringPtr("testString") - replaceObjectOptionsModel.Tags = []string{"testString"} - replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") - replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Kind = core.StringPtr("testString") - replaceObjectOptionsModel.Publish = publishObjectModel - replaceObjectOptionsModel.State = stateModel - replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") - replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") - replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetClusterOptions model + getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) + getClusterOptionsModel.ClusterID = core.StringPtr("testString") + getClusterOptionsModel.Region = core.StringPtr("testString") + getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getClusterOptionsModel.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 := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ReplaceObject(replaceObjectOptionsModel) + result, response, operationErr = catalogManagementService.GetCluster(getClusterOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -23862,43 +24224,30 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ReplaceObject(replaceObjectOptions *ReplaceObjectOptions)`, func() { - replaceObjectPath := "/catalogs/testString/objects/testString" + Describe(`GetCluster(getClusterOptions *GetClusterOptions)`, func() { + getClusterPath := "/deploy/kubernetes/clusters/testString" 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(replaceObjectPath)) - Expect(req.Method).To(Equal("PUT")) - - // 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(getClusterPath)) + Expect(req.Method).To(Equal("GET")) + 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()["region"]).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(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) + fmt.Fprintf(res, "%s", `{"resource_group_id": "ResourceGroupID", "resource_group_name": "ResourceGroupName", "id": "ID", "name": "Name", "region": "Region", "ingress_hostname": "IngressHostname", "provider": "Provider", "status": "Status"}`) })) }) - It(`Invoke ReplaceObject successfully with retries`, func() { + It(`Invoke GetCluster successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -23907,64 +24256,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - - // Construct an instance of the ReplaceObjectOptions model - replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) - replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ID = core.StringPtr("testString") - replaceObjectOptionsModel.Rev = core.StringPtr("testString") - replaceObjectOptionsModel.Name = core.StringPtr("testString") - replaceObjectOptionsModel.CRN = core.StringPtr("testString") - replaceObjectOptionsModel.URL = core.StringPtr("testString") - replaceObjectOptionsModel.ParentID = core.StringPtr("testString") - replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Label = core.StringPtr("testString") - replaceObjectOptionsModel.Tags = []string{"testString"} - replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") - replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Kind = core.StringPtr("testString") - replaceObjectOptionsModel.Publish = publishObjectModel - replaceObjectOptionsModel.State = stateModel - replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") - replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") - replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetClusterOptions model + getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) + getClusterOptionsModel.ClusterID = core.StringPtr("testString") + getClusterOptionsModel.Region = core.StringPtr("testString") + getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getClusterOptionsModel.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 := catalogManagementService.ReplaceObjectWithContext(ctx, replaceObjectOptionsModel) + _, _, operationErr := catalogManagementService.GetClusterWithContext(ctx, getClusterOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -23972,7 +24280,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.ReplaceObjectWithContext(ctx, replaceObjectOptionsModel) + _, _, operationErr = catalogManagementService.GetClusterWithContext(ctx, getClusterOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -23986,32 +24294,19 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(replaceObjectPath)) - Expect(req.Method).To(Equal("PUT")) - - // 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(getClusterPath)) + Expect(req.Method).To(Equal("GET")) + 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()["region"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) + fmt.Fprintf(res, "%s", `{"resource_group_id": "ResourceGroupID", "resource_group_name": "ResourceGroupName", "id": "ID", "name": "Name", "region": "Region", "ingress_hostname": "IngressHostname", "provider": "Provider", "status": "Status"}`) })) }) - It(`Invoke ReplaceObject successfully`, func() { + It(`Invoke GetCluster successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24020,67 +24315,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ReplaceObject(nil) + result, response, operationErr := catalogManagementService.GetCluster(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - - // Construct an instance of the ReplaceObjectOptions model - replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) - replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ID = core.StringPtr("testString") - replaceObjectOptionsModel.Rev = core.StringPtr("testString") - replaceObjectOptionsModel.Name = core.StringPtr("testString") - replaceObjectOptionsModel.CRN = core.StringPtr("testString") - replaceObjectOptionsModel.URL = core.StringPtr("testString") - replaceObjectOptionsModel.ParentID = core.StringPtr("testString") - replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Label = core.StringPtr("testString") - replaceObjectOptionsModel.Tags = []string{"testString"} - replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") - replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Kind = core.StringPtr("testString") - replaceObjectOptionsModel.Publish = publishObjectModel - replaceObjectOptionsModel.State = stateModel - replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") - replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") - replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetClusterOptions model + getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) + getClusterOptionsModel.ClusterID = core.StringPtr("testString") + getClusterOptionsModel.Region = core.StringPtr("testString") + getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ReplaceObject(replaceObjectOptionsModel) + result, response, operationErr = catalogManagementService.GetCluster(getClusterOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke ReplaceObject with error: Operation validation and request error`, func() { + It(`Invoke GetCluster with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24088,65 +24342,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - - // Construct an instance of the ReplaceObjectOptions model - replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) - replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ID = core.StringPtr("testString") - replaceObjectOptionsModel.Rev = core.StringPtr("testString") - replaceObjectOptionsModel.Name = core.StringPtr("testString") - replaceObjectOptionsModel.CRN = core.StringPtr("testString") - replaceObjectOptionsModel.URL = core.StringPtr("testString") - replaceObjectOptionsModel.ParentID = core.StringPtr("testString") - replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Label = core.StringPtr("testString") - replaceObjectOptionsModel.Tags = []string{"testString"} - replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") - replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Kind = core.StringPtr("testString") - replaceObjectOptionsModel.Publish = publishObjectModel - replaceObjectOptionsModel.State = stateModel - replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") - replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") - replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetClusterOptions model + getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) + getClusterOptionsModel.ClusterID = core.StringPtr("testString") + getClusterOptionsModel.Region = core.StringPtr("testString") + getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) 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 ReplaceObjectOptions model with no property values - replaceObjectOptionsModelNew := new(catalogmanagementv1.ReplaceObjectOptions) + // Construct a second instance of the GetClusterOptions model with no property values + getClusterOptionsModelNew := new(catalogmanagementv1.GetClusterOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ReplaceObject(replaceObjectOptionsModelNew) + result, response, operationErr = catalogManagementService.GetCluster(getClusterOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -24164,7 +24377,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke ReplaceObject successfully`, func() { + It(`Invoke GetCluster successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24172,56 +24385,15 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - - // Construct an instance of the ReplaceObjectOptions model - replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) - replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - replaceObjectOptionsModel.ID = core.StringPtr("testString") - replaceObjectOptionsModel.Rev = core.StringPtr("testString") - replaceObjectOptionsModel.Name = core.StringPtr("testString") - replaceObjectOptionsModel.CRN = core.StringPtr("testString") - replaceObjectOptionsModel.URL = core.StringPtr("testString") - replaceObjectOptionsModel.ParentID = core.StringPtr("testString") - replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Label = core.StringPtr("testString") - replaceObjectOptionsModel.Tags = []string{"testString"} - replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") - replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - replaceObjectOptionsModel.Kind = core.StringPtr("testString") - replaceObjectOptionsModel.Publish = publishObjectModel - replaceObjectOptionsModel.State = stateModel - replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") - replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") - replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} - replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetClusterOptions model + getClusterOptionsModel := new(catalogmanagementv1.GetClusterOptions) + getClusterOptionsModel.ClusterID = core.StringPtr("testString") + getClusterOptionsModel.Region = core.StringPtr("testString") + getClusterOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getClusterOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) + result, response, operationErr := catalogManagementService.GetCluster(getClusterOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -24233,95 +24405,27 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`DeleteObject(deleteObjectOptions *DeleteObjectOptions)`, func() { - deleteObjectPath := "/catalogs/testString/objects/testString" - 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(deleteObjectPath)) - Expect(req.Method).To(Equal("DELETE")) - - res.WriteHeader(200) - })) - }) - It(`Invoke DeleteObject successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeleteObject(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the DeleteObjectOptions model - deleteObjectOptionsModel := new(catalogmanagementv1.DeleteObjectOptions) - deleteObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeleteObject(deleteObjectOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke DeleteObject with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the DeleteObjectOptions model - deleteObjectOptionsModel := new(catalogmanagementv1.DeleteObjectOptions) - deleteObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeleteObject(deleteObjectOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the DeleteObjectOptions model with no property values - deleteObjectOptionsModelNew := new(catalogmanagementv1.DeleteObjectOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeleteObject(deleteObjectOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ListObjectAudits(listObjectAuditsOptions *ListObjectAuditsOptions) - Operation response error`, func() { - listObjectAuditsPath := "/catalogs/testString/objects/testString/audits" + Describe(`GetNamespaces(getNamespacesOptions *GetNamespacesOptions) - Operation response error`, func() { + getNamespacesPath := "/deploy/kubernetes/clusters/testString/namespaces" 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(listObjectAuditsPath)) + Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + 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()["region"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - // TODO: Add check for lookupnames query parameter + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke ListObjectAudits with error: Operation response processing error`, func() { + It(`Invoke GetNamespaces with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24329,23 +24433,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ListObjectAuditsOptions model - listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) - listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.Start = core.StringPtr("testString") - listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetNamespacesOptions model + getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) + getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") + getNamespacesOptionsModel.Region = core.StringPtr("testString") + getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) + getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) + getNamespacesOptionsModel.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 := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) + result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) + result, response, operationErr = catalogManagementService.GetNamespaces(getNamespacesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -24355,30 +24459,32 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ListObjectAudits(listObjectAuditsOptions *ListObjectAuditsOptions)`, func() { - listObjectAuditsPath := "/catalogs/testString/objects/testString/audits" + Describe(`GetNamespaces(getNamespacesOptions *GetNamespacesOptions)`, func() { + getNamespacesPath := "/deploy/kubernetes/clusters/testString/namespaces" 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(listObjectAuditsPath)) + Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + 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()["region"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - // TODO: Add check for lookupnames query parameter + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(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", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": ["Resources"]}`) })) }) - It(`Invoke ListObjectAudits successfully with retries`, func() { + It(`Invoke GetNamespaces successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24387,25 +24493,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ListObjectAuditsOptions model - listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) - listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.Start = core.StringPtr("testString") - listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetNamespacesOptions model + getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) + getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") + getNamespacesOptionsModel.Region = core.StringPtr("testString") + getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) + getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) + getNamespacesOptionsModel.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 := catalogManagementService.ListObjectAuditsWithContext(ctx, listObjectAuditsOptionsModel) + _, _, operationErr := catalogManagementService.GetNamespacesWithContext(ctx, getNamespacesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) + result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -24413,7 +24519,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.ListObjectAuditsWithContext(ctx, listObjectAuditsOptionsModel) + _, _, operationErr = catalogManagementService.GetNamespacesWithContext(ctx, getNamespacesOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -24427,19 +24533,21 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listObjectAuditsPath)) + Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + 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()["region"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - // TODO: Add check for lookupnames query parameter + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": ["Resources"]}`) })) }) - It(`Invoke ListObjectAudits successfully`, func() { + It(`Invoke GetNamespaces successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24448,28 +24556,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ListObjectAudits(nil) + result, response, operationErr := catalogManagementService.GetNamespaces(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the ListObjectAuditsOptions model - listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) - listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.Start = core.StringPtr("testString") - listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetNamespacesOptions model + getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) + getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") + getNamespacesOptionsModel.Region = core.StringPtr("testString") + getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) + getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) + getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) + result, response, operationErr = catalogManagementService.GetNamespaces(getNamespacesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke ListObjectAudits with error: Operation validation and request error`, func() { + It(`Invoke GetNamespaces with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24477,26 +24585,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ListObjectAuditsOptions model - listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) - listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.Start = core.StringPtr("testString") - listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetNamespacesOptions model + getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) + getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") + getNamespacesOptionsModel.Region = core.StringPtr("testString") + getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) + getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) + getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) + result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) 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 ListObjectAuditsOptions model with no property values - listObjectAuditsOptionsModelNew := new(catalogmanagementv1.ListObjectAuditsOptions) + // Construct a second instance of the GetNamespacesOptions model with no property values + getNamespacesOptionsModelNew := new(catalogmanagementv1.GetNamespacesOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModelNew) + result, response, operationErr = catalogManagementService.GetNamespaces(getNamespacesOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -24514,7 +24622,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke ListObjectAudits successfully`, func() { + It(`Invoke GetNamespaces successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24522,17 +24630,17 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ListObjectAuditsOptions model - listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) - listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") - listObjectAuditsOptionsModel.Start = core.StringPtr("testString") - listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetNamespacesOptions model + getNamespacesOptionsModel := new(catalogmanagementv1.GetNamespacesOptions) + getNamespacesOptionsModel.ClusterID = core.StringPtr("testString") + getNamespacesOptionsModel.Region = core.StringPtr("testString") + getNamespacesOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getNamespacesOptionsModel.Limit = core.Int64Ptr(int64(10)) + getNamespacesOptionsModel.Offset = core.Int64Ptr(int64(0)) + getNamespacesOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) + result, response, operationErr := catalogManagementService.GetNamespaces(getNamespacesOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -24544,23 +24652,37 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextStart successfully`, func() { - responseObject := new(catalogmanagementv1.AuditLogs) - nextObject := new(catalogmanagementv1.PaginationTokenLink) - nextObject.Start = core.StringPtr("abc-123") - responseObject.Next = nextObject + It(`Invoke GetNextOffset successfully`, func() { + responseObject := new(catalogmanagementv1.NamespaceSearchResult) + responseObject.Next = core.StringPtr("ibm.com?offset=135") - value, err := responseObject.GetNextStart() + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) - Expect(value).To(Equal(core.StringPtr("abc-123"))) + Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) - It(`Invoke GetNextStart without a "Next" property in the response`, func() { - responseObject := new(catalogmanagementv1.AuditLogs) + It(`Invoke GetNextOffset without a "Next" property in the response`, func() { + responseObject := new(catalogmanagementv1.NamespaceSearchResult) - value, err := responseObject.GetNextStart() + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.NamespaceSearchResult) + responseObject.Next = core.StringPtr("ibm.com") + + value, err := responseObject.GetNextOffset() Expect(err).To(BeNil()) Expect(value).To(BeNil()) }) + It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.NamespaceSearchResult) + responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + + value, err := responseObject.GetNextOffset() + Expect(err).NotTo(BeNil()) + Expect(value).To(BeNil()) + }) }) Context(`Using mock server endpoint - paginated response`, func() { BeforeEach(func() { @@ -24569,7 +24691,7 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listObjectAuditsPath)) + Expect(req.URL.EscapedPath()).To(Equal(getNamespacesPath)) Expect(req.Method).To(Equal("GET")) // Set mock response @@ -24577,15 +24699,15 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) requestNumber++ if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) + fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":["Resources"]}`) } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":["Resources"]}`) } else { res.WriteHeader(400) } })) }) - It(`Use ObjectAuditsPager.GetNext successfully`, func() { + It(`Use GetNamespacesPager.GetNext successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24593,18 +24715,18 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - listObjectAuditsOptionsModel := &catalogmanagementv1.ListObjectAuditsOptions{ - CatalogIdentifier: core.StringPtr("testString"), - ObjectIdentifier: core.StringPtr("testString"), + getNamespacesOptionsModel := &catalogmanagementv1.GetNamespacesOptions{ + ClusterID: core.StringPtr("testString"), + Region: core.StringPtr("testString"), + XAuthRefreshToken: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), - Lookupnames: core.BoolPtr(true), } - pager, err := catalogManagementService.NewObjectAuditsPager(listObjectAuditsOptionsModel) + pager, err := catalogManagementService.NewGetNamespacesPager(getNamespacesOptionsModel) Expect(err).To(BeNil()) Expect(pager).ToNot(BeNil()) - var allResults []catalogmanagementv1.AuditLogDigest + var allResults []string for pager.HasNext() { nextPage, err := pager.GetNext() Expect(err).To(BeNil()) @@ -24613,7 +24735,7 @@ var _ = Describe(`CatalogManagementV1`, func() { } Expect(len(allResults)).To(Equal(2)) }) - It(`Use ObjectAuditsPager.GetAll successfully`, func() { + It(`Use GetNamespacesPager.GetAll successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24621,14 +24743,14 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - listObjectAuditsOptionsModel := &catalogmanagementv1.ListObjectAuditsOptions{ - CatalogIdentifier: core.StringPtr("testString"), - ObjectIdentifier: core.StringPtr("testString"), + getNamespacesOptionsModel := &catalogmanagementv1.GetNamespacesOptions{ + ClusterID: core.StringPtr("testString"), + Region: core.StringPtr("testString"), + XAuthRefreshToken: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), - Lookupnames: core.BoolPtr(true), } - pager, err := catalogManagementService.NewObjectAuditsPager(listObjectAuditsOptionsModel) + pager, err := catalogManagementService.NewGetNamespacesPager(getNamespacesOptionsModel) Expect(err).To(BeNil()) Expect(pager).ToNot(BeNil()) @@ -24639,23 +24761,24 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObjectAudit(getObjectAuditOptions *GetObjectAuditOptions) - Operation response error`, func() { - getObjectAuditPath := "/catalogs/testString/objects/testString/audits/testString" + Describe(`DeployOperators(deployOperatorsOptions *DeployOperatorsOptions) - Operation response error`, func() { + deployOperatorsPath := "/deploy/kubernetes/olm/operator" 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(getObjectAuditPath)) - Expect(req.Method).To(Equal("GET")) - // TODO: Add check for lookupnames query parameter + Expect(req.URL.EscapedPath()).To(Equal(deployOperatorsPath)) + 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"))) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetObjectAudit with error: Operation response processing error`, func() { + It(`Invoke DeployOperators with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24663,22 +24786,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAuditOptions model - getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) - getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployOperatorsOptions model + deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) + deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deployOperatorsOptionsModel.Region = core.StringPtr("testString") + deployOperatorsOptionsModel.Namespaces = []string{"testString"} + deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deployOperatorsOptionsModel.Channel = core.StringPtr("testString") + deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + deployOperatorsOptionsModel.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 := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + result, response, operationErr = catalogManagementService.DeployOperators(deployOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -24688,28 +24815,45 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObjectAudit(getObjectAuditOptions *GetObjectAuditOptions)`, func() { - getObjectAuditPath := "/catalogs/testString/objects/testString/audits/testString" + Describe(`DeployOperators(deployOperatorsOptions *DeployOperatorsOptions)`, func() { + deployOperatorsPath := "/deploy/kubernetes/olm/operator" 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(getObjectAuditPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(deployOperatorsPath)) + Expect(req.Method).To(Equal("POST")) - // TODO: Add check for lookupnames query parameter + // 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "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(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) + fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) })) }) - It(`Invoke GetObjectAudit successfully with retries`, func() { + It(`Invoke DeployOperators successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24718,24 +24862,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetObjectAuditOptions model - getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) - getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployOperatorsOptions model + deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) + deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deployOperatorsOptionsModel.Region = core.StringPtr("testString") + deployOperatorsOptionsModel.Namespaces = []string{"testString"} + deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deployOperatorsOptionsModel.Channel = core.StringPtr("testString") + deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + deployOperatorsOptionsModel.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 := catalogManagementService.GetObjectAuditWithContext(ctx, getObjectAuditOptionsModel) + _, _, operationErr := catalogManagementService.DeployOperatorsWithContext(ctx, deployOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -24743,7 +24891,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetObjectAuditWithContext(ctx, getObjectAuditOptionsModel) + _, _, operationErr = catalogManagementService.DeployOperatorsWithContext(ctx, deployOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -24757,46 +24905,67 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getObjectAuditPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(deployOperatorsPath)) + Expect(req.Method).To(Equal("POST")) - // TODO: Add check for lookupnames query parameter - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) - })) - }) - It(`Invoke GetObjectAudit successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) + // 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) + })) + }) + It(`Invoke DeployOperators successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetObjectAudit(nil) + result, response, operationErr := catalogManagementService.DeployOperators(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetObjectAuditOptions model - getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) - getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployOperatorsOptions model + deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) + deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deployOperatorsOptionsModel.Region = core.StringPtr("testString") + deployOperatorsOptionsModel.Namespaces = []string{"testString"} + deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deployOperatorsOptionsModel.Channel = core.StringPtr("testString") + deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + result, response, operationErr = catalogManagementService.DeployOperators(deployOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetObjectAudit with error: Operation validation and request error`, func() { + It(`Invoke DeployOperators with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24804,25 +24973,29 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAuditOptions model - getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) - getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployOperatorsOptions model + deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) + deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deployOperatorsOptionsModel.Region = core.StringPtr("testString") + deployOperatorsOptionsModel.Namespaces = []string{"testString"} + deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deployOperatorsOptionsModel.Channel = core.StringPtr("testString") + deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) 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 GetObjectAuditOptions model with no property values - getObjectAuditOptionsModelNew := new(catalogmanagementv1.GetObjectAuditOptions) + // Construct a second instance of the DeployOperatorsOptions model with no property values + deployOperatorsOptionsModelNew := new(catalogmanagementv1.DeployOperatorsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetObjectAudit(getObjectAuditOptionsModelNew) + result, response, operationErr = catalogManagementService.DeployOperators(deployOperatorsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -24840,7 +25013,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetObjectAudit successfully`, func() { + It(`Invoke DeployOperators successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24848,16 +25021,20 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAuditOptions model - getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) - getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployOperatorsOptions model + deployOperatorsOptionsModel := new(catalogmanagementv1.DeployOperatorsOptions) + deployOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deployOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deployOperatorsOptionsModel.Region = core.StringPtr("testString") + deployOperatorsOptionsModel.Namespaces = []string{"testString"} + deployOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + deployOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deployOperatorsOptionsModel.Channel = core.StringPtr("testString") + deployOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + deployOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + result, response, operationErr := catalogManagementService.DeployOperators(deployOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -24869,92 +25046,27 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ConsumableShareObject(consumableShareObjectOptions *ConsumableShareObjectOptions)`, func() { - consumableShareObjectPath := "/catalogs/testString/objects/testString/consume-publish" - 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(consumableShareObjectPath)) - Expect(req.Method).To(Equal("POST")) - - res.WriteHeader(202) - })) - }) - It(`Invoke ConsumableShareObject successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.ConsumableShareObject(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the ConsumableShareObjectOptions model - consumableShareObjectOptionsModel := new(catalogmanagementv1.ConsumableShareObjectOptions) - consumableShareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - consumableShareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - consumableShareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.ConsumableShareObject(consumableShareObjectOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke ConsumableShareObject with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the ConsumableShareObjectOptions model - consumableShareObjectOptionsModel := new(catalogmanagementv1.ConsumableShareObjectOptions) - consumableShareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - consumableShareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - consumableShareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.ConsumableShareObject(consumableShareObjectOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the ConsumableShareObjectOptions model with no property values - consumableShareObjectOptionsModelNew := new(catalogmanagementv1.ConsumableShareObjectOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.ConsumableShareObject(consumableShareObjectOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ShareObject(shareObjectOptions *ShareObjectOptions) - Operation response error`, func() { - shareObjectPath := "/catalogs/testString/objects/testString/share" + Describe(`ListOperators(listOperatorsOptions *ListOperatorsOptions) - Operation response error`, func() { + listOperatorsPath := "/deploy/kubernetes/olm/operator" 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(shareObjectPath)) - Expect(req.Method).To(Equal("POST")) + Expect(req.URL.EscapedPath()).To(Equal(listOperatorsPath)) + Expect(req.Method).To(Equal("GET")) + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["version_locator_id"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke ShareObject with error: Operation response processing error`, func() { + It(`Invoke ListOperators with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -24962,23 +25074,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ShareObjectOptions model - shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) - shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.IBM = core.BoolPtr(true) - shareObjectOptionsModel.Public = core.BoolPtr(true) - shareObjectOptionsModel.Enabled = core.BoolPtr(true) - shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListOperatorsOptions model + listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) + listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + listOperatorsOptionsModel.Region = core.StringPtr("testString") + listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + listOperatorsOptionsModel.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 := catalogManagementService.ShareObject(shareObjectOptionsModel) + result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ShareObject(shareObjectOptionsModel) + result, response, operationErr = catalogManagementService.ListOperators(listOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -24988,43 +25099,32 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ShareObject(shareObjectOptions *ShareObjectOptions)`, func() { - shareObjectPath := "/catalogs/testString/objects/testString/share" + Describe(`ListOperators(listOperatorsOptions *ListOperatorsOptions)`, func() { + listOperatorsPath := "/deploy/kubernetes/olm/operator" 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(shareObjectPath)) - 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(listOperatorsPath)) + Expect(req.Method).To(Equal("GET")) + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["version_locator_id"]).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(200) - fmt.Fprintf(res, "%s", `{"ibm": false, "public": true, "enabled": false}`) + fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) })) }) - It(`Invoke ShareObject successfully with retries`, func() { + It(`Invoke ListOperators successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25033,25 +25133,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ShareObjectOptions model - shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) - shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.IBM = core.BoolPtr(true) - shareObjectOptionsModel.Public = core.BoolPtr(true) - shareObjectOptionsModel.Enabled = core.BoolPtr(true) - shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListOperatorsOptions model + listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) + listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + listOperatorsOptionsModel.Region = core.StringPtr("testString") + listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + listOperatorsOptionsModel.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 := catalogManagementService.ShareObjectWithContext(ctx, shareObjectOptionsModel) + _, _, operationErr := catalogManagementService.ListOperatorsWithContext(ctx, listOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ShareObject(shareObjectOptionsModel) + result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -25059,7 +25158,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.ShareObjectWithContext(ctx, shareObjectOptionsModel) + _, _, operationErr = catalogManagementService.ListOperatorsWithContext(ctx, listOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -25073,32 +25172,21 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(shareObjectPath)) - 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(listOperatorsPath)) + Expect(req.Method).To(Equal("GET")) + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["version_locator_id"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"ibm": false, "public": true, "enabled": false}`) + fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) })) }) - It(`Invoke ShareObject successfully`, func() { + It(`Invoke ListOperators successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25107,28 +25195,27 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ShareObject(nil) + result, response, operationErr := catalogManagementService.ListOperators(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the ShareObjectOptions model - shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) - shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.IBM = core.BoolPtr(true) - shareObjectOptionsModel.Public = core.BoolPtr(true) - shareObjectOptionsModel.Enabled = core.BoolPtr(true) - shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListOperatorsOptions model + listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) + listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + listOperatorsOptionsModel.Region = core.StringPtr("testString") + listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ShareObject(shareObjectOptionsModel) + result, response, operationErr = catalogManagementService.ListOperators(listOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke ShareObject with error: Operation validation and request error`, func() { + It(`Invoke ListOperators with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25136,26 +25223,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ShareObjectOptions model - shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) - shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.IBM = core.BoolPtr(true) - shareObjectOptionsModel.Public = core.BoolPtr(true) - shareObjectOptionsModel.Enabled = core.BoolPtr(true) - shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListOperatorsOptions model + listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) + listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + listOperatorsOptionsModel.Region = core.StringPtr("testString") + listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ShareObject(shareObjectOptionsModel) + result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) 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 ShareObjectOptions model with no property values - shareObjectOptionsModelNew := new(catalogmanagementv1.ShareObjectOptions) + // Construct a second instance of the ListOperatorsOptions model with no property values + listOperatorsOptionsModelNew := new(catalogmanagementv1.ListOperatorsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ShareObject(shareObjectOptionsModelNew) + result, response, operationErr = catalogManagementService.ListOperators(listOperatorsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -25173,7 +25259,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke ShareObject successfully`, func() { + It(`Invoke ListOperators successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25181,17 +25267,16 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ShareObjectOptions model - shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) - shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") - shareObjectOptionsModel.IBM = core.BoolPtr(true) - shareObjectOptionsModel.Public = core.BoolPtr(true) - shareObjectOptionsModel.Enabled = core.BoolPtr(true) - shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListOperatorsOptions model + listOperatorsOptionsModel := new(catalogmanagementv1.ListOperatorsOptions) + listOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + listOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + listOperatorsOptionsModel.Region = core.StringPtr("testString") + listOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + listOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.ShareObject(shareObjectOptionsModel) + result, response, operationErr := catalogManagementService.ListOperators(listOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -25203,24 +25288,24 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObjectAccessList(getObjectAccessListOptions *GetObjectAccessListOptions) - Operation response error`, func() { - getObjectAccessListPath := "/catalogs/testString/objects/testString/accessv1" + Describe(`ReplaceOperators(replaceOperatorsOptions *ReplaceOperatorsOptions) - Operation response error`, func() { + replaceOperatorsPath := "/deploy/kubernetes/olm/operator" 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(getObjectAccessListPath)) - Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.EscapedPath()).To(Equal(replaceOperatorsPath)) + Expect(req.Method).To(Equal("PUT")) + Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetObjectAccessList with error: Operation response processing error`, func() { + It(`Invoke ReplaceOperators with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25228,22 +25313,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessListOptions model - getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) - getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.Start = core.StringPtr("testString") - getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ReplaceOperatorsOptions model + replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) + replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Region = core.StringPtr("testString") + replaceOperatorsOptionsModel.Namespaces = []string{"testString"} + replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") + replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + replaceOperatorsOptionsModel.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 := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + result, response, operationErr = catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -25253,29 +25342,45 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObjectAccessList(getObjectAccessListOptions *GetObjectAccessListOptions)`, func() { - getObjectAccessListPath := "/catalogs/testString/objects/testString/accessv1" + Describe(`ReplaceOperators(replaceOperatorsOptions *ReplaceOperatorsOptions)`, func() { + replaceOperatorsPath := "/deploy/kubernetes/olm/operator" 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(getObjectAccessListPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(replaceOperatorsPath)) + Expect(req.Method).To(Equal("PUT")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "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(200) - fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) })) }) - It(`Invoke GetObjectAccessList successfully with retries`, func() { + It(`Invoke ReplaceOperators successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25284,24 +25389,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetObjectAccessListOptions model - getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) - getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.Start = core.StringPtr("testString") - getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ReplaceOperatorsOptions model + replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) + replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Region = core.StringPtr("testString") + replaceOperatorsOptionsModel.Namespaces = []string{"testString"} + replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") + replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + replaceOperatorsOptionsModel.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 := catalogManagementService.GetObjectAccessListWithContext(ctx, getObjectAccessListOptionsModel) + _, _, operationErr := catalogManagementService.ReplaceOperatorsWithContext(ctx, replaceOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -25309,7 +25418,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetObjectAccessListWithContext(ctx, getObjectAccessListOptionsModel) + _, _, operationErr = catalogManagementService.ReplaceOperatorsWithContext(ctx, replaceOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -25323,18 +25432,34 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(replaceOperatorsPath)) + Expect(req.Method).To(Equal("PUT")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + fmt.Fprintf(res, "%s", `[{"phase": "Phase", "message": "Message", "link": "Link", "name": "Name", "version": "Version", "namespace": "Namespace", "package_name": "PackageName", "catalog_id": "CatalogID"}]`) })) }) - It(`Invoke GetObjectAccessList successfully`, func() { + It(`Invoke ReplaceOperators successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25343,27 +25468,31 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetObjectAccessList(nil) + result, response, operationErr := catalogManagementService.ReplaceOperators(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetObjectAccessListOptions model - getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) - getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.Start = core.StringPtr("testString") - getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ReplaceOperatorsOptions model + replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) + replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Region = core.StringPtr("testString") + replaceOperatorsOptionsModel.Namespaces = []string{"testString"} + replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") + replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + result, response, operationErr = catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetObjectAccessList with error: Operation validation and request error`, func() { + It(`Invoke ReplaceOperators with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25371,25 +25500,29 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessListOptions model - getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) - getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.Start = core.StringPtr("testString") - getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) - 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 GetObjectAccessListOptions model with no property values - getObjectAccessListOptionsModelNew := new(catalogmanagementv1.GetObjectAccessListOptions) + // Construct an instance of the ReplaceOperatorsOptions model + replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) + replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Region = core.StringPtr("testString") + replaceOperatorsOptionsModel.Namespaces = []string{"testString"} + replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") + replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) + 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 ReplaceOperatorsOptions model with no property values + replaceOperatorsOptionsModelNew := new(catalogmanagementv1.ReplaceOperatorsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModelNew) + result, response, operationErr = catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -25407,7 +25540,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetObjectAccessList successfully`, func() { + It(`Invoke ReplaceOperators successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25415,16 +25548,20 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessListOptions model - getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) - getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListOptionsModel.Start = core.StringPtr("testString") - getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ReplaceOperatorsOptions model + replaceOperatorsOptionsModel := new(catalogmanagementv1.ReplaceOperatorsOptions) + replaceOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + replaceOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Region = core.StringPtr("testString") + replaceOperatorsOptionsModel.Namespaces = []string{"testString"} + replaceOperatorsOptionsModel.AllNamespaces = core.BoolPtr(true) + replaceOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + replaceOperatorsOptionsModel.Channel = core.StringPtr("testString") + replaceOperatorsOptionsModel.InstallPlan = core.StringPtr("testString") + replaceOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceOperators(replaceOperatorsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -25435,49 +25572,27 @@ var _ = Describe(`CatalogManagementV1`, func() { testServer.Close() }) }) - Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextStart successfully`, func() { - responseObject := new(catalogmanagementv1.AccessListResult) - nextObject := new(catalogmanagementv1.PaginationTokenLink) - 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(catalogmanagementv1.AccessListResult) - - value, err := responseObject.GetNextStart() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - }) - Context(`Using mock server endpoint - paginated response`, func() { + }) + Describe(`DeleteOperators(deleteOperatorsOptions *DeleteOperatorsOptions)`, func() { + deleteOperatorsPath := "/deploy/kubernetes/olm/operator" + Context(`Using mock server endpoint`, func() { BeforeEach(func() { - var requestNumber int = 0 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(getObjectAccessListPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(deleteOperatorsPath)) + Expect(req.Method).To(Equal("DELETE")) - // Set mock response - res.Header().Set("Content-type", "application/json") + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["version_locator_id"]).To(Equal([]string{"testString"})) res.WriteHeader(200) - requestNumber++ - if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) - } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) - } else { - res.WriteHeader(400) - } })) }) - It(`Use GetObjectAccessListPager.GetNext successfully`, func() { + It(`Invoke DeleteOperators successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25485,26 +25600,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - getObjectAccessListOptionsModel := &catalogmanagementv1.GetObjectAccessListOptions{ - CatalogIdentifier: core.StringPtr("testString"), - ObjectIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - } + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeleteOperators(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) - pager, err := catalogManagementService.NewGetObjectAccessListPager(getObjectAccessListOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the DeleteOperatorsOptions model + deleteOperatorsOptionsModel := new(catalogmanagementv1.DeleteOperatorsOptions) + deleteOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deleteOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deleteOperatorsOptionsModel.Region = core.StringPtr("testString") + deleteOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deleteOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - var allResults []catalogmanagementv1.Access - for pager.HasNext() { - nextPage, err := pager.GetNext() - Expect(err).To(BeNil()) - Expect(nextPage).ToNot(BeNil()) - allResults = append(allResults, nextPage...) - } - Expect(len(allResults)).To(Equal(2)) + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeleteOperators(deleteOperatorsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) }) - It(`Use GetObjectAccessListPager.GetAll successfully`, func() { + It(`Invoke DeleteOperators with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25512,147 +25626,65 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - getObjectAccessListOptionsModel := &catalogmanagementv1.GetObjectAccessListOptions{ - CatalogIdentifier: core.StringPtr("testString"), - ObjectIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - } - - pager, err := catalogManagementService.NewGetObjectAccessListPager(getObjectAccessListOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) - - allResults, err := pager.GetAll() + // Construct an instance of the DeleteOperatorsOptions model + deleteOperatorsOptionsModel := new(catalogmanagementv1.DeleteOperatorsOptions) + deleteOperatorsOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deleteOperatorsOptionsModel.ClusterID = core.StringPtr("testString") + deleteOperatorsOptionsModel.Region = core.StringPtr("testString") + deleteOperatorsOptionsModel.VersionLocatorID = core.StringPtr("testString") + deleteOperatorsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - Expect(allResults).ToNot(BeNil()) - Expect(len(allResults)).To(Equal(2)) - }) - }) - }) - Describe(`GetObjectAccess(getObjectAccessOptions *GetObjectAccessOptions) - Operation response error`, func() { - getObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" - 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(getObjectAccessPath)) - Expect(req.Method).To(Equal("GET")) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke GetObjectAccess with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the GetObjectAccessOptions model - getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) - getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.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 := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + response, operationErr := catalogManagementService.DeleteOperators(deleteOperatorsOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeleteOperatorsOptions model with no property values + deleteOperatorsOptionsModelNew := new(catalogmanagementv1.DeleteOperatorsOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeleteOperators(deleteOperatorsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + Expect(response).To(BeNil()) }) AfterEach(func() { testServer.Close() }) }) }) - Describe(`GetObjectAccess(getObjectAccessOptions *GetObjectAccessOptions)`, func() { - getObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" - Context(`Using mock server endpoint with timeout`, func() { + Describe(`InstallVersion(installVersionOptions *InstallVersionOptions)`, func() { + installVersionPath := "/versions/testString/install" + 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(getObjectAccessPath)) - Expect(req.Method).To(Equal("GET")) - - // 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", `{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}`) - })) - }) - It(`Invoke GetObjectAccess successfully with retries`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) - - // Construct an instance of the GetObjectAccessOptions model - getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) - getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.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 := catalogManagementService.GetObjectAccessWithContext(ctx, getObjectAccessOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - - // Disable retries and test again - catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) + Expect(req.URL.EscapedPath()).To(Equal(installVersionPath)) + Expect(req.Method).To(Equal("POST")) - // Re-test the timeout error with retries disabled - ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) - defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetObjectAccessWithContext(ctx, getObjectAccessOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - }) - AfterEach(func() { - testServer.Close() - }) - }) - Context(`Using mock server endpoint`, func() { - BeforeEach(func() { - testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - defer GinkgoRecover() + // For gzip-disabled operation, verify Content-Encoding is not set. + Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessPath)) - Expect(req.Method).To(Equal("GET")) + // 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()) - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}`) + Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + res.WriteHeader(202) })) }) - It(`Invoke GetObjectAccess successfully`, func() { + It(`Invoke InstallVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25661,26 +25693,70 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetObjectAccess(nil) + response, operationErr := catalogManagementService.InstallVersion(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - Expect(result).To(BeNil()) - // Construct an instance of the GetObjectAccessOptions model - getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) - getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + + // Construct an instance of the InstallVersionOptions model + installVersionOptionsModel := new(catalogmanagementv1.InstallVersionOptions) + installVersionOptionsModel.VersionLocID = core.StringPtr("testString") + installVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + installVersionOptionsModel.ClusterID = core.StringPtr("testString") + installVersionOptionsModel.Region = core.StringPtr("testString") + installVersionOptionsModel.Namespace = core.StringPtr("testString") + installVersionOptionsModel.Namespaces = []string{"testString"} + installVersionOptionsModel.AllNamespaces = core.BoolPtr(true) + installVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel + installVersionOptionsModel.DependencyConfigs = []string{"testString"} + installVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} + installVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") + installVersionOptionsModel.Schematics = deployRequestBodySchematicsModel + installVersionOptionsModel.Script = core.StringPtr("testString") + installVersionOptionsModel.ScriptID = core.StringPtr("testString") + installVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") + installVersionOptionsModel.VcenterID = core.StringPtr("testString") + installVersionOptionsModel.VcenterLocation = core.StringPtr("testString") + installVersionOptionsModel.VcenterUser = core.StringPtr("testString") + installVersionOptionsModel.VcenterPassword = core.StringPtr("testString") + installVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") + installVersionOptionsModel.PlanID = core.StringPtr("testString") + installVersionOptionsModel.Channel = core.StringPtr("testString") + installVersionOptionsModel.InstallPlan = core.StringPtr("testString") + installVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + response, operationErr = catalogManagementService.InstallVersion(installVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) - Expect(result).ToNot(BeNil()) - }) - It(`Invoke GetObjectAccess with error: Operation validation and request error`, func() { + It(`Invoke InstallVersion with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25688,84 +25764,111 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessOptions model - getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) - getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + + // Construct an instance of the InstallVersionOptions model + installVersionOptionsModel := new(catalogmanagementv1.InstallVersionOptions) + installVersionOptionsModel.VersionLocID = core.StringPtr("testString") + installVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + installVersionOptionsModel.ClusterID = core.StringPtr("testString") + installVersionOptionsModel.Region = core.StringPtr("testString") + installVersionOptionsModel.Namespace = core.StringPtr("testString") + installVersionOptionsModel.Namespaces = []string{"testString"} + installVersionOptionsModel.AllNamespaces = core.BoolPtr(true) + installVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel + installVersionOptionsModel.DependencyConfigs = []string{"testString"} + installVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} + installVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") + installVersionOptionsModel.Schematics = deployRequestBodySchematicsModel + installVersionOptionsModel.Script = core.StringPtr("testString") + installVersionOptionsModel.ScriptID = core.StringPtr("testString") + installVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") + installVersionOptionsModel.VcenterID = core.StringPtr("testString") + installVersionOptionsModel.VcenterLocation = core.StringPtr("testString") + installVersionOptionsModel.VcenterUser = core.StringPtr("testString") + installVersionOptionsModel.VcenterPassword = core.StringPtr("testString") + installVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") + installVersionOptionsModel.PlanID = core.StringPtr("testString") + installVersionOptionsModel.Channel = core.StringPtr("testString") + installVersionOptionsModel.InstallPlan = core.StringPtr("testString") + installVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + response, operationErr := catalogManagementService.InstallVersion(installVersionOptionsModel) 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 GetObjectAccessOptions model with no property values - getObjectAccessOptionsModelNew := new(catalogmanagementv1.GetObjectAccessOptions) + // Construct a second instance of the InstallVersionOptions model with no property values + installVersionOptionsModelNew := new(catalogmanagementv1.InstallVersionOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetObjectAccess(getObjectAccessOptionsModelNew) + response, operationErr = catalogManagementService.InstallVersion(installVersionOptionsModelNew) 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 GetObjectAccess successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the GetObjectAccessOptions model - getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) - getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation - result, response, operationErr := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - - // Verify a nil result - Expect(result).To(BeNil()) }) AfterEach(func() { testServer.Close() }) }) }) - Describe(`CreateObjectAccess(createObjectAccessOptions *CreateObjectAccessOptions)`, func() { - createObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" + Describe(`PreinstallVersion(preinstallVersionOptions *PreinstallVersionOptions)`, func() { + preinstallVersionPath := "/versions/testString/preinstall" 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(createObjectAccessPath)) + Expect(req.URL.EscapedPath()).To(Equal(preinstallVersionPath)) Expect(req.Method).To(Equal("POST")) - res.WriteHeader(201) + // 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + res.WriteHeader(202) })) }) - It(`Invoke CreateObjectAccess successfully`, func() { + It(`Invoke PreinstallVersion successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25774,95 +25877,70 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.CreateObjectAccess(nil) + response, operationErr := catalogManagementService.PreinstallVersion(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the CreateObjectAccessOptions model - createObjectAccessOptionsModel := new(catalogmanagementv1.CreateObjectAccessOptions) - createObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - createObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - createObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.CreateObjectAccess(createObjectAccessOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke CreateObjectAccess with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the CreateObjectAccessOptions model - createObjectAccessOptionsModel := new(catalogmanagementv1.CreateObjectAccessOptions) - createObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - createObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - createObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - createObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.CreateObjectAccess(createObjectAccessOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the CreateObjectAccessOptions model with no property values - createObjectAccessOptionsModelNew := new(catalogmanagementv1.CreateObjectAccessOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.CreateObjectAccess(createObjectAccessOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`DeleteObjectAccess(deleteObjectAccessOptions *DeleteObjectAccessOptions)`, func() { - deleteObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" - 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(deleteObjectAccessPath)) - Expect(req.Method).To(Equal("DELETE")) - - res.WriteHeader(200) - })) - }) - It(`Invoke DeleteObjectAccess successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeleteObjectAccess(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") - // Construct an instance of the DeleteObjectAccessOptions model - deleteObjectAccessOptionsModel := new(catalogmanagementv1.DeleteObjectAccessOptions) - deleteObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - deleteObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PreinstallVersionOptions model + preinstallVersionOptionsModel := new(catalogmanagementv1.PreinstallVersionOptions) + preinstallVersionOptionsModel.VersionLocID = core.StringPtr("testString") + preinstallVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + preinstallVersionOptionsModel.ClusterID = core.StringPtr("testString") + preinstallVersionOptionsModel.Region = core.StringPtr("testString") + preinstallVersionOptionsModel.Namespace = core.StringPtr("testString") + preinstallVersionOptionsModel.Namespaces = []string{"testString"} + preinstallVersionOptionsModel.AllNamespaces = core.BoolPtr(true) + preinstallVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel + preinstallVersionOptionsModel.DependencyConfigs = []string{"testString"} + preinstallVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} + preinstallVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") + preinstallVersionOptionsModel.Schematics = deployRequestBodySchematicsModel + preinstallVersionOptionsModel.Script = core.StringPtr("testString") + preinstallVersionOptionsModel.ScriptID = core.StringPtr("testString") + preinstallVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterID = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterLocation = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterUser = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterPassword = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") + preinstallVersionOptionsModel.PlanID = core.StringPtr("testString") + preinstallVersionOptionsModel.Channel = core.StringPtr("testString") + preinstallVersionOptionsModel.InstallPlan = core.StringPtr("testString") + preinstallVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeleteObjectAccess(deleteObjectAccessOptionsModel) + response, operationErr = catalogManagementService.PreinstallVersion(preinstallVersionOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) - It(`Invoke DeleteObjectAccess with error: Operation validation and request error`, func() { + It(`Invoke PreinstallVersion with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25870,23 +25948,70 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the DeleteObjectAccessOptions model - deleteObjectAccessOptionsModel := new(catalogmanagementv1.DeleteObjectAccessOptions) - deleteObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") - deleteObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + + // Construct an instance of the PreinstallVersionOptions model + preinstallVersionOptionsModel := new(catalogmanagementv1.PreinstallVersionOptions) + preinstallVersionOptionsModel.VersionLocID = core.StringPtr("testString") + preinstallVersionOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + preinstallVersionOptionsModel.ClusterID = core.StringPtr("testString") + preinstallVersionOptionsModel.Region = core.StringPtr("testString") + preinstallVersionOptionsModel.Namespace = core.StringPtr("testString") + preinstallVersionOptionsModel.Namespaces = []string{"testString"} + preinstallVersionOptionsModel.AllNamespaces = core.BoolPtr(true) + preinstallVersionOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel + preinstallVersionOptionsModel.DependencyConfigs = []string{"testString"} + preinstallVersionOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} + preinstallVersionOptionsModel.EntitlementApikey = core.StringPtr("testString") + preinstallVersionOptionsModel.Schematics = deployRequestBodySchematicsModel + preinstallVersionOptionsModel.Script = core.StringPtr("testString") + preinstallVersionOptionsModel.ScriptID = core.StringPtr("testString") + preinstallVersionOptionsModel.VersionLocatorID = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterID = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterLocation = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterUser = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterPassword = core.StringPtr("testString") + preinstallVersionOptionsModel.VcenterDatastore = core.StringPtr("testString") + preinstallVersionOptionsModel.PlanID = core.StringPtr("testString") + preinstallVersionOptionsModel.Channel = core.StringPtr("testString") + preinstallVersionOptionsModel.InstallPlan = core.StringPtr("testString") + preinstallVersionOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeleteObjectAccess(deleteObjectAccessOptionsModel) + response, operationErr := catalogManagementService.PreinstallVersion(preinstallVersionOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the DeleteObjectAccessOptions model with no property values - deleteObjectAccessOptionsModelNew := new(catalogmanagementv1.DeleteObjectAccessOptions) + // Construct a second instance of the PreinstallVersionOptions model with no property values + preinstallVersionOptionsModelNew := new(catalogmanagementv1.PreinstallVersionOptions) // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeleteObjectAccess(deleteObjectAccessOptionsModelNew) + response, operationErr = catalogManagementService.PreinstallVersion(preinstallVersionOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -25895,24 +26020,27 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptions *GetObjectAccessListDeprecatedOptions) - Operation response error`, func() { - getObjectAccessListDeprecatedPath := "/catalogs/testString/objects/testString/access" + Describe(`GetPreinstall(getPreinstallOptions *GetPreinstallOptions) - Operation response error`, func() { + getPreinstallPath := "/versions/testString/preinstall" 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(getObjectAccessListDeprecatedPath)) + Expect(req.URL.EscapedPath()).To(Equal(getPreinstallPath)) Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["namespace"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetObjectAccessListDeprecated with error: Operation response processing error`, func() { + It(`Invoke GetPreinstall with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25920,22 +26048,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessListDeprecatedOptions model - getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) - getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) - getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetPreinstallOptions model + getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) + getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") + getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") + getPreinstallOptionsModel.Region = core.StringPtr("testString") + getPreinstallOptionsModel.Namespace = core.StringPtr("testString") + getPreinstallOptionsModel.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 := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + result, response, operationErr = catalogManagementService.GetPreinstall(getPreinstallOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -25945,29 +26074,32 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptions *GetObjectAccessListDeprecatedOptions)`, func() { - getObjectAccessListDeprecatedPath := "/catalogs/testString/objects/testString/access" + Describe(`GetPreinstall(getPreinstallOptions *GetPreinstallOptions)`, func() { + getPreinstallPath := "/versions/testString/preinstall" 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(getObjectAccessListDeprecatedPath)) + Expect(req.URL.EscapedPath()).To(Equal(getPreinstallPath)) Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["namespace"]).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(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + fmt.Fprintf(res, "%s", `{"metadata": {"cluster_id": "ClusterID", "region": "Region", "namespace": "Namespace", "workspace_id": "WorkspaceID", "workspace_name": "WorkspaceName"}, "release": {"deployments": [{"anyKey": "anyValue"}], "replicasets": [{"anyKey": "anyValue"}], "statefulsets": [{"anyKey": "anyValue"}], "pods": [{"anyKey": "anyValue"}], "errors": [{"mapKey": "Inner"}]}, "content_mgmt": {"pods": [{"mapKey": "Inner"}], "errors": [{"mapKey": "Inner"}]}}`) })) }) - It(`Invoke GetObjectAccessListDeprecated successfully with retries`, func() { + It(`Invoke GetPreinstall successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -25976,24 +26108,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetObjectAccessListDeprecatedOptions model - getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) - getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) - getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetPreinstallOptions model + getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) + getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") + getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") + getPreinstallOptionsModel.Region = core.StringPtr("testString") + getPreinstallOptionsModel.Namespace = core.StringPtr("testString") + getPreinstallOptionsModel.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 := catalogManagementService.GetObjectAccessListDeprecatedWithContext(ctx, getObjectAccessListDeprecatedOptionsModel) + _, _, operationErr := catalogManagementService.GetPreinstallWithContext(ctx, getPreinstallOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -26001,7 +26134,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetObjectAccessListDeprecatedWithContext(ctx, getObjectAccessListDeprecatedOptionsModel) + _, _, operationErr = catalogManagementService.GetPreinstallWithContext(ctx, getPreinstallOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -26015,18 +26148,21 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListDeprecatedPath)) + Expect(req.URL.EscapedPath()).To(Equal(getPreinstallPath)) Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + 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()["cluster_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["region"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["namespace"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + fmt.Fprintf(res, "%s", `{"metadata": {"cluster_id": "ClusterID", "region": "Region", "namespace": "Namespace", "workspace_id": "WorkspaceID", "workspace_name": "WorkspaceName"}, "release": {"deployments": [{"anyKey": "anyValue"}], "replicasets": [{"anyKey": "anyValue"}], "statefulsets": [{"anyKey": "anyValue"}], "pods": [{"anyKey": "anyValue"}], "errors": [{"mapKey": "Inner"}]}, "content_mgmt": {"pods": [{"mapKey": "Inner"}], "errors": [{"mapKey": "Inner"}]}}`) })) }) - It(`Invoke GetObjectAccessListDeprecated successfully`, func() { + It(`Invoke GetPreinstall successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26035,27 +26171,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(nil) + result, response, operationErr := catalogManagementService.GetPreinstall(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetObjectAccessListDeprecatedOptions model - getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) - getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) - getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetPreinstallOptions model + getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) + getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") + getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") + getPreinstallOptionsModel.Region = core.StringPtr("testString") + getPreinstallOptionsModel.Namespace = core.StringPtr("testString") + getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + result, response, operationErr = catalogManagementService.GetPreinstall(getPreinstallOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetObjectAccessListDeprecated with error: Operation validation and request error`, func() { + It(`Invoke GetPreinstall with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26063,25 +26200,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessListDeprecatedOptions model - getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) - getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) - getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetPreinstallOptions model + getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) + getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") + getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") + getPreinstallOptionsModel.Region = core.StringPtr("testString") + getPreinstallOptionsModel.Namespace = core.StringPtr("testString") + getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) 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 GetObjectAccessListDeprecatedOptions model with no property values - getObjectAccessListDeprecatedOptionsModelNew := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + // Construct a second instance of the GetPreinstallOptions model with no property values + getPreinstallOptionsModelNew := new(catalogmanagementv1.GetPreinstallOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModelNew) + result, response, operationErr = catalogManagementService.GetPreinstall(getPreinstallOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -26099,7 +26237,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetObjectAccessListDeprecated successfully`, func() { + It(`Invoke GetPreinstall successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26107,16 +26245,17 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetObjectAccessListDeprecatedOptions model - getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) - getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") - getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) - getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) - getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetPreinstallOptions model + getPreinstallOptionsModel := new(catalogmanagementv1.GetPreinstallOptions) + getPreinstallOptionsModel.VersionLocID = core.StringPtr("testString") + getPreinstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getPreinstallOptionsModel.ClusterID = core.StringPtr("testString") + getPreinstallOptionsModel.Region = core.StringPtr("testString") + getPreinstallOptionsModel.Namespace = core.StringPtr("testString") + getPreinstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + result, response, operationErr := catalogManagementService.GetPreinstall(getPreinstallOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -26127,171 +26266,17 @@ var _ = Describe(`CatalogManagementV1`, func() { testServer.Close() }) }) - Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextOffset successfully`, func() { - responseObject := new(catalogmanagementv1.ObjectAccessListResult) - responseObject.Next = core.StringPtr("ibm.com?offset=135") - - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(Equal(core.Int64Ptr(int64(135)))) - }) - It(`Invoke GetNextOffset without a "Next" property in the response`, func() { - responseObject := new(catalogmanagementv1.ObjectAccessListResult) - - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.ObjectAccessListResult) - responseObject.Next = core.StringPtr("ibm.com") - - value, err := responseObject.GetNextOffset() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { - responseObject := new(catalogmanagementv1.ObjectAccessListResult) - responseObject.Next = core.StringPtr("ibm.com?offset=tiger") - - value, err := responseObject.GetNextOffset() - Expect(err).NotTo(BeNil()) - Expect(value).To(BeNil()) - }) - }) - Context(`Using mock server endpoint - paginated response`, func() { - BeforeEach(func() { - var requestNumber int = 0 - 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(getObjectAccessListDeprecatedPath)) - Expect(req.Method).To(Equal("GET")) - - // Set mock response - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - requestNumber++ - if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) - } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) - } else { - res.WriteHeader(400) - } - })) - }) - It(`Use GetObjectAccessListDeprecatedPager.GetNext successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - getObjectAccessListDeprecatedOptionsModel := &catalogmanagementv1.GetObjectAccessListDeprecatedOptions{ - CatalogIdentifier: core.StringPtr("testString"), - ObjectIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - } - - pager, err := catalogManagementService.NewGetObjectAccessListDeprecatedPager(getObjectAccessListDeprecatedOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) - - var allResults []catalogmanagementv1.Access - for pager.HasNext() { - nextPage, err := pager.GetNext() - Expect(err).To(BeNil()) - Expect(nextPage).ToNot(BeNil()) - allResults = append(allResults, nextPage...) - } - Expect(len(allResults)).To(Equal(2)) - }) - It(`Use GetObjectAccessListDeprecatedPager.GetAll successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - getObjectAccessListDeprecatedOptionsModel := &catalogmanagementv1.GetObjectAccessListDeprecatedOptions{ - CatalogIdentifier: core.StringPtr("testString"), - ObjectIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - } - - pager, err := catalogManagementService.NewGetObjectAccessListDeprecatedPager(getObjectAccessListDeprecatedOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) - - allResults, err := pager.GetAll() - Expect(err).To(BeNil()) - Expect(allResults).ToNot(BeNil()) - Expect(len(allResults)).To(Equal(2)) - }) - }) - }) - Describe(`DeleteObjectAccessList(deleteObjectAccessListOptions *DeleteObjectAccessListOptions) - Operation response error`, func() { - deleteObjectAccessListPath := "/catalogs/testString/objects/testString/access" - 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(deleteObjectAccessListPath)) - Expect(req.Method).To(Equal("DELETE")) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) - }) - It(`Invoke DeleteObjectAccessList with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the DeleteObjectAccessListOptions model - deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) - deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} - deleteObjectAccessListOptionsModel.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 := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) }) - Describe(`DeleteObjectAccessList(deleteObjectAccessListOptions *DeleteObjectAccessListOptions)`, func() { - deleteObjectAccessListPath := "/catalogs/testString/objects/testString/access" - Context(`Using mock server endpoint with timeout`, func() { + Describe(`ValidateInstall(validateInstallOptions *ValidateInstallOptions)`, func() { + validateInstallPath := "/versions/testString/validation/install" + 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(deleteObjectAccessListPath)) - Expect(req.Method).To(Equal("DELETE")) + Expect(req.URL.EscapedPath()).To(Equal(validateInstallPath)) + Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) @@ -26309,41 +26294,265 @@ var _ = Describe(`CatalogManagementV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) - // 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", `{"errors": {"mapKey": "Inner"}}`) + 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()["targetContextName"]).To(Equal([]string{"testString"})) + res.WriteHeader(202) })) }) - It(`Invoke DeleteObjectAccessList successfully with retries`, func() { + It(`Invoke ValidateInstall successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - catalogManagementService.EnableRetries(0, 0) - - // Construct an instance of the DeleteObjectAccessListOptions model - deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) - deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} - deleteObjectAccessListOptionsModel.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 := catalogManagementService.DeleteObjectAccessListWithContext(ctx, deleteObjectAccessListOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.ValidateInstall(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + + // Construct an instance of the ValidateInstallOptions model + validateInstallOptionsModel := new(catalogmanagementv1.ValidateInstallOptions) + validateInstallOptionsModel.VersionLocID = core.StringPtr("testString") + validateInstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + validateInstallOptionsModel.ClusterID = core.StringPtr("testString") + validateInstallOptionsModel.Region = core.StringPtr("testString") + validateInstallOptionsModel.Namespace = core.StringPtr("testString") + validateInstallOptionsModel.Namespaces = []string{"testString"} + validateInstallOptionsModel.AllNamespaces = core.BoolPtr(true) + validateInstallOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel + validateInstallOptionsModel.DependencyConfigs = []string{"testString"} + validateInstallOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} + validateInstallOptionsModel.EntitlementApikey = core.StringPtr("testString") + validateInstallOptionsModel.Schematics = deployRequestBodySchematicsModel + validateInstallOptionsModel.Script = core.StringPtr("testString") + validateInstallOptionsModel.ScriptID = core.StringPtr("testString") + validateInstallOptionsModel.VersionLocatorID = core.StringPtr("testString") + validateInstallOptionsModel.VcenterID = core.StringPtr("testString") + validateInstallOptionsModel.VcenterLocation = core.StringPtr("testString") + validateInstallOptionsModel.VcenterUser = core.StringPtr("testString") + validateInstallOptionsModel.VcenterPassword = core.StringPtr("testString") + validateInstallOptionsModel.VcenterDatastore = core.StringPtr("testString") + validateInstallOptionsModel.PlanID = core.StringPtr("testString") + validateInstallOptionsModel.Channel = core.StringPtr("testString") + validateInstallOptionsModel.InstallPlan = core.StringPtr("testString") + validateInstallOptionsModel.TargetContextName = core.StringPtr("testString") + validateInstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.ValidateInstall(validateInstallOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke ValidateInstall with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + + // Construct an instance of the ValidateInstallOptions model + validateInstallOptionsModel := new(catalogmanagementv1.ValidateInstallOptions) + validateInstallOptionsModel.VersionLocID = core.StringPtr("testString") + validateInstallOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + validateInstallOptionsModel.ClusterID = core.StringPtr("testString") + validateInstallOptionsModel.Region = core.StringPtr("testString") + validateInstallOptionsModel.Namespace = core.StringPtr("testString") + validateInstallOptionsModel.Namespaces = []string{"testString"} + validateInstallOptionsModel.AllNamespaces = core.BoolPtr(true) + validateInstallOptionsModel.OverrideValues = deployRequestBodyOverrideValuesModel + validateInstallOptionsModel.DependencyConfigs = []string{"testString"} + validateInstallOptionsModel.EnvironmentVariables = []catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel} + validateInstallOptionsModel.EntitlementApikey = core.StringPtr("testString") + validateInstallOptionsModel.Schematics = deployRequestBodySchematicsModel + validateInstallOptionsModel.Script = core.StringPtr("testString") + validateInstallOptionsModel.ScriptID = core.StringPtr("testString") + validateInstallOptionsModel.VersionLocatorID = core.StringPtr("testString") + validateInstallOptionsModel.VcenterID = core.StringPtr("testString") + validateInstallOptionsModel.VcenterLocation = core.StringPtr("testString") + validateInstallOptionsModel.VcenterUser = core.StringPtr("testString") + validateInstallOptionsModel.VcenterPassword = core.StringPtr("testString") + validateInstallOptionsModel.VcenterDatastore = core.StringPtr("testString") + validateInstallOptionsModel.PlanID = core.StringPtr("testString") + validateInstallOptionsModel.Channel = core.StringPtr("testString") + validateInstallOptionsModel.InstallPlan = core.StringPtr("testString") + validateInstallOptionsModel.TargetContextName = core.StringPtr("testString") + validateInstallOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.ValidateInstall(validateInstallOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the ValidateInstallOptions model with no property values + validateInstallOptionsModelNew := new(catalogmanagementv1.ValidateInstallOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.ValidateInstall(validateInstallOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetValidationStatus(getValidationStatusOptions *GetValidationStatusOptions) - Operation response error`, func() { + getValidationStatusPath := "/versions/testString/validation/install" + 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(getValidationStatusPath)) + Expect(req.Method).To(Equal("GET")) + 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()["targetContextName"]).To(Equal([]string{"testString"})) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetValidationStatus with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetValidationStatusOptions model + getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) + getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") + getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") + getValidationStatusOptionsModel.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 := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetValidationStatus(getValidationStatusOptions *GetValidationStatusOptions)`, func() { + getValidationStatusPath := "/versions/testString/validation/install" + 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(getValidationStatusPath)) + Expect(req.Method).To(Equal("GET")) + + 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()["targetContextName"]).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(200) + fmt.Fprintf(res, "%s", `{"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}`) + })) + }) + It(`Invoke GetValidationStatus successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the GetValidationStatusOptions model + getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) + getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") + getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") + getValidationStatusOptionsModel.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 := catalogManagementService.GetValidationStatusWithContext(ctx, getValidationStatusOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -26351,7 +26560,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.DeleteObjectAccessListWithContext(ctx, deleteObjectAccessListOptionsModel) + _, _, operationErr = catalogManagementService.GetValidationStatusWithContext(ctx, getValidationStatusOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -26365,32 +26574,19 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(deleteObjectAccessListPath)) - Expect(req.Method).To(Equal("DELETE")) - - // 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(getValidationStatusPath)) + Expect(req.Method).To(Equal("GET")) + 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()["targetContextName"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"errors": {"mapKey": "Inner"}}`) + fmt.Fprintf(res, "%s", `{"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}`) })) }) - It(`Invoke DeleteObjectAccessList successfully`, func() { + It(`Invoke GetValidationStatus successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26399,26 +26595,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.DeleteObjectAccessList(nil) + result, response, operationErr := catalogManagementService.GetValidationStatus(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the DeleteObjectAccessListOptions model - deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) - deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} - deleteObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetValidationStatusOptions model + getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) + getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") + getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") + getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + result, response, operationErr = catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke DeleteObjectAccessList with error: Operation validation and request error`, func() { + It(`Invoke GetValidationStatus with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26426,24 +26622,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the DeleteObjectAccessListOptions model - deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) - deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} - deleteObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetValidationStatusOptions model + getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) + getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") + getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") + getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) 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 DeleteObjectAccessListOptions model with no property values - deleteObjectAccessListOptionsModelNew := new(catalogmanagementv1.DeleteObjectAccessListOptions) + // Construct a second instance of the GetValidationStatusOptions model with no property values + getValidationStatusOptionsModelNew := new(catalogmanagementv1.GetValidationStatusOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModelNew) + result, response, operationErr = catalogManagementService.GetValidationStatus(getValidationStatusOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -26461,7 +26657,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke DeleteObjectAccessList successfully`, func() { + It(`Invoke GetValidationStatus successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26469,15 +26665,15 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the DeleteObjectAccessListOptions model - deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) - deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} - deleteObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetValidationStatusOptions model + getValidationStatusOptionsModel := new(catalogmanagementv1.GetValidationStatusOptions) + getValidationStatusOptionsModel.VersionLocID = core.StringPtr("testString") + getValidationStatusOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + getValidationStatusOptionsModel.TargetContextName = core.StringPtr("testString") + getValidationStatusOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.GetValidationStatus(getValidationStatusOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -26489,22 +26685,28 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`AddObjectAccessList(addObjectAccessListOptions *AddObjectAccessListOptions) - Operation response error`, func() { - addObjectAccessListPath := "/catalogs/testString/objects/testString/access" + Describe(`SearchObjects(searchObjectsOptions *SearchObjectsOptions) - Operation response error`, func() { + searchObjectsPath := "/objects" 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(addObjectAccessListPath)) - Expect(req.Method).To(Equal("POST")) + Expect(req.URL.EscapedPath()).To(Equal(searchObjectsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["query"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["kind"]).To(Equal([]string{"vpe"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // TODO: Add check for collapse query parameter + // TODO: Add check for digest query parameter res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) + res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke AddObjectAccessList with error: Operation response processing error`, func() { + It(`Invoke SearchObjects with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26512,21 +26714,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the AddObjectAccessListOptions model - addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) - addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.Accesses = []string{"testString"} - addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SearchObjectsOptions model + searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) + searchObjectsOptionsModel.Query = core.StringPtr("testString") + searchObjectsOptionsModel.Kind = core.StringPtr("vpe") + searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + searchObjectsOptionsModel.Collapse = core.BoolPtr(true) + searchObjectsOptionsModel.Digest = core.BoolPtr(true) + searchObjectsOptionsModel.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 := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + result, response, operationErr = catalogManagementService.SearchObjects(searchObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -26536,43 +26741,33 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`AddObjectAccessList(addObjectAccessListOptions *AddObjectAccessListOptions)`, func() { - addObjectAccessListPath := "/catalogs/testString/objects/testString/access" + Describe(`SearchObjects(searchObjectsOptions *SearchObjectsOptions)`, func() { + searchObjectsPath := "/objects" 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(addObjectAccessListPath)) - 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(searchObjectsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["query"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["kind"]).To(Equal([]string{"vpe"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // TODO: Add check for collapse query parameter + // TODO: Add check for digest 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(201) - fmt.Fprintf(res, "%s", `{"errors": {"mapKey": "Inner"}}`) + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) })) }) - It(`Invoke AddObjectAccessList successfully with retries`, func() { + It(`Invoke SearchObjects successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26581,23 +26776,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the AddObjectAccessListOptions model - addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) - addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.Accesses = []string{"testString"} - addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SearchObjectsOptions model + searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) + searchObjectsOptionsModel.Query = core.StringPtr("testString") + searchObjectsOptionsModel.Kind = core.StringPtr("vpe") + searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + searchObjectsOptionsModel.Collapse = core.BoolPtr(true) + searchObjectsOptionsModel.Digest = core.BoolPtr(true) + searchObjectsOptionsModel.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 := catalogManagementService.AddObjectAccessListWithContext(ctx, addObjectAccessListOptionsModel) + _, _, operationErr := catalogManagementService.SearchObjectsWithContext(ctx, searchObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -26605,7 +26803,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.AddObjectAccessListWithContext(ctx, addObjectAccessListOptionsModel) + _, _, operationErr = catalogManagementService.SearchObjectsWithContext(ctx, searchObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -26619,32 +26817,22 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(addObjectAccessListPath)) - 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(searchObjectsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["query"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["kind"]).To(Equal([]string{"vpe"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // TODO: Add check for collapse query parameter + // TODO: Add check for digest query parameter // Set mock response res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"errors": {"mapKey": "Inner"}}`) + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) })) }) - It(`Invoke AddObjectAccessList successfully`, func() { + It(`Invoke SearchObjects successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26653,26 +26841,29 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.AddObjectAccessList(nil) + result, response, operationErr := catalogManagementService.SearchObjects(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the AddObjectAccessListOptions model - addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) - addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.Accesses = []string{"testString"} - addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SearchObjectsOptions model + searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) + searchObjectsOptionsModel.Query = core.StringPtr("testString") + searchObjectsOptionsModel.Kind = core.StringPtr("vpe") + searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + searchObjectsOptionsModel.Collapse = core.BoolPtr(true) + searchObjectsOptionsModel.Digest = core.BoolPtr(true) + searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + result, response, operationErr = catalogManagementService.SearchObjects(searchObjectsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke AddObjectAccessList with error: Operation validation and request error`, func() { + It(`Invoke SearchObjects with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26680,24 +26871,27 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the AddObjectAccessListOptions model - addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) - addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.Accesses = []string{"testString"} - addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SearchObjectsOptions model + searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) + searchObjectsOptionsModel.Query = core.StringPtr("testString") + searchObjectsOptionsModel.Kind = core.StringPtr("vpe") + searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + searchObjectsOptionsModel.Collapse = core.BoolPtr(true) + searchObjectsOptionsModel.Digest = core.BoolPtr(true) + searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) 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 AddObjectAccessListOptions model with no property values - addObjectAccessListOptionsModelNew := new(catalogmanagementv1.AddObjectAccessListOptions) + // Construct a second instance of the SearchObjectsOptions model with no property values + searchObjectsOptionsModelNew := new(catalogmanagementv1.SearchObjectsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModelNew) + result, response, operationErr = catalogManagementService.SearchObjects(searchObjectsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -26712,10 +26906,10 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Set success status code with no respoonse body - res.WriteHeader(201) + res.WriteHeader(200) })) }) - It(`Invoke AddObjectAccessList successfully`, func() { + It(`Invoke SearchObjects successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26723,15 +26917,18 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the AddObjectAccessListOptions model - addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) - addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") - addObjectAccessListOptionsModel.Accesses = []string{"testString"} - addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the SearchObjectsOptions model + searchObjectsOptionsModel := new(catalogmanagementv1.SearchObjectsOptions) + searchObjectsOptionsModel.Query = core.StringPtr("testString") + searchObjectsOptionsModel.Kind = core.StringPtr("vpe") + searchObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + searchObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + searchObjectsOptionsModel.Collapse = core.BoolPtr(true) + searchObjectsOptionsModel.Digest = core.BoolPtr(true) + searchObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + result, response, operationErr := catalogManagementService.SearchObjects(searchObjectsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -26742,25 +26939,138 @@ var _ = Describe(`CatalogManagementV1`, func() { testServer.Close() }) }) - }) - Describe(`CreateOfferingInstance(createOfferingInstanceOptions *CreateOfferingInstanceOptions) - Operation response error`, func() { - createOfferingInstancePath := "/instances/offerings" + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextOffset successfully`, func() { + responseObject := new(catalogmanagementv1.ObjectSearchResult) + responseObject.Next = core.StringPtr("ibm.com?offset=135") + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(Equal(core.Int64Ptr(int64(135)))) + }) + It(`Invoke GetNextOffset without a "Next" property in the response`, func() { + responseObject := new(catalogmanagementv1.ObjectSearchResult) + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.ObjectSearchResult) + responseObject.Next = core.StringPtr("ibm.com") + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.ObjectSearchResult) + responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + + value, err := responseObject.GetNextOffset() + Expect(err).NotTo(BeNil()) + Expect(value).To(BeNil()) + }) + }) + Context(`Using mock server endpoint - paginated response`, func() { + BeforeEach(func() { + var requestNumber int = 0 + 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(searchObjectsPath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) + } else { + res.WriteHeader(400) + } + })) + }) + It(`Use SearchObjectsPager.GetNext successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + searchObjectsOptionsModel := &catalogmanagementv1.SearchObjectsOptions{ + Query: core.StringPtr("testString"), + Kind: core.StringPtr("vpe"), + Limit: core.Int64Ptr(int64(10)), + Collapse: core.BoolPtr(true), + Digest: core.BoolPtr(true), + } + + pager, err := catalogManagementService.NewSearchObjectsPager(searchObjectsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + var allResults []catalogmanagementv1.CatalogObject + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) + }) + It(`Use SearchObjectsPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + searchObjectsOptionsModel := &catalogmanagementv1.SearchObjectsOptions{ + Query: core.StringPtr("testString"), + Kind: core.StringPtr("vpe"), + Limit: core.Int64Ptr(int64(10)), + Collapse: core.BoolPtr(true), + Digest: core.BoolPtr(true), + } + + pager, err := catalogManagementService.NewSearchObjectsPager(searchObjectsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) + }) + }) + }) + Describe(`ListObjects(listObjectsOptions *ListObjectsOptions) - Operation response error`, func() { + listObjectsPath := "/catalogs/testString/objects" 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(createOfferingInstancePath)) - 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.EscapedPath()).To(Equal(listObjectsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.Query()["name"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["sort"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) + res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke CreateOfferingInstance with error: Operation response processing error`, func() { + It(`Invoke ListObjects with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26768,59 +27078,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the CreateOfferingInstanceOptions model - createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) - createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectsOptions model + listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) + listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listObjectsOptionsModel.Name = core.StringPtr("testString") + listObjectsOptionsModel.Sort = core.StringPtr("testString") + listObjectsOptionsModel.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 := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + result, response, operationErr = catalogManagementService.ListObjects(listObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -26830,45 +27104,31 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`CreateOfferingInstance(createOfferingInstanceOptions *CreateOfferingInstanceOptions)`, func() { - createOfferingInstancePath := "/instances/offerings" + Describe(`ListObjects(listObjectsOptions *ListObjectsOptions)`, func() { + listObjectsPath := "/catalogs/testString/objects" 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(createOfferingInstancePath)) - 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(listObjectsPath)) + Expect(req.Method).To(Equal("GET")) - 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()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.Query()["name"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["sort"]).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", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) })) }) - It(`Invoke CreateOfferingInstance successfully with retries`, func() { + It(`Invoke ListObjects successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26877,61 +27137,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the CreateOfferingInstanceOptions model - createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) - createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectsOptions model + listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) + listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listObjectsOptionsModel.Name = core.StringPtr("testString") + listObjectsOptionsModel.Sort = core.StringPtr("testString") + listObjectsOptionsModel.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 := catalogManagementService.CreateOfferingInstanceWithContext(ctx, createOfferingInstanceOptionsModel) + _, _, operationErr := catalogManagementService.ListObjectsWithContext(ctx, listObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -26939,7 +27163,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.CreateOfferingInstanceWithContext(ctx, createOfferingInstanceOptionsModel) + _, _, operationErr = catalogManagementService.ListObjectsWithContext(ctx, listObjectsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -26953,34 +27177,20 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(createOfferingInstancePath)) - 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(listObjectsPath)) + Expect(req.Method).To(Equal("GET")) - 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()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.Query()["name"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["sort"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") - res.WriteHeader(201) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}]}`) })) }) - It(`Invoke CreateOfferingInstance successfully`, func() { + It(`Invoke ListObjects successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -26989,64 +27199,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.CreateOfferingInstance(nil) + result, response, operationErr := catalogManagementService.ListObjects(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the CreateOfferingInstanceOptions model - createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) - createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectsOptions model + listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) + listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listObjectsOptionsModel.Name = core.StringPtr("testString") + listObjectsOptionsModel.Sort = core.StringPtr("testString") + listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + result, response, operationErr = catalogManagementService.ListObjects(listObjectsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke CreateOfferingInstance with error: Operation validation and request error`, func() { + It(`Invoke ListObjects with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27054,62 +27228,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the CreateOfferingInstanceOptions model - createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) - createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectsOptions model + listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) + listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listObjectsOptionsModel.Name = core.StringPtr("testString") + listObjectsOptionsModel.Sort = core.StringPtr("testString") + listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) 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 CreateOfferingInstanceOptions model with no property values - createOfferingInstanceOptionsModelNew := new(catalogmanagementv1.CreateOfferingInstanceOptions) + // Construct a second instance of the ListObjectsOptions model with no property values + listObjectsOptionsModelNew := new(catalogmanagementv1.ListObjectsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModelNew) + result, response, operationErr = catalogManagementService.ListObjects(listObjectsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -27124,10 +27262,10 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Set success status code with no respoonse body - res.WriteHeader(201) + res.WriteHeader(200) })) }) - It(`Invoke CreateOfferingInstance successfully`, func() { + It(`Invoke ListObjects successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27135,53 +27273,17 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the CreateOfferingInstanceOptions model - createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) - createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectsOptions model + listObjectsOptionsModel := new(catalogmanagementv1.ListObjectsOptions) + listObjectsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listObjectsOptionsModel.Name = core.StringPtr("testString") + listObjectsOptionsModel.Sort = core.StringPtr("testString") + listObjectsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.ListObjects(listObjectsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -27192,43 +27294,192 @@ var _ = Describe(`CatalogManagementV1`, func() { testServer.Close() }) }) - }) - Describe(`GetOfferingInstance(getOfferingInstanceOptions *GetOfferingInstanceOptions) - Operation response error`, func() { - getOfferingInstancePath := "/instances/offerings/testString" - 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() + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextOffset successfully`, func() { + responseObject := new(catalogmanagementv1.ObjectListResult) + responseObject.Next = core.StringPtr("ibm.com?offset=135") - // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getOfferingInstancePath)) - Expect(req.Method).To(Equal("GET")) - res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) - })) + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) - It(`Invoke GetOfferingInstance with error: Operation response processing error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, + It(`Invoke GetNextOffset without a "Next" property in the response`, func() { + responseObject := new(catalogmanagementv1.ObjectListResult) + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.ObjectListResult) + responseObject.Next = core.StringPtr("ibm.com") + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.ObjectListResult) + responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + + value, err := responseObject.GetNextOffset() + Expect(err).NotTo(BeNil()) + Expect(value).To(BeNil()) + }) + }) + Context(`Using mock server endpoint - paginated response`, func() { + BeforeEach(func() { + var requestNumber int = 0 + 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(listObjectsPath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","_rev":"Rev","name":"Name","crn":"CRN","url":"URL","parent_id":"ParentID","label_i18n":{"mapKey":"Inner"},"label":"Label","tags":["Tags"],"created":"2019-01-01T12:00:00.000Z","updated":"2019-01-01T12:00:00.000Z","short_description":"ShortDescription","short_description_i18n":{"mapKey":"Inner"},"kind":"Kind","publish":{"pc_managed":false,"approval_type":"ApprovalType","publish_approved":false,"share_with_all":true,"share_with_ibm":true,"share_enabled":true,"original_crn":"OriginalCRN","public_crn":"PublicCRN","approval_record":{"anyKey":"anyValue"},"permit_ibm_public_publish":true,"ibm_approved":false,"public_approved":true},"state":{"current":"Current","current_entered":"2019-01-01T12:00:00.000Z","pending":"Pending","pending_requested":"2019-01-01T12:00:00.000Z","previous":"Previous"},"catalog_id":"CatalogID","catalog_name":"CatalogName","data":{"anyKey":"anyValue"}}]}`) + } else { + res.WriteHeader(400) + } + })) + }) + It(`Use ObjectsPager.GetNext successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetOfferingInstanceOptions model - getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) - getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + listObjectsOptionsModel := &catalogmanagementv1.ListObjectsOptions{ + CatalogIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Name: core.StringPtr("testString"), + Sort: core.StringPtr("testString"), + } + + pager, err := catalogManagementService.NewObjectsPager(listObjectsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + var allResults []catalogmanagementv1.CatalogObject + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) + }) + It(`Use ObjectsPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + listObjectsOptionsModel := &catalogmanagementv1.ListObjectsOptions{ + CatalogIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Name: core.StringPtr("testString"), + Sort: core.StringPtr("testString"), + } + + pager, err := catalogManagementService.NewObjectsPager(listObjectsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) + }) + }) + }) + Describe(`CreateObject(createObjectOptions *CreateObjectOptions) - Operation response error`, func() { + createObjectPath := "/catalogs/testString/objects" + 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(createObjectPath)) + Expect(req.Method).To(Equal("POST")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(201) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke CreateObject with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the CreateObjectOptions model + createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) + createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectOptionsModel.Name = core.StringPtr("testString") + createObjectOptionsModel.CRN = core.StringPtr("testString") + createObjectOptionsModel.URL = core.StringPtr("testString") + createObjectOptionsModel.ParentID = core.StringPtr("testString") + createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Label = core.StringPtr("testString") + createObjectOptionsModel.Tags = []string{"testString"} + createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.ShortDescription = core.StringPtr("testString") + createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Kind = core.StringPtr("testString") + createObjectOptionsModel.Publish = publishObjectModel + createObjectOptionsModel.State = stateModel + createObjectOptionsModel.CatalogID = core.StringPtr("testString") + createObjectOptionsModel.CatalogName = core.StringPtr("testString") + createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + createObjectOptionsModel.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 := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + result, response, operationErr = catalogManagementService.CreateObject(createObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -27238,27 +27489,43 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetOfferingInstance(getOfferingInstanceOptions *GetOfferingInstanceOptions)`, func() { - getOfferingInstancePath := "/instances/offerings/testString" + Describe(`CreateObject(createObjectOptions *CreateObjectOptions)`, func() { + createObjectPath := "/catalogs/testString/objects" 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(getOfferingInstancePath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(createObjectPath)) + 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()) // 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", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + res.WriteHeader(201) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) })) }) - It(`Invoke GetOfferingInstance successfully with retries`, func() { + It(`Invoke CreateObject successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27267,21 +27534,61 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetOfferingInstanceOptions model - getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) - getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the CreateObjectOptions model + createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) + createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectOptionsModel.Name = core.StringPtr("testString") + createObjectOptionsModel.CRN = core.StringPtr("testString") + createObjectOptionsModel.URL = core.StringPtr("testString") + createObjectOptionsModel.ParentID = core.StringPtr("testString") + createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Label = core.StringPtr("testString") + createObjectOptionsModel.Tags = []string{"testString"} + createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.ShortDescription = core.StringPtr("testString") + createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Kind = core.StringPtr("testString") + createObjectOptionsModel.Publish = publishObjectModel + createObjectOptionsModel.State = stateModel + createObjectOptionsModel.CatalogID = core.StringPtr("testString") + createObjectOptionsModel.CatalogName = core.StringPtr("testString") + createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + createObjectOptionsModel.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 := catalogManagementService.GetOfferingInstanceWithContext(ctx, getOfferingInstanceOptionsModel) + _, _, operationErr := catalogManagementService.CreateObjectWithContext(ctx, createObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -27289,7 +27596,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetOfferingInstanceWithContext(ctx, getOfferingInstanceOptionsModel) + _, _, operationErr = catalogManagementService.CreateObjectWithContext(ctx, createObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -27303,16 +27610,32 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getOfferingInstancePath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(createObjectPath)) + 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()) // Set mock response res.Header().Set("Content-type", "application/json") - res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + res.WriteHeader(201) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) })) }) - It(`Invoke GetOfferingInstance successfully`, func() { + It(`Invoke CreateObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27321,24 +27644,64 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetOfferingInstance(nil) + result, response, operationErr := catalogManagementService.CreateObject(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetOfferingInstanceOptions model - getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) - getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the CreateObjectOptions model + createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) + createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectOptionsModel.Name = core.StringPtr("testString") + createObjectOptionsModel.CRN = core.StringPtr("testString") + createObjectOptionsModel.URL = core.StringPtr("testString") + createObjectOptionsModel.ParentID = core.StringPtr("testString") + createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Label = core.StringPtr("testString") + createObjectOptionsModel.Tags = []string{"testString"} + createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.ShortDescription = core.StringPtr("testString") + createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Kind = core.StringPtr("testString") + createObjectOptionsModel.Publish = publishObjectModel + createObjectOptionsModel.State = stateModel + createObjectOptionsModel.CatalogID = core.StringPtr("testString") + createObjectOptionsModel.CatalogName = core.StringPtr("testString") + createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + result, response, operationErr = catalogManagementService.CreateObject(createObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetOfferingInstance with error: Operation validation and request error`, func() { + It(`Invoke CreateObject with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27346,22 +27709,62 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetOfferingInstanceOptions model - getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) - getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the CreateObjectOptions model + createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) + createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectOptionsModel.Name = core.StringPtr("testString") + createObjectOptionsModel.CRN = core.StringPtr("testString") + createObjectOptionsModel.URL = core.StringPtr("testString") + createObjectOptionsModel.ParentID = core.StringPtr("testString") + createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Label = core.StringPtr("testString") + createObjectOptionsModel.Tags = []string{"testString"} + createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.ShortDescription = core.StringPtr("testString") + createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Kind = core.StringPtr("testString") + createObjectOptionsModel.Publish = publishObjectModel + createObjectOptionsModel.State = stateModel + createObjectOptionsModel.CatalogID = core.StringPtr("testString") + createObjectOptionsModel.CatalogName = core.StringPtr("testString") + createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) 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 GetOfferingInstanceOptions model with no property values - getOfferingInstanceOptionsModelNew := new(catalogmanagementv1.GetOfferingInstanceOptions) + // Construct a second instance of the CreateObjectOptions model with no property values + createObjectOptionsModelNew := new(catalogmanagementv1.CreateObjectOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModelNew) + result, response, operationErr = catalogManagementService.CreateObject(createObjectOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -27376,10 +27779,10 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Set success status code with no respoonse body - res.WriteHeader(200) + res.WriteHeader(201) })) }) - It(`Invoke GetOfferingInstance successfully`, func() { + It(`Invoke CreateObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27387,13 +27790,53 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetOfferingInstanceOptions model - getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) - getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the CreateObjectOptions model + createObjectOptionsModel := new(catalogmanagementv1.CreateObjectOptions) + createObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectOptionsModel.Name = core.StringPtr("testString") + createObjectOptionsModel.CRN = core.StringPtr("testString") + createObjectOptionsModel.URL = core.StringPtr("testString") + createObjectOptionsModel.ParentID = core.StringPtr("testString") + createObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Label = core.StringPtr("testString") + createObjectOptionsModel.Tags = []string{"testString"} + createObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createObjectOptionsModel.ShortDescription = core.StringPtr("testString") + createObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + createObjectOptionsModel.Kind = core.StringPtr("testString") + createObjectOptionsModel.Publish = publishObjectModel + createObjectOptionsModel.State = stateModel + createObjectOptionsModel.CatalogID = core.StringPtr("testString") + createObjectOptionsModel.CatalogName = core.StringPtr("testString") + createObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + createObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.CreateObject(createObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -27405,24 +27848,22 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`PutOfferingInstance(putOfferingInstanceOptions *PutOfferingInstanceOptions) - Operation response error`, func() { - putOfferingInstancePath := "/instances/offerings/testString" + Describe(`GetObject(getObjectOptions *GetObjectOptions) - Operation response error`, func() { + getObjectPath := "/catalogs/testString/objects/testString" 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(putOfferingInstancePath)) - Expect(req.Method).To(Equal("PUT")) - 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.EscapedPath()).To(Equal(getObjectPath)) + Expect(req.Method).To(Equal("GET")) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke PutOfferingInstance with error: Operation response processing error`, func() { + It(`Invoke GetObject with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27430,60 +27871,20 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the PutOfferingInstanceOptions model - putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) - putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectOptions model + getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) + getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectOptionsModel.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 := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + result, response, operationErr = catalogManagementService.GetObject(getObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -27493,45 +27894,27 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`PutOfferingInstance(putOfferingInstanceOptions *PutOfferingInstanceOptions)`, func() { - putOfferingInstancePath := "/instances/offerings/testString" + Describe(`GetObject(getObjectOptions *GetObjectOptions)`, func() { + getObjectPath := "/catalogs/testString/objects/testString" 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(putOfferingInstancePath)) - Expect(req.Method).To(Equal("PUT")) - - // 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(getObjectPath)) + Expect(req.Method).To(Equal("GET")) - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "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(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) })) }) - It(`Invoke PutOfferingInstance successfully with retries`, func() { + It(`Invoke GetObject successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27540,62 +27923,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the PutOfferingInstanceOptions model - putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) - putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectOptions model + getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) + getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectOptionsModel.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 := catalogManagementService.PutOfferingInstanceWithContext(ctx, putOfferingInstanceOptionsModel) + _, _, operationErr := catalogManagementService.GetObjectWithContext(ctx, getObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -27603,7 +27946,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.PutOfferingInstanceWithContext(ctx, putOfferingInstanceOptionsModel) + _, _, operationErr = catalogManagementService.GetObjectWithContext(ctx, getObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -27617,34 +27960,16 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(putOfferingInstancePath)) - Expect(req.Method).To(Equal("PUT")) - - // 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(getObjectPath)) + Expect(req.Method).To(Equal("GET")) - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) })) }) - It(`Invoke PutOfferingInstance successfully`, func() { + It(`Invoke GetObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27653,65 +27978,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.PutOfferingInstance(nil) + result, response, operationErr := catalogManagementService.GetObject(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the PutOfferingInstanceOptions model - putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) - putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectOptions model + getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) + getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + result, response, operationErr = catalogManagementService.GetObject(getObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke PutOfferingInstance with error: Operation validation and request error`, func() { + It(`Invoke GetObject with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27719,63 +28004,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the PutOfferingInstanceOptions model - putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) - putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectOptions model + getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) + getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) 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 PutOfferingInstanceOptions model with no property values - putOfferingInstanceOptionsModelNew := new(catalogmanagementv1.PutOfferingInstanceOptions) + // Construct a second instance of the GetObjectOptions model with no property values + getObjectOptionsModelNew := new(catalogmanagementv1.GetObjectOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModelNew) + result, response, operationErr = catalogManagementService.GetObject(getObjectOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -27793,7 +28038,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke PutOfferingInstance successfully`, func() { + It(`Invoke GetObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27801,54 +28046,14 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - - // Construct an instance of the PutOfferingInstanceOptions model - putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) - putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") - putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") - putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") - putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} - putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) - putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) - putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") - putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel - putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") - putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") - putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") - putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") - putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectOptions model + getObjectOptionsModel := new(catalogmanagementv1.GetObjectOptions) + getObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + result, response, operationErr := catalogManagementService.GetObject(getObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -27860,97 +28065,22 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`DeleteOfferingInstance(deleteOfferingInstanceOptions *DeleteOfferingInstanceOptions)`, func() { - deleteOfferingInstancePath := "/instances/offerings/testString" - 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(deleteOfferingInstancePath)) - Expect(req.Method).To(Equal("DELETE")) - - Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) - Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - res.WriteHeader(200) - })) - }) - It(`Invoke DeleteOfferingInstance successfully`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeleteOfferingInstance(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the DeleteOfferingInstanceOptions model - deleteOfferingInstanceOptionsModel := new(catalogmanagementv1.DeleteOfferingInstanceOptions) - deleteOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - deleteOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deleteOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeleteOfferingInstance(deleteOfferingInstanceOptionsModel) - Expect(operationErr).To(BeNil()) - Expect(response).ToNot(BeNil()) - }) - It(`Invoke DeleteOfferingInstance with error: Operation validation and request error`, func() { - catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: testServer.URL, - Authenticator: &core.NoAuthAuthenticator{}, - }) - Expect(serviceErr).To(BeNil()) - Expect(catalogManagementService).ToNot(BeNil()) - - // Construct an instance of the DeleteOfferingInstanceOptions model - deleteOfferingInstanceOptionsModel := new(catalogmanagementv1.DeleteOfferingInstanceOptions) - deleteOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") - deleteOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") - deleteOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeleteOfferingInstance(deleteOfferingInstanceOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the DeleteOfferingInstanceOptions model with no property values - deleteOfferingInstanceOptionsModelNew := new(catalogmanagementv1.DeleteOfferingInstanceOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeleteOfferingInstance(deleteOfferingInstanceOptionsModelNew) - Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`ListOfferingInstanceAudits(listOfferingInstanceAuditsOptions *ListOfferingInstanceAuditsOptions) - Operation response error`, func() { - listOfferingInstanceAuditsPath := "/instances/offerings/testString/audits" + Describe(`ReplaceObject(replaceObjectOptions *ReplaceObjectOptions) - Operation response error`, func() { + replaceObjectPath := "/catalogs/testString/objects/testString" 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(listOfferingInstanceAuditsPath)) - Expect(req.Method).To(Equal("GET")) - Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - // TODO: Add check for lookupnames query parameter + Expect(req.URL.EscapedPath()).To(Equal(replaceObjectPath)) + Expect(req.Method).To(Equal("PUT")) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke ListOfferingInstanceAudits with error: Operation response processing error`, func() { + It(`Invoke ReplaceObject with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -27958,22 +28088,62 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ListOfferingInstanceAuditsOptions model - listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) - listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the ReplaceObjectOptions model + replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) + replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ID = core.StringPtr("testString") + replaceObjectOptionsModel.Rev = core.StringPtr("testString") + replaceObjectOptionsModel.Name = core.StringPtr("testString") + replaceObjectOptionsModel.CRN = core.StringPtr("testString") + replaceObjectOptionsModel.URL = core.StringPtr("testString") + replaceObjectOptionsModel.ParentID = core.StringPtr("testString") + replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Label = core.StringPtr("testString") + replaceObjectOptionsModel.Tags = []string{"testString"} + replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") + replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Kind = core.StringPtr("testString") + replaceObjectOptionsModel.Publish = publishObjectModel + replaceObjectOptionsModel.State = stateModel + replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") + replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") + replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + replaceObjectOptionsModel.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 := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + result, response, operationErr = catalogManagementService.ReplaceObject(replaceObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -27983,30 +28153,43 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ListOfferingInstanceAudits(listOfferingInstanceAuditsOptions *ListOfferingInstanceAuditsOptions)`, func() { - listOfferingInstanceAuditsPath := "/instances/offerings/testString/audits" + Describe(`ReplaceObject(replaceObjectOptions *ReplaceObjectOptions)`, func() { + replaceObjectPath := "/catalogs/testString/objects/testString" 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(listOfferingInstanceAuditsPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(replaceObjectPath)) + Expect(req.Method).To(Equal("PUT")) + + // 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.Query()["start"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - // TODO: Add check for lookupnames 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", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) })) }) - It(`Invoke ListOfferingInstanceAudits successfully with retries`, func() { + It(`Invoke ReplaceObject successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28015,24 +28198,64 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ListOfferingInstanceAuditsOptions model - listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) - listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the ReplaceObjectOptions model + replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) + replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ID = core.StringPtr("testString") + replaceObjectOptionsModel.Rev = core.StringPtr("testString") + replaceObjectOptionsModel.Name = core.StringPtr("testString") + replaceObjectOptionsModel.CRN = core.StringPtr("testString") + replaceObjectOptionsModel.URL = core.StringPtr("testString") + replaceObjectOptionsModel.ParentID = core.StringPtr("testString") + replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Label = core.StringPtr("testString") + replaceObjectOptionsModel.Tags = []string{"testString"} + replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") + replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Kind = core.StringPtr("testString") + replaceObjectOptionsModel.Publish = publishObjectModel + replaceObjectOptionsModel.State = stateModel + replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") + replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") + replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + replaceObjectOptionsModel.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 := catalogManagementService.ListOfferingInstanceAuditsWithContext(ctx, listOfferingInstanceAuditsOptionsModel) + _, _, operationErr := catalogManagementService.ReplaceObjectWithContext(ctx, replaceObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -28040,7 +28263,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.ListOfferingInstanceAuditsWithContext(ctx, listOfferingInstanceAuditsOptionsModel) + _, _, operationErr = catalogManagementService.ReplaceObjectWithContext(ctx, replaceObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -28054,19 +28277,32 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(listOfferingInstanceAuditsPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(replaceObjectPath)) + Expect(req.Method).To(Equal("PUT")) + + // 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.Query()["start"]).To(Equal([]string{"testString"})) - Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) - // TODO: Add check for lookupnames query parameter // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "name": "Name", "crn": "CRN", "url": "URL", "parent_id": "ParentID", "label_i18n": {"mapKey": "Inner"}, "label": "Label", "tags": ["Tags"], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "kind": "Kind", "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "catalog_id": "CatalogID", "catalog_name": "CatalogName", "data": {"anyKey": "anyValue"}}`) })) }) - It(`Invoke ListOfferingInstanceAudits successfully`, func() { + It(`Invoke ReplaceObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28075,27 +28311,67 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(nil) + result, response, operationErr := catalogManagementService.ReplaceObject(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the ListOfferingInstanceAuditsOptions model - listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) - listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the ReplaceObjectOptions model + replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) + replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ID = core.StringPtr("testString") + replaceObjectOptionsModel.Rev = core.StringPtr("testString") + replaceObjectOptionsModel.Name = core.StringPtr("testString") + replaceObjectOptionsModel.CRN = core.StringPtr("testString") + replaceObjectOptionsModel.URL = core.StringPtr("testString") + replaceObjectOptionsModel.ParentID = core.StringPtr("testString") + replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Label = core.StringPtr("testString") + replaceObjectOptionsModel.Tags = []string{"testString"} + replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") + replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Kind = core.StringPtr("testString") + replaceObjectOptionsModel.Publish = publishObjectModel + replaceObjectOptionsModel.State = stateModel + replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") + replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") + replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + result, response, operationErr = catalogManagementService.ReplaceObject(replaceObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke ListOfferingInstanceAudits with error: Operation validation and request error`, func() { + It(`Invoke ReplaceObject with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28103,25 +28379,65 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ListOfferingInstanceAuditsOptions model - listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) - listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the ReplaceObjectOptions model + replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) + replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ID = core.StringPtr("testString") + replaceObjectOptionsModel.Rev = core.StringPtr("testString") + replaceObjectOptionsModel.Name = core.StringPtr("testString") + replaceObjectOptionsModel.CRN = core.StringPtr("testString") + replaceObjectOptionsModel.URL = core.StringPtr("testString") + replaceObjectOptionsModel.ParentID = core.StringPtr("testString") + replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Label = core.StringPtr("testString") + replaceObjectOptionsModel.Tags = []string{"testString"} + replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") + replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Kind = core.StringPtr("testString") + replaceObjectOptionsModel.Publish = publishObjectModel + replaceObjectOptionsModel.State = stateModel + replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") + replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") + replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) 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 ListOfferingInstanceAuditsOptions model with no property values - listOfferingInstanceAuditsOptionsModelNew := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + // Construct a second instance of the ReplaceObjectOptions model with no property values + replaceObjectOptionsModelNew := new(catalogmanagementv1.ReplaceObjectOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModelNew) + result, response, operationErr = catalogManagementService.ReplaceObject(replaceObjectOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -28139,7 +28455,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke ListOfferingInstanceAudits successfully`, func() { + It(`Invoke ReplaceObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28147,16 +28463,56 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ListOfferingInstanceAuditsOptions model - listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) - listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") - listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) - listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) - listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + + // Construct an instance of the ReplaceObjectOptions model + replaceObjectOptionsModel := new(catalogmanagementv1.ReplaceObjectOptions) + replaceObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + replaceObjectOptionsModel.ID = core.StringPtr("testString") + replaceObjectOptionsModel.Rev = core.StringPtr("testString") + replaceObjectOptionsModel.Name = core.StringPtr("testString") + replaceObjectOptionsModel.CRN = core.StringPtr("testString") + replaceObjectOptionsModel.URL = core.StringPtr("testString") + replaceObjectOptionsModel.ParentID = core.StringPtr("testString") + replaceObjectOptionsModel.LabelI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Label = core.StringPtr("testString") + replaceObjectOptionsModel.Tags = []string{"testString"} + replaceObjectOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + replaceObjectOptionsModel.ShortDescription = core.StringPtr("testString") + replaceObjectOptionsModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + replaceObjectOptionsModel.Kind = core.StringPtr("testString") + replaceObjectOptionsModel.Publish = publishObjectModel + replaceObjectOptionsModel.State = stateModel + replaceObjectOptionsModel.CatalogID = core.StringPtr("testString") + replaceObjectOptionsModel.CatalogName = core.StringPtr("testString") + replaceObjectOptionsModel.Data = map[string]interface{}{"anyKey": "anyValue"} + replaceObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + result, response, operationErr := catalogManagementService.ReplaceObject(replaceObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -28167,49 +28523,22 @@ var _ = Describe(`CatalogManagementV1`, func() { testServer.Close() }) }) - Context(`Test pagination helper method on response`, func() { - It(`Invoke GetNextStart successfully`, func() { - responseObject := new(catalogmanagementv1.AuditLogs) - nextObject := new(catalogmanagementv1.PaginationTokenLink) - 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(catalogmanagementv1.AuditLogs) - - value, err := responseObject.GetNextStart() - Expect(err).To(BeNil()) - Expect(value).To(BeNil()) - }) - }) - Context(`Using mock server endpoint - paginated response`, func() { + }) + Describe(`DeleteObject(deleteObjectOptions *DeleteObjectOptions)`, func() { + deleteObjectPath := "/catalogs/testString/objects/testString" + Context(`Using mock server endpoint`, func() { BeforeEach(func() { - var requestNumber int = 0 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(listOfferingInstanceAuditsPath)) - Expect(req.Method).To(Equal("GET")) + Expect(req.URL.EscapedPath()).To(Equal(deleteObjectPath)) + Expect(req.Method).To(Equal("DELETE")) - // Set mock response - res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - requestNumber++ - if requestNumber == 1 { - fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) - } else if requestNumber == 2 { - fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) - } else { - res.WriteHeader(400) - } })) }) - It(`Use OfferingInstanceAuditsPager.GetNext successfully`, func() { + It(`Invoke DeleteObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28217,26 +28546,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - listOfferingInstanceAuditsOptionsModel := &catalogmanagementv1.ListOfferingInstanceAuditsOptions{ - InstanceIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Lookupnames: core.BoolPtr(true), - } + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeleteObject(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) - pager, err := catalogManagementService.NewOfferingInstanceAuditsPager(listOfferingInstanceAuditsOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) + // Construct an instance of the DeleteObjectOptions model + deleteObjectOptionsModel := new(catalogmanagementv1.DeleteObjectOptions) + deleteObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - var allResults []catalogmanagementv1.AuditLogDigest - for pager.HasNext() { - nextPage, err := pager.GetNext() - Expect(err).To(BeNil()) - Expect(nextPage).ToNot(BeNil()) - allResults = append(allResults, nextPage...) - } - Expect(len(allResults)).To(Equal(2)) + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeleteObject(deleteObjectOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) }) - It(`Use OfferingInstanceAuditsPager.GetAll successfully`, func() { + It(`Invoke DeleteObject with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28244,40 +28570,49 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - listOfferingInstanceAuditsOptionsModel := &catalogmanagementv1.ListOfferingInstanceAuditsOptions{ - InstanceIdentifier: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - Lookupnames: core.BoolPtr(true), - } - - pager, err := catalogManagementService.NewOfferingInstanceAuditsPager(listOfferingInstanceAuditsOptionsModel) - Expect(err).To(BeNil()) - Expect(pager).ToNot(BeNil()) - - allResults, err := pager.GetAll() + // Construct an instance of the DeleteObjectOptions model + deleteObjectOptionsModel := new(catalogmanagementv1.DeleteObjectOptions) + deleteObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - Expect(allResults).ToNot(BeNil()) - Expect(len(allResults)).To(Equal(2)) + response, operationErr := catalogManagementService.DeleteObject(deleteObjectOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeleteObjectOptions model with no property values + deleteObjectOptionsModelNew := new(catalogmanagementv1.DeleteObjectOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeleteObject(deleteObjectOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() }) }) }) - Describe(`GetOfferingInstanceAudit(getOfferingInstanceAuditOptions *GetOfferingInstanceAuditOptions) - Operation response error`, func() { - getOfferingInstanceAuditPath := "/instances/offerings/testString/audits/testString" + Describe(`ListObjectAudits(listObjectAuditsOptions *ListObjectAuditsOptions) - Operation response error`, func() { + listObjectAuditsPath := "/catalogs/testString/objects/testString/audits" 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(getOfferingInstanceAuditPath)) + Expect(req.URL.EscapedPath()).To(Equal(listObjectAuditsPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) // TODO: Add check for lookupnames query parameter res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke GetOfferingInstanceAudit with error: Operation response processing error`, func() { + It(`Invoke ListObjectAudits with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28285,21 +28620,23 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetOfferingInstanceAuditOptions model - getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) - getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectAuditsOptions model + listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) + listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.Start = core.StringPtr("testString") + listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listObjectAuditsOptionsModel.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 := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) // Enable retries and test again catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + result, response, operationErr = catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).To(BeNil()) @@ -28309,17 +28646,19 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`GetOfferingInstanceAudit(getOfferingInstanceAuditOptions *GetOfferingInstanceAuditOptions)`, func() { - getOfferingInstanceAuditPath := "/instances/offerings/testString/audits/testString" + Describe(`ListObjectAudits(listObjectAuditsOptions *ListObjectAuditsOptions)`, func() { + listObjectAuditsPath := "/catalogs/testString/objects/testString/audits" 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(getOfferingInstanceAuditPath)) + Expect(req.URL.EscapedPath()).To(Equal(listObjectAuditsPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) // TODO: Add check for lookupnames query parameter // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) @@ -28327,10 +28666,10 @@ var _ = Describe(`CatalogManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) })) }) - It(`Invoke GetOfferingInstanceAudit successfully with retries`, func() { + It(`Invoke ListObjectAudits successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28339,23 +28678,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetOfferingInstanceAuditOptions model - getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) - getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectAuditsOptions model + listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) + listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.Start = core.StringPtr("testString") + listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listObjectAuditsOptionsModel.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 := catalogManagementService.GetOfferingInstanceAuditWithContext(ctx, getOfferingInstanceAuditOptionsModel) + _, _, operationErr := catalogManagementService.ListObjectAuditsWithContext(ctx, listObjectAuditsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -28363,7 +28704,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetOfferingInstanceAuditWithContext(ctx, getOfferingInstanceAuditOptionsModel) + _, _, operationErr = catalogManagementService.ListObjectAuditsWithContext(ctx, listObjectAuditsOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -28377,17 +28718,19 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getOfferingInstanceAuditPath)) + Expect(req.URL.EscapedPath()).To(Equal(listObjectAuditsPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) // TODO: Add check for lookupnames query parameter // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) })) }) - It(`Invoke GetOfferingInstanceAudit successfully`, func() { + It(`Invoke ListObjectAudits successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28396,26 +28739,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(nil) + result, response, operationErr := catalogManagementService.ListObjectAudits(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetOfferingInstanceAuditOptions model - getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) - getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectAuditsOptions model + listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) + listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.Start = core.StringPtr("testString") + listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + result, response, operationErr = catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetOfferingInstanceAudit with error: Operation validation and request error`, func() { + It(`Invoke ListObjectAudits with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28423,24 +28768,26 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetOfferingInstanceAuditOptions model - getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) - getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectAuditsOptions model + listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) + listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.Start = core.StringPtr("testString") + listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) 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 GetOfferingInstanceAuditOptions model with no property values - getOfferingInstanceAuditOptionsModelNew := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + // Construct a second instance of the ListObjectAuditsOptions model with no property values + listObjectAuditsOptionsModelNew := new(catalogmanagementv1.ListObjectAuditsOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModelNew) + result, response, operationErr = catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -28458,7 +28805,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetOfferingInstanceAudit successfully`, func() { + It(`Invoke ListObjectAudits successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28466,15 +28813,17 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetOfferingInstanceAuditOptions model - getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) - getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") - getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) - getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ListObjectAuditsOptions model + listObjectAuditsOptionsModel := new(catalogmanagementv1.ListObjectAuditsOptions) + listObjectAuditsOptionsModel.CatalogIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.ObjectIdentifier = core.StringPtr("testString") + listObjectAuditsOptionsModel.Start = core.StringPtr("testString") + listObjectAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listObjectAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listObjectAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + result, response, operationErr := catalogManagementService.ListObjectAudits(listObjectAuditsOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -28485,23 +28834,49 @@ var _ = Describe(`CatalogManagementV1`, func() { testServer.Close() }) }) - }) - Describe(`GetPlan(getPlanOptions *GetPlanOptions) - Operation response error`, func() { - getPlanPath := "/plans/testString" - Context(`Using mock server endpoint with invalid JSON response`, func() { + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextStart successfully`, func() { + responseObject := new(catalogmanagementv1.AuditLogs) + nextObject := new(catalogmanagementv1.PaginationTokenLink) + 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(catalogmanagementv1.AuditLogs) + + value, err := responseObject.GetNextStart() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + }) + Context(`Using mock server endpoint - paginated response`, func() { BeforeEach(func() { + var requestNumber int = 0 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(getPlanPath)) + Expect(req.URL.EscapedPath()).To(Equal(listObjectAuditsPath)) Expect(req.Method).To(Equal("GET")) + + // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprint(res, `} this is not valid json {`) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) + } else { + res.WriteHeader(400) + } })) }) - It(`Invoke GetPlan with error: Operation response processing error`, func() { + It(`Use ObjectAuditsPager.GetNext successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28509,49 +28884,123 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetPlanOptions model - getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) - getPlanOptionsModel.PlanLocID = core.StringPtr("testString") - getPlanOptionsModel.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 := catalogManagementService.GetPlan(getPlanOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) + listObjectAuditsOptionsModel := &catalogmanagementv1.ListObjectAuditsOptions{ + CatalogIdentifier: core.StringPtr("testString"), + ObjectIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Lookupnames: core.BoolPtr(true), + } - // Enable retries and test again - catalogManagementService.EnableRetries(0, 0) - result, response, operationErr = catalogManagementService.GetPlan(getPlanOptionsModel) - Expect(operationErr).ToNot(BeNil()) - Expect(response).ToNot(BeNil()) - Expect(result).To(BeNil()) - }) - AfterEach(func() { - testServer.Close() - }) - }) - }) - Describe(`GetPlan(getPlanOptions *GetPlanOptions)`, func() { - getPlanPath := "/plans/testString" - Context(`Using mock server endpoint with timeout`, func() { - BeforeEach(func() { + pager, err := catalogManagementService.NewObjectAuditsPager(listObjectAuditsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + var allResults []catalogmanagementv1.AuditLogDigest + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) + }) + It(`Use ObjectAuditsPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + listObjectAuditsOptionsModel := &catalogmanagementv1.ListObjectAuditsOptions{ + CatalogIdentifier: core.StringPtr("testString"), + ObjectIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Lookupnames: core.BoolPtr(true), + } + + pager, err := catalogManagementService.NewObjectAuditsPager(listObjectAuditsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) + }) + }) + }) + Describe(`GetObjectAudit(getObjectAuditOptions *GetObjectAuditOptions) - Operation response error`, func() { + getObjectAuditPath := "/catalogs/testString/objects/testString/audits/testString" + 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(getPlanPath)) + Expect(req.URL.EscapedPath()).To(Equal(getObjectAuditPath)) + Expect(req.Method).To(Equal("GET")) + // TODO: Add check for lookupnames query parameter + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetObjectAudit with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetObjectAuditOptions model + getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) + getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getObjectAuditOptionsModel.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 := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetObjectAudit(getObjectAuditOptions *GetObjectAuditOptions)`, func() { + getObjectAuditPath := "/catalogs/testString/objects/testString/audits/testString" + 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(getObjectAuditPath)) Expect(req.Method).To(Equal("GET")) + // TODO: Add check for lookupnames 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", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) })) }) - It(`Invoke GetPlan successfully with retries`, func() { + It(`Invoke GetObjectAudit successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28560,21 +29009,24 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the GetPlanOptions model - getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) - getPlanOptionsModel.PlanLocID = core.StringPtr("testString") - getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectAuditOptions model + getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) + getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getObjectAuditOptionsModel.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 := catalogManagementService.GetPlanWithContext(ctx, getPlanOptionsModel) + _, _, operationErr := catalogManagementService.GetObjectAuditWithContext(ctx, getObjectAuditOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) // Disable retries and test again catalogManagementService.DisableRetries() - result, response, operationErr := catalogManagementService.GetPlan(getPlanOptionsModel) + result, response, operationErr := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) @@ -28582,7 +29034,7 @@ var _ = Describe(`CatalogManagementV1`, func() { // Re-test the timeout error with retries disabled ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) defer cancelFunc2() - _, _, operationErr = catalogManagementService.GetPlanWithContext(ctx, getPlanOptionsModel) + _, _, operationErr = catalogManagementService.GetObjectAuditWithContext(ctx, getObjectAuditOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) @@ -28596,16 +29048,17 @@ var _ = Describe(`CatalogManagementV1`, func() { defer GinkgoRecover() // Verify the contents of the request - Expect(req.URL.EscapedPath()).To(Equal(getPlanPath)) + Expect(req.URL.EscapedPath()).To(Equal(getObjectAuditPath)) Expect(req.Method).To(Equal("GET")) + // TODO: Add check for lookupnames query parameter // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}]}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) })) }) - It(`Invoke GetPlan successfully`, func() { + It(`Invoke GetObjectAudit successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28614,24 +29067,27 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - result, response, operationErr := catalogManagementService.GetPlan(nil) + result, response, operationErr := catalogManagementService.GetObjectAudit(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) - // Construct an instance of the GetPlanOptions model - getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) - getPlanOptionsModel.PlanLocID = core.StringPtr("testString") - getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectAuditOptions model + getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) + getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - result, response, operationErr = catalogManagementService.GetPlan(getPlanOptionsModel) + result, response, operationErr = catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) Expect(result).ToNot(BeNil()) }) - It(`Invoke GetPlan with error: Operation validation and request error`, func() { + It(`Invoke GetObjectAudit with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28639,22 +29095,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetPlanOptions model - getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) - getPlanOptionsModel.PlanLocID = core.StringPtr("testString") - getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectAuditOptions model + getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) + getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - result, response, operationErr := catalogManagementService.GetPlan(getPlanOptionsModel) + result, response, operationErr := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) 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 GetPlanOptions model with no property values - getPlanOptionsModelNew := new(catalogmanagementv1.GetPlanOptions) + // Construct a second instance of the GetObjectAuditOptions model with no property values + getObjectAuditOptionsModelNew := new(catalogmanagementv1.GetObjectAuditOptions) // Invoke operation with invalid model (negative test) - result, response, operationErr = catalogManagementService.GetPlan(getPlanOptionsModelNew) + result, response, operationErr = catalogManagementService.GetObjectAudit(getObjectAuditOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) Expect(result).To(BeNil()) @@ -28672,7 +29131,7 @@ var _ = Describe(`CatalogManagementV1`, func() { res.WriteHeader(200) })) }) - It(`Invoke GetPlan successfully`, func() { + It(`Invoke GetObjectAudit successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28680,13 +29139,16 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the GetPlanOptions model - getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) - getPlanOptionsModel.PlanLocID = core.StringPtr("testString") - getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the GetObjectAuditOptions model + getObjectAuditOptionsModel := new(catalogmanagementv1.GetObjectAuditOptions) + getObjectAuditOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getObjectAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getObjectAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation - result, response, operationErr := catalogManagementService.GetPlan(getPlanOptionsModel) + result, response, operationErr := catalogManagementService.GetObjectAudit(getObjectAuditOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) @@ -28698,21 +29160,21 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`DeletePlan(deletePlanOptions *DeletePlanOptions)`, func() { - deletePlanPath := "/plans/testString" + Describe(`ConsumableShareObject(consumableShareObjectOptions *ConsumableShareObjectOptions)`, func() { + consumableShareObjectPath := "/catalogs/testString/objects/testString/consume-publish" 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(deletePlanPath)) - Expect(req.Method).To(Equal("DELETE")) + Expect(req.URL.EscapedPath()).To(Equal(consumableShareObjectPath)) + Expect(req.Method).To(Equal("POST")) - res.WriteHeader(200) + res.WriteHeader(202) })) }) - It(`Invoke DeletePlan successfully`, func() { + It(`Invoke ConsumableShareObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28721,21 +29183,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.DeletePlan(nil) + response, operationErr := catalogManagementService.ConsumableShareObject(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) - // Construct an instance of the DeletePlanOptions model - deletePlanOptionsModel := new(catalogmanagementv1.DeletePlanOptions) - deletePlanOptionsModel.PlanLocID = core.StringPtr("testString") - deletePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ConsumableShareObjectOptions model + consumableShareObjectOptionsModel := new(catalogmanagementv1.ConsumableShareObjectOptions) + consumableShareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + consumableShareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + consumableShareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.DeletePlan(deletePlanOptionsModel) + response, operationErr = catalogManagementService.ConsumableShareObject(consumableShareObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) }) - It(`Invoke DeletePlan with error: Operation validation and request error`, func() { + It(`Invoke ConsumableShareObject with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28743,21 +29206,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the DeletePlanOptions model - deletePlanOptionsModel := new(catalogmanagementv1.DeletePlanOptions) - deletePlanOptionsModel.PlanLocID = core.StringPtr("testString") - deletePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ConsumableShareObjectOptions model + consumableShareObjectOptionsModel := new(catalogmanagementv1.ConsumableShareObjectOptions) + consumableShareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + consumableShareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + consumableShareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.DeletePlan(deletePlanOptionsModel) + response, operationErr := catalogManagementService.ConsumableShareObject(consumableShareObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the DeletePlanOptions model with no property values - deletePlanOptionsModelNew := new(catalogmanagementv1.DeletePlanOptions) + // Construct a second instance of the ConsumableShareObjectOptions model with no property values + consumableShareObjectOptionsModelNew := new(catalogmanagementv1.ConsumableShareObjectOptions) // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.DeletePlan(deletePlanOptionsModelNew) + response, operationErr = catalogManagementService.ConsumableShareObject(consumableShareObjectOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) }) @@ -28766,21 +29230,22 @@ var _ = Describe(`CatalogManagementV1`, func() { }) }) }) - Describe(`ConsumablePlan(consumablePlanOptions *ConsumablePlanOptions)`, func() { - consumablePlanPath := "/plans/testString/consume-publish" - Context(`Using mock server endpoint`, func() { + Describe(`ShareObject(shareObjectOptions *ShareObjectOptions) - Operation response error`, func() { + shareObjectPath := "/catalogs/testString/objects/testString/share" + 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(consumablePlanPath)) + Expect(req.URL.EscapedPath()).To(Equal(shareObjectPath)) Expect(req.Method).To(Equal("POST")) - - res.WriteHeader(202) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) })) }) - It(`Invoke ConsumablePlan successfully`, func() { + It(`Invoke ShareObject with error: Operation response processing error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28788,61 +29253,118 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.ConsumablePlan(nil) - Expect(operationErr).NotTo(BeNil()) - Expect(response).To(BeNil()) - - // Construct an instance of the ConsumablePlanOptions model - consumablePlanOptionsModel := new(catalogmanagementv1.ConsumablePlanOptions) - consumablePlanOptionsModel.PlanLocID = core.StringPtr("testString") - consumablePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ShareObjectOptions model + shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) + shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.IBM = core.BoolPtr(true) + shareObjectOptionsModel.Public = core.BoolPtr(true) + shareObjectOptionsModel.Enabled = core.BoolPtr(true) + shareObjectOptionsModel.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 := catalogManagementService.ShareObject(shareObjectOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) - // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.ConsumablePlan(consumablePlanOptionsModel) - Expect(operationErr).To(BeNil()) + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.ShareObject(shareObjectOptionsModel) + Expect(operationErr).ToNot(BeNil()) Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke ConsumablePlan with error: Operation validation and request error`, func() { + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`ShareObject(shareObjectOptions *ShareObjectOptions)`, func() { + shareObjectPath := "/catalogs/testString/objects/testString/share" + 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(shareObjectPath)) + 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()) + + // 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", `{"ibm": false, "public": true, "enabled": false}`) + })) + }) + It(`Invoke ShareObject successfully with retries`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, }) Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ConsumablePlanOptions model - consumablePlanOptionsModel := new(catalogmanagementv1.ConsumablePlanOptions) - consumablePlanOptionsModel.PlanLocID = core.StringPtr("testString") - consumablePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Invoke operation with empty URL (negative test) - err := catalogManagementService.SetServiceURL("") - Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.ConsumablePlan(consumablePlanOptionsModel) + // Construct an instance of the ShareObjectOptions model + shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) + shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.IBM = core.BoolPtr(true) + shareObjectOptionsModel.Public = core.BoolPtr(true) + shareObjectOptionsModel.Enabled = core.BoolPtr(true) + shareObjectOptionsModel.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 := catalogManagementService.ShareObjectWithContext(ctx, shareObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) - Expect(response).To(BeNil()) - // Construct a second instance of the ConsumablePlanOptions model with no property values - consumablePlanOptionsModelNew := new(catalogmanagementv1.ConsumablePlanOptions) - // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.ConsumablePlan(consumablePlanOptionsModelNew) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.ShareObject(shareObjectOptionsModel) + 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 = catalogManagementService.ShareObjectWithContext(ctx, shareObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) - Expect(response).To(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) AfterEach(func() { testServer.Close() }) }) - }) - Describe(`SetDeprecatePlan(setDeprecatePlanOptions *SetDeprecatePlanOptions)`, func() { - setDeprecatePlanPath := "/plans/testString/deprecate/true" 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(setDeprecatePlanPath)) + Expect(req.URL.EscapedPath()).To(Equal(shareObjectPath)) Expect(req.Method).To(Equal("POST")) // For gzip-disabled operation, verify Content-Encoding is not set. @@ -28861,10 +29383,13 @@ var _ = Describe(`CatalogManagementV1`, 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", `{"ibm": false, "public": true, "enabled": false}`) })) }) - It(`Invoke SetDeprecatePlan successfully`, func() { + It(`Invoke ShareObject successfully`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28873,24 +29398,28 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(catalogManagementService).ToNot(BeNil()) // Invoke operation with nil options model (negative test) - response, operationErr := catalogManagementService.SetDeprecatePlan(nil) + result, response, operationErr := catalogManagementService.ShareObject(nil) Expect(operationErr).NotTo(BeNil()) Expect(response).To(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the SetDeprecatePlanOptions model - setDeprecatePlanOptionsModel := new(catalogmanagementv1.SetDeprecatePlanOptions) - setDeprecatePlanOptionsModel.PlanLocID = core.StringPtr("testString") - setDeprecatePlanOptionsModel.Setting = core.StringPtr("true") - setDeprecatePlanOptionsModel.Description = core.StringPtr("testString") - setDeprecatePlanOptionsModel.DaysUntilDeprecate = core.Int64Ptr(int64(38)) - setDeprecatePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ShareObjectOptions model + shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) + shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.IBM = core.BoolPtr(true) + shareObjectOptionsModel.Public = core.BoolPtr(true) + shareObjectOptionsModel.Enabled = core.BoolPtr(true) + shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) - response, operationErr = catalogManagementService.SetDeprecatePlan(setDeprecatePlanOptionsModel) + result, response, operationErr = catalogManagementService.ShareObject(shareObjectOptionsModel) Expect(operationErr).To(BeNil()) Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + }) - It(`Invoke SetDeprecatePlan with error: Operation validation and request error`, func() { + It(`Invoke ShareObject with error: Operation validation and request error`, func() { catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ URL: testServer.URL, Authenticator: &core.NoAuthAuthenticator{}, @@ -28898,3042 +29427,8750 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(serviceErr).To(BeNil()) Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the SetDeprecatePlanOptions model - setDeprecatePlanOptionsModel := new(catalogmanagementv1.SetDeprecatePlanOptions) - setDeprecatePlanOptionsModel.PlanLocID = core.StringPtr("testString") - setDeprecatePlanOptionsModel.Setting = core.StringPtr("true") - setDeprecatePlanOptionsModel.Description = core.StringPtr("testString") - setDeprecatePlanOptionsModel.DaysUntilDeprecate = core.Int64Ptr(int64(38)) - setDeprecatePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Construct an instance of the ShareObjectOptions model + shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) + shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.IBM = core.BoolPtr(true) + shareObjectOptionsModel.Public = core.BoolPtr(true) + shareObjectOptionsModel.Enabled = core.BoolPtr(true) + shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) - response, operationErr := catalogManagementService.SetDeprecatePlan(setDeprecatePlanOptionsModel) + result, response, operationErr := catalogManagementService.ShareObject(shareObjectOptionsModel) Expect(operationErr).ToNot(BeNil()) Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) Expect(response).To(BeNil()) - // Construct a second instance of the SetDeprecatePlanOptions model with no property values - setDeprecatePlanOptionsModelNew := new(catalogmanagementv1.SetDeprecatePlanOptions) + Expect(result).To(BeNil()) + // Construct a second instance of the ShareObjectOptions model with no property values + shareObjectOptionsModelNew := new(catalogmanagementv1.ShareObjectOptions) // Invoke operation with invalid model (negative test) - response, operationErr = catalogManagementService.SetDeprecatePlan(setDeprecatePlanOptionsModelNew) + result, response, operationErr = catalogManagementService.ShareObject(shareObjectOptionsModelNew) Expect(operationErr).ToNot(BeNil()) Expect(response).To(BeNil()) + Expect(result).To(BeNil()) }) AfterEach(func() { testServer.Close() }) }) - }) - Describe(`Model constructor tests`, func() { - Context(`Using a service client instance`, func() { - catalogManagementService, _ := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ - URL: "http://catalogmanagementv1modelgenerator.com", - Authenticator: &core.NoAuthAuthenticator{}, + 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 NewAddObjectAccessListOptions successfully`, func() { - // Construct an instance of the AddObjectAccessListOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - accesses := []string{"testString"} - addObjectAccessListOptionsModel := catalogManagementService.NewAddObjectAccessListOptions(catalogIdentifier, objectIdentifier, accesses) - addObjectAccessListOptionsModel.SetCatalogIdentifier("testString") - addObjectAccessListOptionsModel.SetObjectIdentifier("testString") - addObjectAccessListOptionsModel.SetAccesses([]string{"testString"}) - addObjectAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(addObjectAccessListOptionsModel).ToNot(BeNil()) - Expect(addObjectAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(addObjectAccessListOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(addObjectAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(addObjectAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke ShareObject successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ShareObjectOptions model + shareObjectOptionsModel := new(catalogmanagementv1.ShareObjectOptions) + shareObjectOptionsModel.CatalogIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.ObjectIdentifier = core.StringPtr("testString") + shareObjectOptionsModel.IBM = core.BoolPtr(true) + shareObjectOptionsModel.Public = core.BoolPtr(true) + shareObjectOptionsModel.Enabled = core.BoolPtr(true) + shareObjectOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.ShareObject(shareObjectOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) - It(`Invoke NewAddOfferingAccessListOptions successfully`, func() { - // Construct an instance of the AddOfferingAccessListOptions model - catalogIdentifier := "testString" - offeringID := "testString" - accesses := []string{"testString"} - addOfferingAccessListOptionsModel := catalogManagementService.NewAddOfferingAccessListOptions(catalogIdentifier, offeringID, accesses) - addOfferingAccessListOptionsModel.SetCatalogIdentifier("testString") - addOfferingAccessListOptionsModel.SetOfferingID("testString") - addOfferingAccessListOptionsModel.SetAccesses([]string{"testString"}) - addOfferingAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(addOfferingAccessListOptionsModel).ToNot(BeNil()) - Expect(addOfferingAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(addOfferingAccessListOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(addOfferingAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(addOfferingAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewAddShareApprovalListOptions successfully`, func() { - // Construct an instance of the AddShareApprovalListOptions model - objectType := "offering" - accesses := []string{"testString"} - addShareApprovalListOptionsModel := catalogManagementService.NewAddShareApprovalListOptions(objectType, accesses) - addShareApprovalListOptionsModel.SetObjectType("offering") - addShareApprovalListOptionsModel.SetAccesses([]string{"testString"}) - addShareApprovalListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(addShareApprovalListOptionsModel).ToNot(BeNil()) - Expect(addShareApprovalListOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) - Expect(addShareApprovalListOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(addShareApprovalListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`GetObjectAccessList(getObjectAccessListOptions *GetObjectAccessListOptions) - Operation response error`, func() { + getObjectAccessListPath := "/catalogs/testString/objects/testString/accessv1" + 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(getObjectAccessListPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) }) - It(`Invoke NewArchiveVersionOptions successfully`, func() { - // Construct an instance of the ArchiveVersionOptions model - versionLocID := "testString" - archiveVersionOptionsModel := catalogManagementService.NewArchiveVersionOptions(versionLocID) - archiveVersionOptionsModel.SetVersionLocID("testString") - archiveVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(archiveVersionOptionsModel).ToNot(BeNil()) - Expect(archiveVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(archiveVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewCommitVersionOptions successfully`, func() { - // Construct an instance of the CommitVersionOptions model - versionLocID := "testString" - commitVersionOptionsModel := catalogManagementService.NewCommitVersionOptions(versionLocID) - commitVersionOptionsModel.SetVersionLocID("testString") - commitVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(commitVersionOptionsModel).ToNot(BeNil()) - Expect(commitVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(commitVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetObjectAccessList with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetObjectAccessListOptions model + getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) + getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.Start = core.StringPtr("testString") + getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListOptionsModel.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 := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewConsumablePlanOptions successfully`, func() { - // Construct an instance of the ConsumablePlanOptions model - planLocID := "testString" - consumablePlanOptionsModel := catalogManagementService.NewConsumablePlanOptions(planLocID) - consumablePlanOptionsModel.SetPlanLocID("testString") - consumablePlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(consumablePlanOptionsModel).ToNot(BeNil()) - Expect(consumablePlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) - Expect(consumablePlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewConsumableShareObjectOptions successfully`, func() { - // Construct an instance of the ConsumableShareObjectOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - consumableShareObjectOptionsModel := catalogManagementService.NewConsumableShareObjectOptions(catalogIdentifier, objectIdentifier) - consumableShareObjectOptionsModel.SetCatalogIdentifier("testString") - consumableShareObjectOptionsModel.SetObjectIdentifier("testString") - consumableShareObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(consumableShareObjectOptionsModel).ToNot(BeNil()) - Expect(consumableShareObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(consumableShareObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(consumableShareObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`GetObjectAccessList(getObjectAccessListOptions *GetObjectAccessListOptions)`, func() { + getObjectAccessListPath := "/catalogs/testString/objects/testString/accessv1" + 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(getObjectAccessListPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // 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", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + })) }) - It(`Invoke NewConsumableVersionOptions successfully`, func() { - // Construct an instance of the ConsumableVersionOptions model - versionLocID := "testString" - consumableVersionOptionsModel := catalogManagementService.NewConsumableVersionOptions(versionLocID) - consumableVersionOptionsModel.SetVersionLocID("testString") - consumableVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(consumableVersionOptionsModel).ToNot(BeNil()) - Expect(consumableVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(consumableVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetObjectAccessList successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the GetObjectAccessListOptions model + getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) + getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.Start = core.StringPtr("testString") + getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListOptionsModel.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 := catalogManagementService.GetObjectAccessListWithContext(ctx, getObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + 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 = catalogManagementService.GetObjectAccessListWithContext(ctx, getObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) - It(`Invoke NewCopyFromPreviousVersionOptions successfully`, func() { - // Construct an instance of the CopyFromPreviousVersionOptions model - versionLocID := "testString" - typeVar := "testString" - versionLocIDToCopyFrom := "testString" - copyFromPreviousVersionOptionsModel := catalogManagementService.NewCopyFromPreviousVersionOptions(versionLocID, typeVar, versionLocIDToCopyFrom) - copyFromPreviousVersionOptionsModel.SetVersionLocID("testString") - copyFromPreviousVersionOptionsModel.SetType("testString") - copyFromPreviousVersionOptionsModel.SetVersionLocIDToCopyFrom("testString") - copyFromPreviousVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(copyFromPreviousVersionOptionsModel).ToNot(BeNil()) - Expect(copyFromPreviousVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(copyFromPreviousVersionOptionsModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(copyFromPreviousVersionOptionsModel.VersionLocIDToCopyFrom).To(Equal(core.StringPtr("testString"))) - Expect(copyFromPreviousVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewCopyVersionOptions successfully`, func() { - // Construct an instance of the Flavor model - flavorModel := new(catalogmanagementv1.Flavor) - Expect(flavorModel).ToNot(BeNil()) - flavorModel.Name = core.StringPtr("testString") - flavorModel.Label = core.StringPtr("testString") - flavorModel.LabelI18n = map[string]string{"key1": "testString"} - flavorModel.Index = core.Int64Ptr(int64(38)) - Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + }) + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the CopyVersionOptions model - versionLocID := "testString" - copyVersionOptionsModel := catalogManagementService.NewCopyVersionOptions(versionLocID) - copyVersionOptionsModel.SetVersionLocID("testString") - copyVersionOptionsModel.SetTags([]string{"testString"}) - copyVersionOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) - copyVersionOptionsModel.SetTargetKinds([]string{"testString"}) - copyVersionOptionsModel.SetFormatKind("testString") - copyVersionOptionsModel.SetFlavor(flavorModel) - copyVersionOptionsModel.SetWorkingDirectory("testString") - copyVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(copyVersionOptionsModel).ToNot(BeNil()) - Expect(copyVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(copyVersionOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(copyVersionOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) - Expect(copyVersionOptionsModel.TargetKinds).To(Equal([]string{"testString"})) - Expect(copyVersionOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) - Expect(copyVersionOptionsModel.Flavor).To(Equal(flavorModel)) - Expect(copyVersionOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) - Expect(copyVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + })) }) - It(`Invoke NewCreateCatalogOptions successfully`, func() { - // Construct an instance of the Feature model - featureModel := new(catalogmanagementv1.Feature) - Expect(featureModel).ToNot(BeNil()) - featureModel.Title = core.StringPtr("testString") - featureModel.TitleI18n = map[string]string{"key1": "testString"} - featureModel.Description = core.StringPtr("testString") - featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) - Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + It(`Invoke GetObjectAccessList successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the FilterTerms model - filterTermsModel := new(catalogmanagementv1.FilterTerms) - Expect(filterTermsModel).ToNot(BeNil()) - filterTermsModel.FilterTerms = []string{"testString"} - Expect(filterTermsModel.FilterTerms).To(Equal([]string{"testString"})) + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetObjectAccessList(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the CategoryFilter model - categoryFilterModel := new(catalogmanagementv1.CategoryFilter) - Expect(categoryFilterModel).ToNot(BeNil()) - categoryFilterModel.Include = core.BoolPtr(true) - categoryFilterModel.Filter = filterTermsModel - Expect(categoryFilterModel.Include).To(Equal(core.BoolPtr(true))) - Expect(categoryFilterModel.Filter).To(Equal(filterTermsModel)) + // Construct an instance of the GetObjectAccessListOptions model + getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) + getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.Start = core.StringPtr("testString") + getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the IDFilter model - idFilterModel := new(catalogmanagementv1.IDFilter) - Expect(idFilterModel).ToNot(BeNil()) - idFilterModel.Include = filterTermsModel - idFilterModel.Exclude = filterTermsModel - Expect(idFilterModel.Include).To(Equal(filterTermsModel)) - Expect(idFilterModel.Exclude).To(Equal(filterTermsModel)) + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Construct an instance of the Filters model - filtersModel := new(catalogmanagementv1.Filters) - Expect(filtersModel).ToNot(BeNil()) - filtersModel.IncludeAll = core.BoolPtr(true) - filtersModel.CategoryFilters = map[string]catalogmanagementv1.CategoryFilter{"key1": *categoryFilterModel} - filtersModel.IDFilters = idFilterModel - filtersModel.CategoryFilters["foo"] = *categoryFilterModel - Expect(filtersModel.IncludeAll).To(Equal(core.BoolPtr(true))) - Expect(filtersModel.IDFilters).To(Equal(idFilterModel)) - Expect(filtersModel.CategoryFilters["foo"]).To(Equal(*categoryFilterModel)) + }) + It(`Invoke GetObjectAccessList with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the TrustedProfileInfo model - trustedProfileInfoModel := new(catalogmanagementv1.TrustedProfileInfo) - Expect(trustedProfileInfoModel).ToNot(BeNil()) - trustedProfileInfoModel.TrustedProfileID = core.StringPtr("testString") - trustedProfileInfoModel.CatalogCRN = core.StringPtr("testString") - trustedProfileInfoModel.CatalogName = core.StringPtr("testString") - trustedProfileInfoModel.TargetServiceID = core.StringPtr("testString") - Expect(trustedProfileInfoModel.TrustedProfileID).To(Equal(core.StringPtr("testString"))) - Expect(trustedProfileInfoModel.CatalogCRN).To(Equal(core.StringPtr("testString"))) - Expect(trustedProfileInfoModel.CatalogName).To(Equal(core.StringPtr("testString"))) - Expect(trustedProfileInfoModel.TargetServiceID).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the GetObjectAccessListOptions model + getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) + getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.Start = core.StringPtr("testString") + getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + 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 GetObjectAccessListOptions model with no property values + getObjectAccessListOptionsModelNew := new(catalogmanagementv1.GetObjectAccessListOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModelNew) + 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() - // Construct an instance of the TargetAccountContext model - targetAccountContextModel := new(catalogmanagementv1.TargetAccountContext) - Expect(targetAccountContextModel).ToNot(BeNil()) - targetAccountContextModel.APIKey = core.StringPtr("testString") - targetAccountContextModel.TrustedProfile = trustedProfileInfoModel - targetAccountContextModel.Name = core.StringPtr("testString") - targetAccountContextModel.Label = core.StringPtr("testString") - targetAccountContextModel.ProjectID = core.StringPtr("testString") - Expect(targetAccountContextModel.APIKey).To(Equal(core.StringPtr("testString"))) - Expect(targetAccountContextModel.TrustedProfile).To(Equal(trustedProfileInfoModel)) - Expect(targetAccountContextModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(targetAccountContextModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(targetAccountContextModel.ProjectID).To(Equal(core.StringPtr("testString"))) + // Set success status code with no respoonse body + res.WriteHeader(200) + })) + }) + It(`Invoke GetObjectAccessList successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the CreateCatalogOptions model - createCatalogOptionsModel := catalogManagementService.NewCreateCatalogOptions() - createCatalogOptionsModel.SetLabel("testString") - createCatalogOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) - createCatalogOptionsModel.SetShortDescription("testString") - createCatalogOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) - createCatalogOptionsModel.SetCatalogIconURL("testString") - createCatalogOptionsModel.SetCatalogBannerURL("testString") - createCatalogOptionsModel.SetTags([]string{"testString"}) - createCatalogOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) - createCatalogOptionsModel.SetDisabled(true) - createCatalogOptionsModel.SetResourceGroupID("testString") - createCatalogOptionsModel.SetOwningAccount("testString") - createCatalogOptionsModel.SetCatalogFilters(filtersModel) - createCatalogOptionsModel.SetKind("testString") - createCatalogOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) - createCatalogOptionsModel.SetTargetAccountContexts([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel}) - createCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createCatalogOptionsModel).ToNot(BeNil()) - Expect(createCatalogOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createCatalogOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createCatalogOptionsModel.CatalogIconURL).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.CatalogBannerURL).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(createCatalogOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(createCatalogOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) - Expect(createCatalogOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.OwningAccount).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.CatalogFilters).To(Equal(filtersModel)) - Expect(createCatalogOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(createCatalogOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(createCatalogOptionsModel.TargetAccountContexts).To(Equal([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel})) - Expect(createCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Construct an instance of the GetObjectAccessListOptions model + getObjectAccessListOptionsModel := new(catalogmanagementv1.GetObjectAccessListOptions) + getObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListOptionsModel.Start = core.StringPtr("testString") + getObjectAccessListOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.GetObjectAccessList(getObjectAccessListOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) - It(`Invoke NewCreateObjectAccessOptions successfully`, func() { - // Construct an instance of the CreateObjectAccessOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - accessIdentifier := "testString" - createObjectAccessOptionsModel := catalogManagementService.NewCreateObjectAccessOptions(catalogIdentifier, objectIdentifier, accessIdentifier) - createObjectAccessOptionsModel.SetCatalogIdentifier("testString") - createObjectAccessOptionsModel.SetObjectIdentifier("testString") - createObjectAccessOptionsModel.SetAccessIdentifier("testString") - createObjectAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createObjectAccessOptionsModel).ToNot(BeNil()) - Expect(createObjectAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(createObjectAccessOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(createObjectAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(createObjectAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewCreateObjectOptions successfully`, func() { - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - Expect(publishObjectModel).ToNot(BeNil()) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) + }) + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextStart successfully`, func() { + responseObject := new(catalogmanagementv1.AccessListResult) + nextObject := new(catalogmanagementv1.PaginationTokenLink) + nextObject.Start = core.StringPtr("abc-123") + responseObject.Next = nextObject - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - Expect(stateModel).ToNot(BeNil()) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) - Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) - Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + 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(catalogmanagementv1.AccessListResult) - // Construct an instance of the CreateObjectOptions model - catalogIdentifier := "testString" - createObjectOptionsModel := catalogManagementService.NewCreateObjectOptions(catalogIdentifier) - createObjectOptionsModel.SetCatalogIdentifier("testString") - createObjectOptionsModel.SetName("testString") - createObjectOptionsModel.SetCRN("testString") - createObjectOptionsModel.SetURL("testString") - createObjectOptionsModel.SetParentID("testString") - createObjectOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) - createObjectOptionsModel.SetLabel("testString") - createObjectOptionsModel.SetTags([]string{"testString"}) - createObjectOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - createObjectOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - createObjectOptionsModel.SetShortDescription("testString") - createObjectOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) - createObjectOptionsModel.SetKind("testString") - createObjectOptionsModel.SetPublish(publishObjectModel) - createObjectOptionsModel.SetState(stateModel) - createObjectOptionsModel.SetCatalogID("testString") - createObjectOptionsModel.SetCatalogName("testString") - createObjectOptionsModel.SetData(map[string]interface{}{"anyKey": "anyValue"}) - createObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createObjectOptionsModel).ToNot(BeNil()) - Expect(createObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.ParentID).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createObjectOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(createObjectOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(createObjectOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(createObjectOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createObjectOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.Publish).To(Equal(publishObjectModel)) - Expect(createObjectOptionsModel.State).To(Equal(stateModel)) - Expect(createObjectOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) - Expect(createObjectOptionsModel.Data).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(createObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + value, err := responseObject.GetNextStart() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) }) - It(`Invoke NewCreateOfferingInstanceOptions successfully`, func() { - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - Expect(offeringInstanceLastOperationModel).ToNot(BeNil()) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - Expect(offeringInstanceLastOperationModel.Operation).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.State).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.Message).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.TransactionID).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(offeringInstanceLastOperationModel.Code).To(Equal(core.StringPtr("testString"))) + }) + Context(`Using mock server endpoint - paginated response`, func() { + BeforeEach(func() { + var requestNumber int = 0 + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the CreateOfferingInstanceOptions model - xAuthRefreshToken := "testString" - createOfferingInstanceOptionsModel := catalogManagementService.NewCreateOfferingInstanceOptions(xAuthRefreshToken) - createOfferingInstanceOptionsModel.SetXAuthRefreshToken("testString") - createOfferingInstanceOptionsModel.SetID("testString") - createOfferingInstanceOptionsModel.SetRev("testString") - createOfferingInstanceOptionsModel.SetURL("testString") - createOfferingInstanceOptionsModel.SetCRN("testString") - createOfferingInstanceOptionsModel.SetLabel("testString") - createOfferingInstanceOptionsModel.SetCatalogID("testString") - createOfferingInstanceOptionsModel.SetOfferingID("testString") - createOfferingInstanceOptionsModel.SetKindFormat("testString") - createOfferingInstanceOptionsModel.SetKindFormatLabel("testString") - createOfferingInstanceOptionsModel.SetVersion("testString") - createOfferingInstanceOptionsModel.SetVersionID("testString") - createOfferingInstanceOptionsModel.SetClusterID("testString") - createOfferingInstanceOptionsModel.SetClusterRegion("testString") - createOfferingInstanceOptionsModel.SetClusterNamespaces([]string{"testString"}) - createOfferingInstanceOptionsModel.SetClusterAllNamespaces(true) - createOfferingInstanceOptionsModel.SetSchematicsWorkspaceID("testString") - createOfferingInstanceOptionsModel.SetInstallPlan("testString") - createOfferingInstanceOptionsModel.SetChannel("testString") - createOfferingInstanceOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - createOfferingInstanceOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - createOfferingInstanceOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) - createOfferingInstanceOptionsModel.SetResourceGroupID("testString") - createOfferingInstanceOptionsModel.SetLocation("testString") - createOfferingInstanceOptionsModel.SetDisabled(true) - createOfferingInstanceOptionsModel.SetAccount("testString") - createOfferingInstanceOptionsModel.SetLastOperation(offeringInstanceLastOperationModel) - createOfferingInstanceOptionsModel.SetKindTarget("testString") - createOfferingInstanceOptionsModel.SetKindTargetLabel("testString") - createOfferingInstanceOptionsModel.SetSha("testString") - createOfferingInstanceOptionsModel.SetPlanID("testString") - createOfferingInstanceOptionsModel.SetParentCRN("testString") - createOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createOfferingInstanceOptionsModel).ToNot(BeNil()) - Expect(createOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.KindFormat).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.KindFormatLabel).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.VersionID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.ClusterRegion).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.ClusterNamespaces).To(Equal([]string{"testString"})) - Expect(createOfferingInstanceOptionsModel.ClusterAllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(createOfferingInstanceOptionsModel.SchematicsWorkspaceID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(createOfferingInstanceOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(createOfferingInstanceOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(createOfferingInstanceOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Location).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) - Expect(createOfferingInstanceOptionsModel.Account).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.LastOperation).To(Equal(offeringInstanceLastOperationModel)) - Expect(createOfferingInstanceOptionsModel.KindTarget).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.KindTargetLabel).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.ParentCRN).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewCreateOfferingOptions successfully`, func() { - // Construct an instance of the Rating model - ratingModel := new(catalogmanagementv1.Rating) - Expect(ratingModel).ToNot(BeNil()) - ratingModel.OneStarCount = core.Int64Ptr(int64(38)) - ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) - ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) - ratingModel.FourStarCount = core.Int64Ptr(int64(38)) - Expect(ratingModel.OneStarCount).To(Equal(core.Int64Ptr(int64(38)))) - Expect(ratingModel.TwoStarCount).To(Equal(core.Int64Ptr(int64(38)))) - Expect(ratingModel.ThreeStarCount).To(Equal(core.Int64Ptr(int64(38)))) - Expect(ratingModel.FourStarCount).To(Equal(core.Int64Ptr(int64(38)))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListPath)) + Expect(req.Method).To(Equal("GET")) - // Construct an instance of the Feature model - featureModel := new(catalogmanagementv1.Feature) - Expect(featureModel).ToNot(BeNil()) - featureModel.Title = core.StringPtr("testString") - featureModel.TitleI18n = map[string]string{"key1": "testString"} - featureModel.Description = core.StringPtr("testString") - featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) - Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) + } else { + res.WriteHeader(400) + } + })) + }) + It(`Use GetObjectAccessListPager.GetNext successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the Flavor model - flavorModel := new(catalogmanagementv1.Flavor) - Expect(flavorModel).ToNot(BeNil()) - flavorModel.Name = core.StringPtr("testString") - flavorModel.Label = core.StringPtr("testString") - flavorModel.LabelI18n = map[string]string{"key1": "testString"} - flavorModel.Index = core.Int64Ptr(int64(38)) - Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + getObjectAccessListOptionsModel := &catalogmanagementv1.GetObjectAccessListOptions{ + CatalogIdentifier: core.StringPtr("testString"), + ObjectIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + } - // Construct an instance of the RenderTypeAssociationsParametersItem model - renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) - Expect(renderTypeAssociationsParametersItemModel).ToNot(BeNil()) - renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") - renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) - Expect(renderTypeAssociationsParametersItemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(renderTypeAssociationsParametersItemModel.OptionsRefresh).To(Equal(core.BoolPtr(true))) + pager, err := catalogManagementService.NewGetObjectAccessListPager(getObjectAccessListOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) - // Construct an instance of the RenderTypeAssociations model - renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) - Expect(renderTypeAssociationsModel).ToNot(BeNil()) - renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} - Expect(renderTypeAssociationsModel.Parameters).To(Equal([]catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel})) + var allResults []catalogmanagementv1.Access + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) + }) + It(`Use GetObjectAccessListPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the RenderType model - renderTypeModel := new(catalogmanagementv1.RenderType) - Expect(renderTypeModel).ToNot(BeNil()) - renderTypeModel.Type = core.StringPtr("testString") - renderTypeModel.Grouping = core.StringPtr("testString") - renderTypeModel.OriginalGrouping = core.StringPtr("testString") - renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) - renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} - renderTypeModel.Associations = renderTypeAssociationsModel - Expect(renderTypeModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(renderTypeModel.Grouping).To(Equal(core.StringPtr("testString"))) - Expect(renderTypeModel.OriginalGrouping).To(Equal(core.StringPtr("testString"))) - Expect(renderTypeModel.GroupingIndex).To(Equal(core.Int64Ptr(int64(38)))) - Expect(renderTypeModel.ConfigConstraints).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(renderTypeModel.Associations).To(Equal(renderTypeAssociationsModel)) + getObjectAccessListOptionsModel := &catalogmanagementv1.GetObjectAccessListOptions{ + CatalogIdentifier: core.StringPtr("testString"), + ObjectIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + } - // Construct an instance of the Configuration model - configurationModel := new(catalogmanagementv1.Configuration) - Expect(configurationModel).ToNot(BeNil()) - configurationModel.Key = core.StringPtr("testString") - configurationModel.Type = core.StringPtr("testString") - configurationModel.DefaultValue = "testString" - configurationModel.DisplayName = core.StringPtr("testString") - configurationModel.ValueConstraint = core.StringPtr("testString") - configurationModel.Description = core.StringPtr("testString") - configurationModel.Required = core.BoolPtr(true) - configurationModel.Options = []interface{}{"testString"} - configurationModel.Hidden = core.BoolPtr(true) - configurationModel.CustomConfig = renderTypeModel - configurationModel.TypeMetadata = core.StringPtr("testString") - Expect(configurationModel.Key).To(Equal(core.StringPtr("testString"))) - Expect(configurationModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(configurationModel.DefaultValue).To(Equal("testString")) - Expect(configurationModel.DisplayName).To(Equal(core.StringPtr("testString"))) - Expect(configurationModel.ValueConstraint).To(Equal(core.StringPtr("testString"))) - Expect(configurationModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(configurationModel.Required).To(Equal(core.BoolPtr(true))) - Expect(configurationModel.Options).To(Equal([]interface{}{"testString"})) - Expect(configurationModel.Hidden).To(Equal(core.BoolPtr(true))) - Expect(configurationModel.CustomConfig).To(Equal(renderTypeModel)) - Expect(configurationModel.TypeMetadata).To(Equal(core.StringPtr("testString"))) + pager, err := catalogManagementService.NewGetObjectAccessListPager(getObjectAccessListOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) - // Construct an instance of the Output model - outputModel := new(catalogmanagementv1.Output) - Expect(outputModel).ToNot(BeNil()) - outputModel.Key = core.StringPtr("testString") - outputModel.Description = core.StringPtr("testString") - Expect(outputModel.Key).To(Equal(core.StringPtr("testString"))) - Expect(outputModel.Description).To(Equal(core.StringPtr("testString"))) + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) + }) + }) + }) + Describe(`GetObjectAccess(getObjectAccessOptions *GetObjectAccessOptions) - Operation response error`, func() { + getObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" + 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() - // Construct an instance of the IamResource model - iamResourceModel := new(catalogmanagementv1.IamResource) - Expect(iamResourceModel).ToNot(BeNil()) - iamResourceModel.Name = core.StringPtr("testString") - iamResourceModel.Description = core.StringPtr("testString") - iamResourceModel.RoleCrns = []string{"testString"} - Expect(iamResourceModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(iamResourceModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(iamResourceModel.RoleCrns).To(Equal([]string{"testString"})) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessPath)) + Expect(req.Method).To(Equal("GET")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetObjectAccess with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the IamPermission model - iamPermissionModel := new(catalogmanagementv1.IamPermission) - Expect(iamPermissionModel).ToNot(BeNil()) - iamPermissionModel.ServiceName = core.StringPtr("testString") - iamPermissionModel.RoleCrns = []string{"testString"} - iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} - Expect(iamPermissionModel.ServiceName).To(Equal(core.StringPtr("testString"))) - Expect(iamPermissionModel.RoleCrns).To(Equal([]string{"testString"})) - Expect(iamPermissionModel.Resources).To(Equal([]catalogmanagementv1.IamResource{*iamResourceModel})) + // Construct an instance of the GetObjectAccessOptions model + getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) + getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.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 := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the Validation model - validationModel := new(catalogmanagementv1.Validation) - Expect(validationModel).ToNot(BeNil()) - validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - validationModel.State = core.StringPtr("testString") - validationModel.LastOperation = core.StringPtr("testString") - validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} - validationModel.Message = core.StringPtr("testString") - Expect(validationModel.Validated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(validationModel.Requested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(validationModel.State).To(Equal(core.StringPtr("testString"))) - Expect(validationModel.LastOperation).To(Equal(core.StringPtr("testString"))) - Expect(validationModel.Target).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(validationModel.Message).To(Equal(core.StringPtr("testString"))) + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetObjectAccess(getObjectAccessOptions *GetObjectAccessOptions)`, func() { + getObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" + Context(`Using mock server endpoint with timeout`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the Resource model - resourceModel := new(catalogmanagementv1.Resource) - Expect(resourceModel).ToNot(BeNil()) - resourceModel.Type = core.StringPtr("mem") - resourceModel.Value = "testString" - Expect(resourceModel.Type).To(Equal(core.StringPtr("mem"))) - Expect(resourceModel.Value).To(Equal("testString")) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessPath)) + Expect(req.Method).To(Equal("GET")) - // Construct an instance of the SchematicsEnvValues model - schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) - Expect(schematicsEnvValuesModel).ToNot(BeNil()) - schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") - schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") - Expect(schematicsEnvValuesModel.Value).To(Equal(core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]"))) - Expect(schematicsEnvValuesModel.SmRef).To(Equal(core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"))) + // Sleep a short time to support a timeout test + time.Sleep(100 * time.Millisecond) - // Construct an instance of the Script model - scriptModel := new(catalogmanagementv1.Script) - Expect(scriptModel).ToNot(BeNil()) - scriptModel.Instructions = core.StringPtr("testString") - scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} - scriptModel.Script = core.StringPtr("testString") - scriptModel.ScriptPermission = core.StringPtr("testString") - scriptModel.DeleteScript = core.StringPtr("testString") - scriptModel.Scope = core.StringPtr("testString") - Expect(scriptModel.Instructions).To(Equal(core.StringPtr("testString"))) - Expect(scriptModel.InstructionsI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(scriptModel.Script).To(Equal(core.StringPtr("testString"))) - Expect(scriptModel.ScriptPermission).To(Equal(core.StringPtr("testString"))) - Expect(scriptModel.DeleteScript).To(Equal(core.StringPtr("testString"))) - Expect(scriptModel.Scope).To(Equal(core.StringPtr("testString"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}`) + })) + }) + It(`Invoke GetObjectAccess successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the ScriptRef model - scriptRefModel := new(catalogmanagementv1.ScriptRef) - Expect(scriptRefModel).ToNot(BeNil()) - scriptRefModel.ShortDescription = core.StringPtr("testString") - scriptRefModel.Type = core.StringPtr("ansible") - scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") - scriptRefModel.Stage = core.StringPtr("pre") - scriptRefModel.Action = core.StringPtr("validate") - Expect(scriptRefModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(scriptRefModel.Type).To(Equal(core.StringPtr("ansible"))) - Expect(scriptRefModel.Path).To(Equal(core.StringPtr("scripts/validate-post-ansible-playbook.yaml"))) - Expect(scriptRefModel.Stage).To(Equal(core.StringPtr("pre"))) - Expect(scriptRefModel.Action).To(Equal(core.StringPtr("validate"))) + // Construct an instance of the GetObjectAccessOptions model + getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) + getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the VersionEntitlement model - versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) - Expect(versionEntitlementModel).ToNot(BeNil()) - versionEntitlementModel.ProviderName = core.StringPtr("testString") - versionEntitlementModel.ProviderID = core.StringPtr("testString") - versionEntitlementModel.ProductID = core.StringPtr("testString") - versionEntitlementModel.PartNumbers = []string{"testString"} - versionEntitlementModel.ImageRepoName = core.StringPtr("testString") - Expect(versionEntitlementModel.ProviderName).To(Equal(core.StringPtr("testString"))) - Expect(versionEntitlementModel.ProviderID).To(Equal(core.StringPtr("testString"))) - Expect(versionEntitlementModel.ProductID).To(Equal(core.StringPtr("testString"))) - Expect(versionEntitlementModel.PartNumbers).To(Equal([]string{"testString"})) - Expect(versionEntitlementModel.ImageRepoName).To(Equal(core.StringPtr("testString"))) + // Invoke operation with a Context to test a timeout error + ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc() + _, _, operationErr := catalogManagementService.GetObjectAccessWithContext(ctx, getObjectAccessOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - // Construct an instance of the License model - licenseModel := new(catalogmanagementv1.License) - Expect(licenseModel).ToNot(BeNil()) - licenseModel.ID = core.StringPtr("testString") - licenseModel.Name = core.StringPtr("testString") - licenseModel.Type = core.StringPtr("testString") - licenseModel.URL = core.StringPtr("testString") - licenseModel.Description = core.StringPtr("testString") - Expect(licenseModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(licenseModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(licenseModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(licenseModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(licenseModel.Description).To(Equal(core.StringPtr("testString"))) + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - Expect(stateModel).ToNot(BeNil()) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) - Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) - Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + // Re-test the timeout error with retries disabled + ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc2() + _, _, operationErr = catalogManagementService.GetObjectAccessWithContext(ctx, getObjectAccessOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the DeprecatePending model - deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) - Expect(deprecatePendingModel).ToNot(BeNil()) - deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") - deprecatePendingModel.DeprecateState = core.StringPtr("testString") - deprecatePendingModel.Description = core.StringPtr("testString") - Expect(deprecatePendingModel.DeprecateDate).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(deprecatePendingModel.DeprecateState).To(Equal(core.StringPtr("testString"))) - Expect(deprecatePendingModel.Description).To(Equal(core.StringPtr("testString"))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessPath)) + Expect(req.Method).To(Equal("GET")) - // Construct an instance of the URLProxy model - urlProxyModel := new(catalogmanagementv1.URLProxy) - Expect(urlProxyModel).ToNot(BeNil()) - urlProxyModel.URL = core.StringPtr("testString") - urlProxyModel.Sha = core.StringPtr("testString") - Expect(urlProxyModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(urlProxyModel.Sha).To(Equal(core.StringPtr("testString"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}`) + })) + }) + It(`Invoke GetObjectAccess successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the MediaItem model - mediaItemModel := new(catalogmanagementv1.MediaItem) - Expect(mediaItemModel).ToNot(BeNil()) - mediaItemModel.URL = core.StringPtr("testString") - mediaItemModel.APIURL = core.StringPtr("testString") - mediaItemModel.URLProxy = urlProxyModel - mediaItemModel.Caption = core.StringPtr("testString") - mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} - mediaItemModel.Type = core.StringPtr("testString") - mediaItemModel.ThumbnailURL = core.StringPtr("testString") - Expect(mediaItemModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(mediaItemModel.APIURL).To(Equal(core.StringPtr("testString"))) - Expect(mediaItemModel.URLProxy).To(Equal(urlProxyModel)) - Expect(mediaItemModel.Caption).To(Equal(core.StringPtr("testString"))) - Expect(mediaItemModel.CaptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(mediaItemModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(mediaItemModel.ThumbnailURL).To(Equal(core.StringPtr("testString"))) + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetObjectAccess(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the ArchitectureDiagram model - architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) - Expect(architectureDiagramModel).ToNot(BeNil()) - architectureDiagramModel.Diagram = mediaItemModel - architectureDiagramModel.Description = core.StringPtr("testString") - architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} - Expect(architectureDiagramModel.Diagram).To(Equal(mediaItemModel)) - Expect(architectureDiagramModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(architectureDiagramModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + // Construct an instance of the GetObjectAccessOptions model + getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) + getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the CostComponent model - costComponentModel := new(catalogmanagementv1.CostComponent) - Expect(costComponentModel).ToNot(BeNil()) - costComponentModel.Name = core.StringPtr("testString") - costComponentModel.Unit = core.StringPtr("testString") - costComponentModel.HourlyQuantity = core.StringPtr("testString") - costComponentModel.MonthlyQuantity = core.StringPtr("testString") - costComponentModel.Price = core.StringPtr("testString") - costComponentModel.HourlyCost = core.StringPtr("testString") - costComponentModel.MonthlyCost = core.StringPtr("testString") - Expect(costComponentModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(costComponentModel.Unit).To(Equal(core.StringPtr("testString"))) - Expect(costComponentModel.HourlyQuantity).To(Equal(core.StringPtr("testString"))) - Expect(costComponentModel.MonthlyQuantity).To(Equal(core.StringPtr("testString"))) - Expect(costComponentModel.Price).To(Equal(core.StringPtr("testString"))) - Expect(costComponentModel.HourlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costComponentModel.MonthlyCost).To(Equal(core.StringPtr("testString"))) + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Construct an instance of the CostResource model - costResourceModel := new(catalogmanagementv1.CostResource) - Expect(costResourceModel).ToNot(BeNil()) - costResourceModel.Name = core.StringPtr("testString") - costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - costResourceModel.HourlyCost = core.StringPtr("testString") - costResourceModel.MonthlyCost = core.StringPtr("testString") - costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} - Expect(costResourceModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(costResourceModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(costResourceModel.HourlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costResourceModel.MonthlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costResourceModel.CostComponents).To(Equal([]catalogmanagementv1.CostComponent{*costComponentModel})) + }) + It(`Invoke GetObjectAccess with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the CostBreakdown model - costBreakdownModel := new(catalogmanagementv1.CostBreakdown) - Expect(costBreakdownModel).ToNot(BeNil()) - costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") - costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") - costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} - Expect(costBreakdownModel.TotalHourlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costBreakdownModel.TotalMonthlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costBreakdownModel.Resources).To(Equal([]catalogmanagementv1.CostResource{*costResourceModel})) + // Construct an instance of the GetObjectAccessOptions model + getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) + getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + 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 GetObjectAccessOptions model with no property values + getObjectAccessOptionsModelNew := new(catalogmanagementv1.GetObjectAccessOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetObjectAccess(getObjectAccessOptionsModelNew) + 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() - // Construct an instance of the CostSummary model - costSummaryModel := new(catalogmanagementv1.CostSummary) - Expect(costSummaryModel).ToNot(BeNil()) - costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) - costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) - costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) - costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) - costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) - costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} - costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} - Expect(costSummaryModel.TotalDetectedResources).To(Equal(core.Int64Ptr(int64(38)))) - Expect(costSummaryModel.TotalSupportedResources).To(Equal(core.Int64Ptr(int64(38)))) - Expect(costSummaryModel.TotalUnsupportedResources).To(Equal(core.Int64Ptr(int64(38)))) - Expect(costSummaryModel.TotalUsageBasedResources).To(Equal(core.Int64Ptr(int64(38)))) - Expect(costSummaryModel.TotalNoPriceResources).To(Equal(core.Int64Ptr(int64(38)))) - Expect(costSummaryModel.UnsupportedResourceCounts).To(Equal(map[string]int64{"key1": int64(38)})) - Expect(costSummaryModel.NoPriceResourceCounts).To(Equal(map[string]int64{"key1": int64(38)})) + // Set success status code with no respoonse body + res.WriteHeader(200) + })) + }) + It(`Invoke GetObjectAccess successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the Project model - projectModel := new(catalogmanagementv1.Project) - Expect(projectModel).ToNot(BeNil()) - projectModel.Name = core.StringPtr("testString") - projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - projectModel.PastBreakdown = costBreakdownModel - projectModel.Breakdown = costBreakdownModel - projectModel.Diff = costBreakdownModel - projectModel.Summary = costSummaryModel - Expect(projectModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(projectModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(projectModel.PastBreakdown).To(Equal(costBreakdownModel)) - Expect(projectModel.Breakdown).To(Equal(costBreakdownModel)) - Expect(projectModel.Diff).To(Equal(costBreakdownModel)) - Expect(projectModel.Summary).To(Equal(costSummaryModel)) + // Construct an instance of the GetObjectAccessOptions model + getObjectAccessOptionsModel := new(catalogmanagementv1.GetObjectAccessOptions) + getObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + getObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the CostEstimate model - costEstimateModel := new(catalogmanagementv1.CostEstimate) - Expect(costEstimateModel).ToNot(BeNil()) - costEstimateModel.Version = core.StringPtr("testString") - costEstimateModel.Currency = core.StringPtr("testString") - costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} - costEstimateModel.Summary = costSummaryModel - costEstimateModel.TotalHourlyCost = core.StringPtr("testString") - costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") - costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") - costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") - costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") - costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") - costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - Expect(costEstimateModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.Currency).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.Projects).To(Equal([]catalogmanagementv1.Project{*projectModel})) - Expect(costEstimateModel.Summary).To(Equal(costSummaryModel)) - Expect(costEstimateModel.TotalHourlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.TotalMonthlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.PastTotalHourlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.PastTotalMonthlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.DiffTotalHourlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.DiffTotalMonthlyCost).To(Equal(core.StringPtr("testString"))) - Expect(costEstimateModel.TimeGenerated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + // Invoke operation + result, response, operationErr := catalogManagementService.GetObjectAccess(getObjectAccessOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) - // Construct an instance of the OfferingReference model - offeringReferenceModel := new(catalogmanagementv1.OfferingReference) - Expect(offeringReferenceModel).ToNot(BeNil()) - offeringReferenceModel.CatalogID = core.StringPtr("testString") - offeringReferenceModel.ID = core.StringPtr("testString") - offeringReferenceModel.Name = core.StringPtr("testString") - offeringReferenceModel.Kind = core.StringPtr("testString") - offeringReferenceModel.Version = core.StringPtr("testString") - offeringReferenceModel.Flavors = []string{"testString"} - Expect(offeringReferenceModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(offeringReferenceModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(offeringReferenceModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(offeringReferenceModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(offeringReferenceModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(offeringReferenceModel.Flavors).To(Equal([]string{"testString"})) + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`CreateObjectAccess(createObjectAccessOptions *CreateObjectAccessOptions)`, func() { + createObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the SolutionInfo model - solutionInfoModel := new(catalogmanagementv1.SolutionInfo) - Expect(solutionInfoModel).ToNot(BeNil()) - solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} - solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} - solutionInfoModel.CostEstimate = costEstimateModel - solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} - solutionInfoModel.InstallType = core.StringPtr("testString") - Expect(solutionInfoModel.ArchitectureDiagrams).To(Equal([]catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel})) - Expect(solutionInfoModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(solutionInfoModel.CostEstimate).To(Equal(costEstimateModel)) - Expect(solutionInfoModel.Dependencies).To(Equal([]catalogmanagementv1.OfferingReference{*offeringReferenceModel})) - Expect(solutionInfoModel.InstallType).To(Equal(core.StringPtr("testString"))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(createObjectAccessPath)) + Expect(req.Method).To(Equal("POST")) - // Construct an instance of the SccProfile model - sccProfileModel := new(catalogmanagementv1.SccProfile) - Expect(sccProfileModel).ToNot(BeNil()) - sccProfileModel.ID = core.StringPtr("testString") - sccProfileModel.Name = core.StringPtr("testString") - sccProfileModel.Version = core.StringPtr("testString") - sccProfileModel.Description = core.StringPtr("testString") - sccProfileModel.Type = core.StringPtr("testString") - sccProfileModel.UIHref = core.StringPtr("testString") - Expect(sccProfileModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(sccProfileModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(sccProfileModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(sccProfileModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(sccProfileModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(sccProfileModel.UIHref).To(Equal(core.StringPtr("testString"))) + res.WriteHeader(201) + })) + }) + It(`Invoke CreateObjectAccess successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ClaimedControl model - claimedControlModel := new(catalogmanagementv1.ClaimedControl) - Expect(claimedControlModel).ToNot(BeNil()) - claimedControlModel.Profile = sccProfileModel - claimedControlModel.Names = []string{"testString"} - Expect(claimedControlModel.Profile).To(Equal(sccProfileModel)) - Expect(claimedControlModel.Names).To(Equal([]string{"testString"})) + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.CreateObjectAccess(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) - // Construct an instance of the Claims model - claimsModel := new(catalogmanagementv1.Claims) - Expect(claimsModel).ToNot(BeNil()) - claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} - claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} - Expect(claimsModel.Profiles).To(Equal([]catalogmanagementv1.SccProfile{*sccProfileModel})) - Expect(claimsModel.Controls).To(Equal([]catalogmanagementv1.ClaimedControl{*claimedControlModel})) + // Construct an instance of the CreateObjectAccessOptions model + createObjectAccessOptionsModel := new(catalogmanagementv1.CreateObjectAccessOptions) + createObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + createObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + createObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the Result model - resultModel := new(catalogmanagementv1.Result) - Expect(resultModel).ToNot(BeNil()) - resultModel.FailureCount = core.Int64Ptr(int64(38)) - resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") - resultModel.ErrorMessage = core.StringPtr("testString") - resultModel.CompleteScan = core.BoolPtr(true) - resultModel.UnscannedResources = []string{"testString"} - Expect(resultModel.FailureCount).To(Equal(core.Int64Ptr(int64(38)))) - Expect(resultModel.ScanTime).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(resultModel.ErrorMessage).To(Equal(core.StringPtr("testString"))) - Expect(resultModel.CompleteScan).To(Equal(core.BoolPtr(true))) - Expect(resultModel.UnscannedResources).To(Equal([]string{"testString"})) + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.CreateObjectAccess(createObjectAccessOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke CreateObjectAccess with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the SccAssessment model - sccAssessmentModel := new(catalogmanagementv1.SccAssessment) - Expect(sccAssessmentModel).ToNot(BeNil()) - sccAssessmentModel.ID = core.StringPtr("testString") - sccAssessmentModel.Description = core.StringPtr("testString") - sccAssessmentModel.Version = core.StringPtr("testString") - sccAssessmentModel.Type = core.StringPtr("testString") - sccAssessmentModel.Method = core.StringPtr("testString") - sccAssessmentModel.UIHref = core.StringPtr("testString") - Expect(sccAssessmentModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(sccAssessmentModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(sccAssessmentModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(sccAssessmentModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(sccAssessmentModel.Method).To(Equal(core.StringPtr("testString"))) - Expect(sccAssessmentModel.UIHref).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the CreateObjectAccessOptions model + createObjectAccessOptionsModel := new(catalogmanagementv1.CreateObjectAccessOptions) + createObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + createObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + createObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + createObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.CreateObjectAccess(createObjectAccessOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the CreateObjectAccessOptions model with no property values + createObjectAccessOptionsModelNew := new(catalogmanagementv1.CreateObjectAccessOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.CreateObjectAccess(createObjectAccessOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`DeleteObjectAccess(deleteObjectAccessOptions *DeleteObjectAccessOptions)`, func() { + deleteObjectAccessPath := "/catalogs/testString/objects/testString/access/testString" + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the SccSpecification model - sccSpecificationModel := new(catalogmanagementv1.SccSpecification) - Expect(sccSpecificationModel).ToNot(BeNil()) - sccSpecificationModel.ID = core.StringPtr("testString") - sccSpecificationModel.Description = core.StringPtr("testString") - sccSpecificationModel.ComponentName = core.StringPtr("testString") - sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} - sccSpecificationModel.UIHref = core.StringPtr("testString") - Expect(sccSpecificationModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(sccSpecificationModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(sccSpecificationModel.ComponentName).To(Equal(core.StringPtr("testString"))) - Expect(sccSpecificationModel.Assessments).To(Equal([]catalogmanagementv1.SccAssessment{*sccAssessmentModel})) - Expect(sccSpecificationModel.UIHref).To(Equal(core.StringPtr("testString"))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(deleteObjectAccessPath)) + Expect(req.Method).To(Equal("DELETE")) - // Construct an instance of the SccControl model - sccControlModel := new(catalogmanagementv1.SccControl) - Expect(sccControlModel).ToNot(BeNil()) - sccControlModel.ID = core.StringPtr("testString") - sccControlModel.Name = core.StringPtr("testString") - sccControlModel.Version = core.StringPtr("testString") - sccControlModel.Description = core.StringPtr("testString") - sccControlModel.Profile = sccProfileModel - sccControlModel.ParentName = core.StringPtr("testString") - sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} - sccControlModel.UIHref = core.StringPtr("testString") - Expect(sccControlModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(sccControlModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(sccControlModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(sccControlModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(sccControlModel.Profile).To(Equal(sccProfileModel)) - Expect(sccControlModel.ParentName).To(Equal(core.StringPtr("testString"))) - Expect(sccControlModel.Specifications).To(Equal([]catalogmanagementv1.SccSpecification{*sccSpecificationModel})) - Expect(sccControlModel.UIHref).To(Equal(core.StringPtr("testString"))) + res.WriteHeader(200) + })) + }) + It(`Invoke DeleteObjectAccess successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the EvaluatedControl model - evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) - Expect(evaluatedControlModel).ToNot(BeNil()) - evaluatedControlModel.ID = core.StringPtr("testString") - evaluatedControlModel.Name = core.StringPtr("testString") - evaluatedControlModel.Description = core.StringPtr("testString") - evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} - evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) - evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) - evaluatedControlModel.Parent = sccControlModel - evaluatedControlModel.UIHref = core.StringPtr("testString") - Expect(evaluatedControlModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(evaluatedControlModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(evaluatedControlModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(evaluatedControlModel.Specifications).To(Equal([]catalogmanagementv1.SccSpecification{*sccSpecificationModel})) - Expect(evaluatedControlModel.FailureCount).To(Equal(core.Int64Ptr(int64(38)))) - Expect(evaluatedControlModel.PassCount).To(Equal(core.Int64Ptr(int64(38)))) - Expect(evaluatedControlModel.Parent).To(Equal(sccControlModel)) - Expect(evaluatedControlModel.UIHref).To(Equal(core.StringPtr("testString"))) + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeleteObjectAccess(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) - // Construct an instance of the Evaluation model - evaluationModel := new(catalogmanagementv1.Evaluation) - Expect(evaluationModel).ToNot(BeNil()) - evaluationModel.ScanID = core.StringPtr("testString") - evaluationModel.AccountID = core.StringPtr("testString") - evaluationModel.Profile = sccProfileModel - evaluationModel.Result = resultModel - evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} - Expect(evaluationModel.ScanID).To(Equal(core.StringPtr("testString"))) - Expect(evaluationModel.AccountID).To(Equal(core.StringPtr("testString"))) - Expect(evaluationModel.Profile).To(Equal(sccProfileModel)) - Expect(evaluationModel.Result).To(Equal(resultModel)) - Expect(evaluationModel.Controls).To(Equal([]catalogmanagementv1.EvaluatedControl{*evaluatedControlModel})) + // Construct an instance of the DeleteObjectAccessOptions model + deleteObjectAccessOptionsModel := new(catalogmanagementv1.DeleteObjectAccessOptions) + deleteObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + deleteObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the Compliance model - complianceModel := new(catalogmanagementv1.Compliance) - Expect(complianceModel).ToNot(BeNil()) - complianceModel.Authority = core.StringPtr("testString") - complianceModel.Claims = claimsModel - complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} - Expect(complianceModel.Authority).To(Equal(core.StringPtr("testString"))) - Expect(complianceModel.Claims).To(Equal(claimsModel)) - Expect(complianceModel.Evaluations).To(Equal([]catalogmanagementv1.Evaluation{*evaluationModel})) + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeleteObjectAccess(deleteObjectAccessOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke DeleteObjectAccess with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ChangeNotices model - changeNoticesModel := new(catalogmanagementv1.ChangeNotices) - Expect(changeNoticesModel).ToNot(BeNil()) - changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} - changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} - changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} - Expect(changeNoticesModel.Breaking).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(changeNoticesModel.New).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(changeNoticesModel.Update).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + // Construct an instance of the DeleteObjectAccessOptions model + deleteObjectAccessOptionsModel := new(catalogmanagementv1.DeleteObjectAccessOptions) + deleteObjectAccessOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessOptionsModel.AccessIdentifier = core.StringPtr("testString") + deleteObjectAccessOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.DeleteObjectAccess(deleteObjectAccessOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeleteObjectAccessOptions model with no property values + deleteObjectAccessOptionsModelNew := new(catalogmanagementv1.DeleteObjectAccessOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeleteObjectAccess(deleteObjectAccessOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptions *GetObjectAccessListDeprecatedOptions) - Operation response error`, func() { + getObjectAccessListDeprecatedPath := "/catalogs/testString/objects/testString/access" + 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() - // Construct an instance of the Version model - versionModel := new(catalogmanagementv1.Version) - Expect(versionModel).ToNot(BeNil()) - versionModel.CRN = core.StringPtr("testString") - versionModel.Version = core.StringPtr("testString") - versionModel.Flavor = flavorModel - versionModel.Sha = core.StringPtr("testString") - versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - versionModel.OfferingID = core.StringPtr("testString") - versionModel.CatalogID = core.StringPtr("testString") - versionModel.KindID = core.StringPtr("testString") - versionModel.Tags = []string{"testString"} - versionModel.RepoURL = core.StringPtr("testString") - versionModel.SourceURL = core.StringPtr("testString") - versionModel.TgzURL = core.StringPtr("testString") - versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} - versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} - versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} - versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - versionModel.Validation = validationModel - versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} - versionModel.SingleInstance = core.BoolPtr(true) - versionModel.SchematicsEnvValues = schematicsEnvValuesModel - versionModel.Install = scriptModel - versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} - versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} - versionModel.Entitlement = versionEntitlementModel - versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} - versionModel.ImageManifestURL = core.StringPtr("testString") - versionModel.Deprecated = core.BoolPtr(true) - versionModel.PackageVersion = core.StringPtr("testString") - versionModel.State = stateModel - versionModel.VersionLocator = core.StringPtr("testString") - versionModel.LongDescription = core.StringPtr("testString") - versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} - versionModel.WhitelistedAccounts = []string{"testString"} - versionModel.ImagePullKeyName = core.StringPtr("testString") - versionModel.DeprecatePending = deprecatePendingModel - versionModel.SolutionInfo = solutionInfoModel - versionModel.IsConsumable = core.BoolPtr(true) - versionModel.ComplianceV3 = complianceModel - versionModel.ChangeNotices = changeNoticesModel - versionModel.PlanIds = []string{"testString"} - versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} - versionModel.Scripts["foo"] = *scriptRefModel - Expect(versionModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.Flavor).To(Equal(flavorModel)) - Expect(versionModel.Sha).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(versionModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(versionModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.KindID).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.Tags).To(Equal([]string{"testString"})) - Expect(versionModel.RepoURL).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.SourceURL).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.TgzURL).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.Configuration).To(Equal([]catalogmanagementv1.Configuration{*configurationModel})) - Expect(versionModel.Outputs).To(Equal([]catalogmanagementv1.Output{*outputModel})) - Expect(versionModel.IamPermissions).To(Equal([]catalogmanagementv1.IamPermission{*iamPermissionModel})) - Expect(versionModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(versionModel.Validation).To(Equal(validationModel)) - Expect(versionModel.RequiredResources).To(Equal([]catalogmanagementv1.Resource{*resourceModel})) - Expect(versionModel.SingleInstance).To(Equal(core.BoolPtr(true))) - Expect(versionModel.SchematicsEnvValues).To(Equal(schematicsEnvValuesModel)) - Expect(versionModel.Install).To(Equal(scriptModel)) - Expect(versionModel.PreInstall).To(Equal([]catalogmanagementv1.Script{*scriptModel})) - Expect(versionModel.Entitlement).To(Equal(versionEntitlementModel)) - Expect(versionModel.Licenses).To(Equal([]catalogmanagementv1.License{*licenseModel})) - Expect(versionModel.ImageManifestURL).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.Deprecated).To(Equal(core.BoolPtr(true))) - Expect(versionModel.PackageVersion).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.State).To(Equal(stateModel)) - Expect(versionModel.VersionLocator).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.LongDescription).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(versionModel.WhitelistedAccounts).To(Equal([]string{"testString"})) - Expect(versionModel.ImagePullKeyName).To(Equal(core.StringPtr("testString"))) - Expect(versionModel.DeprecatePending).To(Equal(deprecatePendingModel)) - Expect(versionModel.SolutionInfo).To(Equal(solutionInfoModel)) - Expect(versionModel.IsConsumable).To(Equal(core.BoolPtr(true))) - Expect(versionModel.ComplianceV3).To(Equal(complianceModel)) - Expect(versionModel.ChangeNotices).To(Equal(changeNoticesModel)) - Expect(versionModel.PlanIds).To(Equal([]string{"testString"})) - Expect(versionModel.Stack).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(versionModel.Scripts["foo"]).To(Equal(*scriptRefModel)) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListDeprecatedPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetObjectAccessListDeprecated with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the Kind model - kindModel := new(catalogmanagementv1.Kind) - Expect(kindModel).ToNot(BeNil()) - kindModel.ID = core.StringPtr("testString") - kindModel.FormatKind = core.StringPtr("testString") - kindModel.FormatKindLabel = core.StringPtr("testString") - kindModel.InstallKind = core.StringPtr("testString") - kindModel.InstallKindLabel = core.StringPtr("testString") - kindModel.TargetKind = core.StringPtr("testString") - kindModel.TargetKindLabel = core.StringPtr("testString") - kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - kindModel.Tags = []string{"testString"} - kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} - kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - kindModel.Versions = []catalogmanagementv1.Version{*versionModel} - Expect(kindModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.FormatKind).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.FormatKindLabel).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.InstallKind).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.InstallKindLabel).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.TargetKind).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.TargetKindLabel).To(Equal(core.StringPtr("testString"))) - Expect(kindModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(kindModel.Tags).To(Equal([]string{"testString"})) - Expect(kindModel.AdditionalFeatures).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(kindModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(kindModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(kindModel.Versions).To(Equal([]catalogmanagementv1.Version{*versionModel})) + // Construct an instance of the GetObjectAccessListDeprecatedOptions model + getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) + getObjectAccessListDeprecatedOptionsModel.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 := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - Expect(publishObjectModel).ToNot(BeNil()) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptions *GetObjectAccessListDeprecatedOptions)`, func() { + getObjectAccessListDeprecatedPath := "/catalogs/testString/objects/testString/access" + Context(`Using mock server endpoint with timeout`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the ProviderInfo model - providerInfoModel := new(catalogmanagementv1.ProviderInfo) - Expect(providerInfoModel).ToNot(BeNil()) - providerInfoModel.ID = core.StringPtr("testString") - providerInfoModel.Name = core.StringPtr("testString") - Expect(providerInfoModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(providerInfoModel.Name).To(Equal(core.StringPtr("testString"))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListDeprecatedPath)) + Expect(req.Method).To(Equal("GET")) - // Construct an instance of the RepoInfo model - repoInfoModel := new(catalogmanagementv1.RepoInfo) - Expect(repoInfoModel).ToNot(BeNil()) - repoInfoModel.Token = core.StringPtr("testString") - repoInfoModel.Type = core.StringPtr("testString") - Expect(repoInfoModel.Token).To(Equal(core.StringPtr("testString"))) - Expect(repoInfoModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // Sleep a short time to support a timeout test + time.Sleep(100 * time.Millisecond) - // Construct an instance of the ImagePullKey model - imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) - Expect(imagePullKeyModel).ToNot(BeNil()) - imagePullKeyModel.Name = core.StringPtr("testString") - imagePullKeyModel.Value = core.StringPtr("testString") - imagePullKeyModel.Description = core.StringPtr("testString") - Expect(imagePullKeyModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(imagePullKeyModel.Value).To(Equal(core.StringPtr("testString"))) - Expect(imagePullKeyModel.Description).To(Equal(core.StringPtr("testString"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + })) + }) + It(`Invoke GetObjectAccessListDeprecated successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) - // Construct an instance of the SupportWaitTime model - supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) - Expect(supportWaitTimeModel).ToNot(BeNil()) - supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) - supportWaitTimeModel.Type = core.StringPtr("testString") - Expect(supportWaitTimeModel.Value).To(Equal(core.Int64Ptr(int64(38)))) - Expect(supportWaitTimeModel.Type).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the GetObjectAccessListDeprecatedOptions model + getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) + getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the SupportTime model - supportTimeModel := new(catalogmanagementv1.SupportTime) - Expect(supportTimeModel).ToNot(BeNil()) - supportTimeModel.Day = core.Int64Ptr(int64(38)) - supportTimeModel.StartTime = core.StringPtr("testString") - supportTimeModel.EndTime = core.StringPtr("testString") - Expect(supportTimeModel.Day).To(Equal(core.Int64Ptr(int64(38)))) - Expect(supportTimeModel.StartTime).To(Equal(core.StringPtr("testString"))) - Expect(supportTimeModel.EndTime).To(Equal(core.StringPtr("testString"))) + // Invoke operation with a Context to test a timeout error + ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc() + _, _, operationErr := catalogManagementService.GetObjectAccessListDeprecatedWithContext(ctx, getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - // Construct an instance of the SupportAvailability model - supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) - Expect(supportAvailabilityModel).ToNot(BeNil()) - supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} - supportAvailabilityModel.Timezone = core.StringPtr("testString") - supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) - Expect(supportAvailabilityModel.Times).To(Equal([]catalogmanagementv1.SupportTime{*supportTimeModel})) - Expect(supportAvailabilityModel.Timezone).To(Equal(core.StringPtr("testString"))) - Expect(supportAvailabilityModel.AlwaysAvailable).To(Equal(core.BoolPtr(true))) + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Construct an instance of the SupportDetail model - supportDetailModel := new(catalogmanagementv1.SupportDetail) - Expect(supportDetailModel).ToNot(BeNil()) - supportDetailModel.Type = core.StringPtr("testString") - supportDetailModel.Contact = core.StringPtr("testString") - supportDetailModel.ResponseWaitTime = supportWaitTimeModel - supportDetailModel.Availability = supportAvailabilityModel - Expect(supportDetailModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(supportDetailModel.Contact).To(Equal(core.StringPtr("testString"))) - Expect(supportDetailModel.ResponseWaitTime).To(Equal(supportWaitTimeModel)) - Expect(supportDetailModel.Availability).To(Equal(supportAvailabilityModel)) + // Re-test the timeout error with retries disabled + ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc2() + _, _, operationErr = catalogManagementService.GetObjectAccessListDeprecatedWithContext(ctx, getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the SupportEscalation model - supportEscalationModel := new(catalogmanagementv1.SupportEscalation) - Expect(supportEscalationModel).ToNot(BeNil()) - supportEscalationModel.EscalationWaitTime = supportWaitTimeModel - supportEscalationModel.ResponseWaitTime = supportWaitTimeModel - supportEscalationModel.Contact = core.StringPtr("testString") - Expect(supportEscalationModel.EscalationWaitTime).To(Equal(supportWaitTimeModel)) - Expect(supportEscalationModel.ResponseWaitTime).To(Equal(supportWaitTimeModel)) - Expect(supportEscalationModel.Contact).To(Equal(core.StringPtr("testString"))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getObjectAccessListDeprecatedPath)) + Expect(req.Method).To(Equal("GET")) - // Construct an instance of the Support model - supportModel := new(catalogmanagementv1.Support) - Expect(supportModel).ToNot(BeNil()) - supportModel.URL = core.StringPtr("testString") - supportModel.Process = core.StringPtr("testString") - supportModel.ProcessI18n = map[string]string{"key1": "testString"} - supportModel.Locations = []string{"testString"} - supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} - supportModel.SupportEscalation = supportEscalationModel - supportModel.SupportType = core.StringPtr("testString") - Expect(supportModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(supportModel.Process).To(Equal(core.StringPtr("testString"))) - Expect(supportModel.ProcessI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(supportModel.Locations).To(Equal([]string{"testString"})) - Expect(supportModel.SupportDetails).To(Equal([]catalogmanagementv1.SupportDetail{*supportDetailModel})) - Expect(supportModel.SupportEscalation).To(Equal(supportEscalationModel)) - Expect(supportModel.SupportType).To(Equal(core.StringPtr("testString"))) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": "First", "last": "Last", "prev": "Prev", "next": "Next", "resources": [{"id": "ID", "account": "Account", "account_type": 11, "catalog_id": "CatalogID", "target_id": "TargetID", "target_account": "TargetAccount", "target_kind": "TargetKind", "created": "2019-01-01T12:00:00.000Z", "approval_state": "ApprovalState"}]}`) + })) + }) + It(`Invoke GetObjectAccessListDeprecated successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the LearnMoreLinks model - learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) - Expect(learnMoreLinksModel).ToNot(BeNil()) - learnMoreLinksModel.FirstParty = core.StringPtr("testString") - learnMoreLinksModel.ThirdParty = core.StringPtr("testString") - Expect(learnMoreLinksModel.FirstParty).To(Equal(core.StringPtr("testString"))) - Expect(learnMoreLinksModel.ThirdParty).To(Equal(core.StringPtr("testString"))) + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the Constraint model - constraintModel := new(catalogmanagementv1.Constraint) - Expect(constraintModel).ToNot(BeNil()) - constraintModel.Type = core.StringPtr("testString") - constraintModel.Rule = "testString" - Expect(constraintModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(constraintModel.Rule).To(Equal("testString")) + // Construct an instance of the GetObjectAccessListDeprecatedOptions model + getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) + getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the Badge model - badgeModel := new(catalogmanagementv1.Badge) - Expect(badgeModel).ToNot(BeNil()) - badgeModel.ID = core.StringPtr("testString") - badgeModel.Label = core.StringPtr("testString") - badgeModel.LabelI18n = map[string]string{"key1": "testString"} - badgeModel.Description = core.StringPtr("testString") - badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} - badgeModel.Icon = core.StringPtr("testString") - badgeModel.Authority = core.StringPtr("testString") - badgeModel.Tag = core.StringPtr("testString") - badgeModel.LearnMoreLinks = learnMoreLinksModel - badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} - Expect(badgeModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(badgeModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(badgeModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(badgeModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(badgeModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(badgeModel.Icon).To(Equal(core.StringPtr("testString"))) - Expect(badgeModel.Authority).To(Equal(core.StringPtr("testString"))) - Expect(badgeModel.Tag).To(Equal(core.StringPtr("testString"))) - Expect(badgeModel.LearnMoreLinks).To(Equal(learnMoreLinksModel)) - Expect(badgeModel.Constraints).To(Equal([]catalogmanagementv1.Constraint{*constraintModel})) + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Construct an instance of the VersionRange model - versionRangeModel := new(catalogmanagementv1.VersionRange) - Expect(versionRangeModel).ToNot(BeNil()) - versionRangeModel.Kinds = []string{"testString"} - versionRangeModel.Version = core.StringPtr("testString") - versionRangeModel.Flavors = []string{"testString"} - Expect(versionRangeModel.Kinds).To(Equal([]string{"testString"})) - Expect(versionRangeModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(versionRangeModel.Flavors).To(Equal([]string{"testString"})) + }) + It(`Invoke GetObjectAccessListDeprecated with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the Plan model - planModel := new(catalogmanagementv1.Plan) - Expect(planModel).ToNot(BeNil()) - planModel.URL = core.StringPtr("testString") - planModel.CRN = core.StringPtr("testString") - planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") - planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - planModel.OfferingID = core.StringPtr("testString") - planModel.CatalogID = core.StringPtr("testString") - planModel.Label = core.StringPtr("testString") - planModel.LabelI18n = map[string]string{"key1": "testString"} - planModel.Name = core.StringPtr("testString") - planModel.ShortDescription = core.StringPtr("testString") - planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} - planModel.PricingTags = []string{"testString"} - planModel.VersionRange = versionRangeModel - planModel.Features = []catalogmanagementv1.Feature{*featureModel} - planModel.State = stateModel - planModel.DeprecatePending = deprecatePendingModel - planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} - planModel.PublishApproved = core.BoolPtr(true) - Expect(planModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(planModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(planModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(planModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(planModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(planModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(planModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(planModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(planModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(planModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(planModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(planModel.PricingTags).To(Equal([]string{"testString"})) - Expect(planModel.VersionRange).To(Equal(versionRangeModel)) - Expect(planModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(planModel.State).To(Equal(stateModel)) - Expect(planModel.DeprecatePending).To(Equal(deprecatePendingModel)) - Expect(planModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(planModel.PublishApproved).To(Equal(core.BoolPtr(true))) + // Construct an instance of the GetObjectAccessListDeprecatedOptions model + getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) + getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + 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 GetObjectAccessListDeprecatedOptions model with no property values + getObjectAccessListDeprecatedOptionsModelNew := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModelNew) + 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() - // Construct an instance of the CreateOfferingOptions model - catalogIdentifier := "testString" - createOfferingOptionsModel := catalogManagementService.NewCreateOfferingOptions(catalogIdentifier) - createOfferingOptionsModel.SetCatalogIdentifier("testString") - createOfferingOptionsModel.SetURL("testString") - createOfferingOptionsModel.SetCRN("testString") - createOfferingOptionsModel.SetLabel("testString") - createOfferingOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) - createOfferingOptionsModel.SetName("testString") - createOfferingOptionsModel.SetOfferingIconURL("testString") - createOfferingOptionsModel.SetOfferingDocsURL("testString") - createOfferingOptionsModel.SetOfferingSupportURL("testString") - createOfferingOptionsModel.SetTags([]string{"testString"}) - createOfferingOptionsModel.SetKeywords([]string{"testString"}) - createOfferingOptionsModel.SetRating(ratingModel) - createOfferingOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - createOfferingOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - createOfferingOptionsModel.SetShortDescription("testString") - createOfferingOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) - createOfferingOptionsModel.SetLongDescription("testString") - createOfferingOptionsModel.SetLongDescriptionI18n(map[string]string{"key1": "testString"}) - createOfferingOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) - createOfferingOptionsModel.SetKinds([]catalogmanagementv1.Kind{*kindModel}) - createOfferingOptionsModel.SetPublish(publishObjectModel) - createOfferingOptionsModel.SetPcManaged(true) - createOfferingOptionsModel.SetPublishApproved(true) - createOfferingOptionsModel.SetShareWithAll(true) - createOfferingOptionsModel.SetShareWithIBM(true) - createOfferingOptionsModel.SetShareEnabled(true) - createOfferingOptionsModel.SetPublicOriginalCRN("testString") - createOfferingOptionsModel.SetPublishPublicCRN("testString") - createOfferingOptionsModel.SetPortalApprovalRecord("testString") - createOfferingOptionsModel.SetPortalUIURL("testString") - createOfferingOptionsModel.SetCatalogID("testString") - createOfferingOptionsModel.SetCatalogName("testString") - createOfferingOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) - createOfferingOptionsModel.SetDisclaimer("testString") - createOfferingOptionsModel.SetHidden(true) - createOfferingOptionsModel.SetProvider("testString") - createOfferingOptionsModel.SetProviderInfo(providerInfoModel) - createOfferingOptionsModel.SetRepoInfo(repoInfoModel) - createOfferingOptionsModel.SetImagePullKeys([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel}) - createOfferingOptionsModel.SetSupport(supportModel) - createOfferingOptionsModel.SetMedia([]catalogmanagementv1.MediaItem{*mediaItemModel}) - createOfferingOptionsModel.SetDeprecatePending(deprecatePendingModel) - createOfferingOptionsModel.SetProductKind("testString") - createOfferingOptionsModel.SetBadges([]catalogmanagementv1.Badge{*badgeModel}) - createOfferingOptionsModel.SetPlans([]catalogmanagementv1.Plan{*planModel}) - createOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(createOfferingOptionsModel).ToNot(BeNil()) - Expect(createOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createOfferingOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.OfferingIconURL).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.OfferingDocsURL).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.OfferingSupportURL).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(createOfferingOptionsModel.Keywords).To(Equal([]string{"testString"})) - Expect(createOfferingOptionsModel.Rating).To(Equal(ratingModel)) - Expect(createOfferingOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(createOfferingOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(createOfferingOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createOfferingOptionsModel.LongDescription).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(createOfferingOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(createOfferingOptionsModel.Kinds).To(Equal([]catalogmanagementv1.Kind{*kindModel})) - Expect(createOfferingOptionsModel.Publish).To(Equal(publishObjectModel)) - Expect(createOfferingOptionsModel.PcManaged).To(Equal(core.BoolPtr(true))) - Expect(createOfferingOptionsModel.PublishApproved).To(Equal(core.BoolPtr(true))) - Expect(createOfferingOptionsModel.ShareWithAll).To(Equal(core.BoolPtr(true))) - Expect(createOfferingOptionsModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) - Expect(createOfferingOptionsModel.ShareEnabled).To(Equal(core.BoolPtr(true))) - Expect(createOfferingOptionsModel.PublicOriginalCRN).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.PublishPublicCRN).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.PortalApprovalRecord).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.PortalUIURL).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(createOfferingOptionsModel.Disclaimer).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.Hidden).To(Equal(core.BoolPtr(true))) - Expect(createOfferingOptionsModel.Provider).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.ProviderInfo).To(Equal(providerInfoModel)) - Expect(createOfferingOptionsModel.RepoInfo).To(Equal(repoInfoModel)) - Expect(createOfferingOptionsModel.ImagePullKeys).To(Equal([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel})) - Expect(createOfferingOptionsModel.Support).To(Equal(supportModel)) - Expect(createOfferingOptionsModel.Media).To(Equal([]catalogmanagementv1.MediaItem{*mediaItemModel})) - Expect(createOfferingOptionsModel.DeprecatePending).To(Equal(deprecatePendingModel)) - Expect(createOfferingOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) - Expect(createOfferingOptionsModel.Badges).To(Equal([]catalogmanagementv1.Badge{*badgeModel})) - Expect(createOfferingOptionsModel.Plans).To(Equal([]catalogmanagementv1.Plan{*planModel})) - Expect(createOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewDeleteCatalogOptions successfully`, func() { - // Construct an instance of the DeleteCatalogOptions model - catalogIdentifier := "testString" - deleteCatalogOptionsModel := catalogManagementService.NewDeleteCatalogOptions(catalogIdentifier) - deleteCatalogOptionsModel.SetCatalogIdentifier("testString") - deleteCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteCatalogOptionsModel).ToNot(BeNil()) - Expect(deleteCatalogOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Set success status code with no respoonse body + res.WriteHeader(200) + })) }) - It(`Invoke NewDeleteObjectAccessListOptions successfully`, func() { - // Construct an instance of the DeleteObjectAccessListOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - accesses := []string{"testString"} - deleteObjectAccessListOptionsModel := catalogManagementService.NewDeleteObjectAccessListOptions(catalogIdentifier, objectIdentifier, accesses) - deleteObjectAccessListOptionsModel.SetCatalogIdentifier("testString") - deleteObjectAccessListOptionsModel.SetObjectIdentifier("testString") - deleteObjectAccessListOptionsModel.SetAccesses([]string{"testString"}) - deleteObjectAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteObjectAccessListOptionsModel).ToNot(BeNil()) - Expect(deleteObjectAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectAccessListOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(deleteObjectAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetObjectAccessListDeprecated successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetObjectAccessListDeprecatedOptions model + getObjectAccessListDeprecatedOptionsModel := new(catalogmanagementv1.GetObjectAccessListDeprecatedOptions) + getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier = core.StringPtr("testString") + getObjectAccessListDeprecatedOptionsModel.Limit = core.Int64Ptr(int64(10)) + getObjectAccessListDeprecatedOptionsModel.Offset = core.Int64Ptr(int64(0)) + getObjectAccessListDeprecatedOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.GetObjectAccessListDeprecated(getObjectAccessListDeprecatedOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) - It(`Invoke NewDeleteObjectAccessOptions successfully`, func() { - // Construct an instance of the DeleteObjectAccessOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - accessIdentifier := "testString" - deleteObjectAccessOptionsModel := catalogManagementService.NewDeleteObjectAccessOptions(catalogIdentifier, objectIdentifier, accessIdentifier) - deleteObjectAccessOptionsModel.SetCatalogIdentifier("testString") - deleteObjectAccessOptionsModel.SetObjectIdentifier("testString") - deleteObjectAccessOptionsModel.SetAccessIdentifier("testString") - deleteObjectAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteObjectAccessOptionsModel).ToNot(BeNil()) - Expect(deleteObjectAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectAccessOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewDeleteObjectOptions successfully`, func() { - // Construct an instance of the DeleteObjectOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - deleteObjectOptionsModel := catalogManagementService.NewDeleteObjectOptions(catalogIdentifier, objectIdentifier) - deleteObjectOptionsModel.SetCatalogIdentifier("testString") - deleteObjectOptionsModel.SetObjectIdentifier("testString") - deleteObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteObjectOptionsModel).ToNot(BeNil()) - Expect(deleteObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextOffset successfully`, func() { + responseObject := new(catalogmanagementv1.ObjectAccessListResult) + responseObject.Next = core.StringPtr("ibm.com?offset=135") + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(Equal(core.Int64Ptr(int64(135)))) }) - It(`Invoke NewDeleteOfferingAccessListOptions successfully`, func() { - // Construct an instance of the DeleteOfferingAccessListOptions model - catalogIdentifier := "testString" - offeringID := "testString" - accesses := []string{"testString"} - deleteOfferingAccessListOptionsModel := catalogManagementService.NewDeleteOfferingAccessListOptions(catalogIdentifier, offeringID, accesses) - deleteOfferingAccessListOptionsModel.SetCatalogIdentifier("testString") - deleteOfferingAccessListOptionsModel.SetOfferingID("testString") - deleteOfferingAccessListOptionsModel.SetAccesses([]string{"testString"}) - deleteOfferingAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteOfferingAccessListOptionsModel).ToNot(BeNil()) - Expect(deleteOfferingAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingAccessListOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(deleteOfferingAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetNextOffset without a "Next" property in the response`, func() { + responseObject := new(catalogmanagementv1.ObjectAccessListResult) + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) }) - It(`Invoke NewDeleteOfferingInstanceOptions successfully`, func() { - // Construct an instance of the DeleteOfferingInstanceOptions model - instanceIdentifier := "testString" - xAuthRefreshToken := "testString" - deleteOfferingInstanceOptionsModel := catalogManagementService.NewDeleteOfferingInstanceOptions(instanceIdentifier, xAuthRefreshToken) - deleteOfferingInstanceOptionsModel.SetInstanceIdentifier("testString") - deleteOfferingInstanceOptionsModel.SetXAuthRefreshToken("testString") - deleteOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteOfferingInstanceOptionsModel).ToNot(BeNil()) - Expect(deleteOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetNextOffset without any query params in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.ObjectAccessListResult) + responseObject.Next = core.StringPtr("ibm.com") + + value, err := responseObject.GetNextOffset() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) }) - It(`Invoke NewDeleteOfferingOptions successfully`, func() { - // Construct an instance of the DeleteOfferingOptions model - catalogIdentifier := "testString" - offeringID := "testString" - deleteOfferingOptionsModel := catalogManagementService.NewDeleteOfferingOptions(catalogIdentifier, offeringID) - deleteOfferingOptionsModel.SetCatalogIdentifier("testString") - deleteOfferingOptionsModel.SetOfferingID("testString") - deleteOfferingOptionsModel.SetXApproverToken("testString") - deleteOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteOfferingOptionsModel).ToNot(BeNil()) - Expect(deleteOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingOptionsModel.XApproverToken).To(Equal(core.StringPtr("testString"))) - Expect(deleteOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetNextOffset with a non-integer query param in the "Next" URL`, func() { + responseObject := new(catalogmanagementv1.ObjectAccessListResult) + responseObject.Next = core.StringPtr("ibm.com?offset=tiger") + + value, err := responseObject.GetNextOffset() + Expect(err).NotTo(BeNil()) + Expect(value).To(BeNil()) }) - It(`Invoke NewDeleteOperatorsOptions successfully`, func() { - // Construct an instance of the DeleteOperatorsOptions model - xAuthRefreshToken := "testString" - clusterID := "testString" - region := "testString" - versionLocatorID := "testString" - deleteOperatorsOptionsModel := catalogManagementService.NewDeleteOperatorsOptions(xAuthRefreshToken, clusterID, region, versionLocatorID) - deleteOperatorsOptionsModel.SetXAuthRefreshToken("testString") - deleteOperatorsOptionsModel.SetClusterID("testString") - deleteOperatorsOptionsModel.SetRegion("testString") - deleteOperatorsOptionsModel.SetVersionLocatorID("testString") - deleteOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteOperatorsOptionsModel).ToNot(BeNil()) - Expect(deleteOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(deleteOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(deleteOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(deleteOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) - Expect(deleteOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + Context(`Using mock server endpoint - paginated response`, func() { + BeforeEach(func() { + var requestNumber int = 0 + 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(getObjectAccessListDeprecatedPath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":"https://myhost.com/somePath?offset=1","total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"resources":[{"id":"ID","account":"Account","account_type":11,"catalog_id":"CatalogID","target_id":"TargetID","target_account":"TargetAccount","target_kind":"TargetKind","created":"2019-01-01T12:00:00.000Z","approval_state":"ApprovalState"}]}`) + } else { + res.WriteHeader(400) + } + })) }) - It(`Invoke NewDeletePlanOptions successfully`, func() { - // Construct an instance of the DeletePlanOptions model - planLocID := "testString" - deletePlanOptionsModel := catalogManagementService.NewDeletePlanOptions(planLocID) - deletePlanOptionsModel.SetPlanLocID("testString") - deletePlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deletePlanOptionsModel).ToNot(BeNil()) - Expect(deletePlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) - Expect(deletePlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Use GetObjectAccessListDeprecatedPager.GetNext successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + getObjectAccessListDeprecatedOptionsModel := &catalogmanagementv1.GetObjectAccessListDeprecatedOptions{ + CatalogIdentifier: core.StringPtr("testString"), + ObjectIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + } + + pager, err := catalogManagementService.NewGetObjectAccessListDeprecatedPager(getObjectAccessListDeprecatedOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + var allResults []catalogmanagementv1.Access + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) }) - It(`Invoke NewDeleteShareApprovalListOptions successfully`, func() { - // Construct an instance of the DeleteShareApprovalListOptions model - objectType := "offering" - accesses := []string{"testString"} - deleteShareApprovalListOptionsModel := catalogManagementService.NewDeleteShareApprovalListOptions(objectType, accesses) - deleteShareApprovalListOptionsModel.SetObjectType("offering") - deleteShareApprovalListOptionsModel.SetAccesses([]string{"testString"}) - deleteShareApprovalListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteShareApprovalListOptionsModel).ToNot(BeNil()) - Expect(deleteShareApprovalListOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) - Expect(deleteShareApprovalListOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(deleteShareApprovalListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Use GetObjectAccessListDeprecatedPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + getObjectAccessListDeprecatedOptionsModel := &catalogmanagementv1.GetObjectAccessListDeprecatedOptions{ + CatalogIdentifier: core.StringPtr("testString"), + ObjectIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + } + + pager, err := catalogManagementService.NewGetObjectAccessListDeprecatedPager(getObjectAccessListDeprecatedOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) }) - It(`Invoke NewDeleteVersionOptions successfully`, func() { - // Construct an instance of the DeleteVersionOptions model - versionLocID := "testString" - deleteVersionOptionsModel := catalogManagementService.NewDeleteVersionOptions(versionLocID) - deleteVersionOptionsModel.SetVersionLocID("testString") - deleteVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deleteVersionOptionsModel).ToNot(BeNil()) - Expect(deleteVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(deleteVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`DeleteObjectAccessList(deleteObjectAccessListOptions *DeleteObjectAccessListOptions) - Operation response error`, func() { + deleteObjectAccessListPath := "/catalogs/testString/objects/testString/access" + 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(deleteObjectAccessListPath)) + Expect(req.Method).To(Equal("DELETE")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) }) - It(`Invoke NewDeployOperatorsOptions successfully`, func() { - // Construct an instance of the DeployOperatorsOptions model - xAuthRefreshToken := "testString" - deployOperatorsOptionsModel := catalogManagementService.NewDeployOperatorsOptions(xAuthRefreshToken) - deployOperatorsOptionsModel.SetXAuthRefreshToken("testString") - deployOperatorsOptionsModel.SetClusterID("testString") - deployOperatorsOptionsModel.SetRegion("testString") - deployOperatorsOptionsModel.SetNamespaces([]string{"testString"}) - deployOperatorsOptionsModel.SetAllNamespaces(true) - deployOperatorsOptionsModel.SetVersionLocatorID("testString") - deployOperatorsOptionsModel.SetChannel("testString") - deployOperatorsOptionsModel.SetInstallPlan("testString") - deployOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deployOperatorsOptionsModel).ToNot(BeNil()) - Expect(deployOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(deployOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(deployOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(deployOperatorsOptionsModel.Namespaces).To(Equal([]string{"testString"})) - Expect(deployOperatorsOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(deployOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) - Expect(deployOperatorsOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(deployOperatorsOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) - Expect(deployOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke DeleteObjectAccessList with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeleteObjectAccessListOptions model + deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) + deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} + deleteObjectAccessListOptionsModel.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 := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewDeprecateOfferingOptions successfully`, func() { - // Construct an instance of the DeprecateOfferingOptions model - catalogIdentifier := "testString" - offeringID := "testString" - setting := "true" - deprecateOfferingOptionsModel := catalogManagementService.NewDeprecateOfferingOptions(catalogIdentifier, offeringID, setting) - deprecateOfferingOptionsModel.SetCatalogIdentifier("testString") - deprecateOfferingOptionsModel.SetOfferingID("testString") - deprecateOfferingOptionsModel.SetSetting("true") - deprecateOfferingOptionsModel.SetDescription("testString") - deprecateOfferingOptionsModel.SetDaysUntilDeprecate(int64(38)) - deprecateOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deprecateOfferingOptionsModel).ToNot(BeNil()) - Expect(deprecateOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(deprecateOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(deprecateOfferingOptionsModel.Setting).To(Equal(core.StringPtr("true"))) - Expect(deprecateOfferingOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(deprecateOfferingOptionsModel.DaysUntilDeprecate).To(Equal(core.Int64Ptr(int64(38)))) - Expect(deprecateOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewDeprecateVersionOptions successfully`, func() { - // Construct an instance of the DeprecateVersionOptions model - versionLocID := "testString" - deprecateVersionOptionsModel := catalogManagementService.NewDeprecateVersionOptions(versionLocID) - deprecateVersionOptionsModel.SetVersionLocID("testString") - deprecateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(deprecateVersionOptionsModel).ToNot(BeNil()) - Expect(deprecateVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(deprecateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`DeleteObjectAccessList(deleteObjectAccessListOptions *DeleteObjectAccessListOptions)`, func() { + deleteObjectAccessListPath := "/catalogs/testString/objects/testString/access" + 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(deleteObjectAccessListPath)) + Expect(req.Method).To(Equal("DELETE")) + + // 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()) + + // 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", `{"errors": {"mapKey": "Inner"}}`) + })) }) - It(`Invoke NewGetCatalogAccountAuditOptions successfully`, func() { - // Construct an instance of the GetCatalogAccountAuditOptions model - auditlogIdentifier := "testString" - getCatalogAccountAuditOptionsModel := catalogManagementService.NewGetCatalogAccountAuditOptions(auditlogIdentifier) - getCatalogAccountAuditOptionsModel.SetAuditlogIdentifier("testString") - getCatalogAccountAuditOptionsModel.SetLookupnames(true) - getCatalogAccountAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getCatalogAccountAuditOptionsModel).ToNot(BeNil()) - Expect(getCatalogAccountAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getCatalogAccountAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(getCatalogAccountAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke DeleteObjectAccessList successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the DeleteObjectAccessListOptions model + deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) + deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} + deleteObjectAccessListOptionsModel.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 := catalogManagementService.DeleteObjectAccessListWithContext(ctx, deleteObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + 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 = catalogManagementService.DeleteObjectAccessListWithContext(ctx, deleteObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) - It(`Invoke NewGetCatalogAccountFiltersOptions successfully`, func() { - // Construct an instance of the GetCatalogAccountFiltersOptions model - getCatalogAccountFiltersOptionsModel := catalogManagementService.NewGetCatalogAccountFiltersOptions() - getCatalogAccountFiltersOptionsModel.SetCatalog("testString") - getCatalogAccountFiltersOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getCatalogAccountFiltersOptionsModel).ToNot(BeNil()) - Expect(getCatalogAccountFiltersOptionsModel.Catalog).To(Equal(core.StringPtr("testString"))) - Expect(getCatalogAccountFiltersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetCatalogAccountOptions successfully`, func() { - // Construct an instance of the GetCatalogAccountOptions model - getCatalogAccountOptionsModel := catalogManagementService.NewGetCatalogAccountOptions() - getCatalogAccountOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getCatalogAccountOptionsModel).ToNot(BeNil()) - Expect(getCatalogAccountOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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(deleteObjectAccessListPath)) + Expect(req.Method).To(Equal("DELETE")) + + // 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()) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"errors": {"mapKey": "Inner"}}`) + })) }) - It(`Invoke NewGetCatalogAuditOptions successfully`, func() { - // Construct an instance of the GetCatalogAuditOptions model - catalogIdentifier := "testString" - auditlogIdentifier := "testString" - getCatalogAuditOptionsModel := catalogManagementService.NewGetCatalogAuditOptions(catalogIdentifier, auditlogIdentifier) - getCatalogAuditOptionsModel.SetCatalogIdentifier("testString") - getCatalogAuditOptionsModel.SetAuditlogIdentifier("testString") - getCatalogAuditOptionsModel.SetLookupnames(true) - getCatalogAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getCatalogAuditOptionsModel).ToNot(BeNil()) - Expect(getCatalogAuditOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getCatalogAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getCatalogAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(getCatalogAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke DeleteObjectAccessList successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.DeleteObjectAccessList(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the DeleteObjectAccessListOptions model + deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) + deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} + deleteObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + }) - It(`Invoke NewGetCatalogOptions successfully`, func() { - // Construct an instance of the GetCatalogOptions model - catalogIdentifier := "testString" - getCatalogOptionsModel := catalogManagementService.NewGetCatalogOptions(catalogIdentifier) - getCatalogOptionsModel.SetCatalogIdentifier("testString") - getCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getCatalogOptionsModel).ToNot(BeNil()) - Expect(getCatalogOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke DeleteObjectAccessList with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeleteObjectAccessListOptions model + deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) + deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} + deleteObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + 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 DeleteObjectAccessListOptions model with no property values + deleteObjectAccessListOptionsModelNew := new(catalogmanagementv1.DeleteObjectAccessListOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewGetClusterOptions successfully`, func() { - // Construct an instance of the GetClusterOptions model - clusterID := "testString" - region := "testString" - xAuthRefreshToken := "testString" - getClusterOptionsModel := catalogManagementService.NewGetClusterOptions(clusterID, region, xAuthRefreshToken) - getClusterOptionsModel.SetClusterID("testString") - getClusterOptionsModel.SetRegion("testString") - getClusterOptionsModel.SetXAuthRefreshToken("testString") - getClusterOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getClusterOptionsModel).ToNot(BeNil()) - Expect(getClusterOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(getClusterOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(getClusterOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(getClusterOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetConsumptionOfferingsOptions successfully`, func() { - // Construct an instance of the GetConsumptionOfferingsOptions model - getConsumptionOfferingsOptionsModel := catalogManagementService.NewGetConsumptionOfferingsOptions() - getConsumptionOfferingsOptionsModel.SetDigest(true) - getConsumptionOfferingsOptionsModel.SetCatalog("testString") - getConsumptionOfferingsOptionsModel.SetSelect("all") - getConsumptionOfferingsOptionsModel.SetIncludeHidden(true) - getConsumptionOfferingsOptionsModel.SetLimit(int64(10)) - getConsumptionOfferingsOptionsModel.SetOffset(int64(0)) - getConsumptionOfferingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getConsumptionOfferingsOptionsModel).ToNot(BeNil()) - Expect(getConsumptionOfferingsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) - Expect(getConsumptionOfferingsOptionsModel.Catalog).To(Equal(core.StringPtr("testString"))) - Expect(getConsumptionOfferingsOptionsModel.Select).To(Equal(core.StringPtr("all"))) - Expect(getConsumptionOfferingsOptionsModel.IncludeHidden).To(Equal(core.BoolPtr(true))) - Expect(getConsumptionOfferingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getConsumptionOfferingsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) - Expect(getConsumptionOfferingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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 NewGetEnterpriseAuditOptions successfully`, func() { - // Construct an instance of the GetEnterpriseAuditOptions model - enterpriseIdentifier := "testString" - auditlogIdentifier := "testString" - getEnterpriseAuditOptionsModel := catalogManagementService.NewGetEnterpriseAuditOptions(enterpriseIdentifier, auditlogIdentifier) - getEnterpriseAuditOptionsModel.SetEnterpriseIdentifier("testString") - getEnterpriseAuditOptionsModel.SetAuditlogIdentifier("testString") - getEnterpriseAuditOptionsModel.SetLookupnames(true) - getEnterpriseAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getEnterpriseAuditOptionsModel).ToNot(BeNil()) - Expect(getEnterpriseAuditOptionsModel.EnterpriseIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getEnterpriseAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getEnterpriseAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(getEnterpriseAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke DeleteObjectAccessList successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeleteObjectAccessListOptions model + deleteObjectAccessListOptionsModel := new(catalogmanagementv1.DeleteObjectAccessListOptions) + deleteObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + deleteObjectAccessListOptionsModel.Accesses = []string{"testString"} + deleteObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.DeleteObjectAccessList(deleteObjectAccessListOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) - It(`Invoke NewGetIamPermissionsOptions successfully`, func() { - // Construct an instance of the GetIamPermissionsOptions model - versionLocID := "testString" - getIamPermissionsOptionsModel := catalogManagementService.NewGetIamPermissionsOptions(versionLocID) - getIamPermissionsOptionsModel.SetVersionLocID("testString") - getIamPermissionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getIamPermissionsOptionsModel).ToNot(BeNil()) - Expect(getIamPermissionsOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getIamPermissionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetNamespacesOptions successfully`, func() { - // Construct an instance of the GetNamespacesOptions model - clusterID := "testString" - region := "testString" - xAuthRefreshToken := "testString" - getNamespacesOptionsModel := catalogManagementService.NewGetNamespacesOptions(clusterID, region, xAuthRefreshToken) - getNamespacesOptionsModel.SetClusterID("testString") - getNamespacesOptionsModel.SetRegion("testString") - getNamespacesOptionsModel.SetXAuthRefreshToken("testString") - getNamespacesOptionsModel.SetLimit(int64(10)) - getNamespacesOptionsModel.SetOffset(int64(0)) - getNamespacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getNamespacesOptionsModel).ToNot(BeNil()) - Expect(getNamespacesOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(getNamespacesOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(getNamespacesOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(getNamespacesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getNamespacesOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) - Expect(getNamespacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`AddObjectAccessList(addObjectAccessListOptions *AddObjectAccessListOptions) - Operation response error`, func() { + addObjectAccessListPath := "/catalogs/testString/objects/testString/access" + 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(addObjectAccessListPath)) + Expect(req.Method).To(Equal("POST")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(201) + fmt.Fprint(res, `} this is not valid json {`) + })) }) - It(`Invoke NewGetObjectAccessListDeprecatedOptions successfully`, func() { - // Construct an instance of the GetObjectAccessListDeprecatedOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - getObjectAccessListDeprecatedOptionsModel := catalogManagementService.NewGetObjectAccessListDeprecatedOptions(catalogIdentifier, objectIdentifier) - getObjectAccessListDeprecatedOptionsModel.SetCatalogIdentifier("testString") - getObjectAccessListDeprecatedOptionsModel.SetObjectIdentifier("testString") - getObjectAccessListDeprecatedOptionsModel.SetLimit(int64(10)) - getObjectAccessListDeprecatedOptionsModel.SetOffset(int64(0)) - getObjectAccessListDeprecatedOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getObjectAccessListDeprecatedOptionsModel).ToNot(BeNil()) - Expect(getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessListDeprecatedOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getObjectAccessListDeprecatedOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) - Expect(getObjectAccessListDeprecatedOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke AddObjectAccessList with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the AddObjectAccessListOptions model + addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) + addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.Accesses = []string{"testString"} + addObjectAccessListOptionsModel.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 := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewGetObjectAccessListOptions successfully`, func() { - // Construct an instance of the GetObjectAccessListOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - getObjectAccessListOptionsModel := catalogManagementService.NewGetObjectAccessListOptions(catalogIdentifier, objectIdentifier) - getObjectAccessListOptionsModel.SetCatalogIdentifier("testString") - getObjectAccessListOptionsModel.SetObjectIdentifier("testString") - getObjectAccessListOptionsModel.SetStart("testString") - getObjectAccessListOptionsModel.SetLimit(int64(10)) - getObjectAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getObjectAccessListOptionsModel).ToNot(BeNil()) - Expect(getObjectAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessListOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessListOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessListOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getObjectAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetObjectAccessOptions successfully`, func() { - // Construct an instance of the GetObjectAccessOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - accessIdentifier := "testString" - getObjectAccessOptionsModel := catalogManagementService.NewGetObjectAccessOptions(catalogIdentifier, objectIdentifier, accessIdentifier) - getObjectAccessOptionsModel.SetCatalogIdentifier("testString") - getObjectAccessOptionsModel.SetObjectIdentifier("testString") - getObjectAccessOptionsModel.SetAccessIdentifier("testString") - getObjectAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getObjectAccessOptionsModel).ToNot(BeNil()) - Expect(getObjectAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`AddObjectAccessList(addObjectAccessListOptions *AddObjectAccessListOptions)`, func() { + addObjectAccessListPath := "/catalogs/testString/objects/testString/access" + 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(addObjectAccessListPath)) + 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()) + + // 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", `{"errors": {"mapKey": "Inner"}}`) + })) }) - It(`Invoke NewGetObjectAuditOptions successfully`, func() { - // Construct an instance of the GetObjectAuditOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - auditlogIdentifier := "testString" - getObjectAuditOptionsModel := catalogManagementService.NewGetObjectAuditOptions(catalogIdentifier, objectIdentifier, auditlogIdentifier) - getObjectAuditOptionsModel.SetCatalogIdentifier("testString") - getObjectAuditOptionsModel.SetObjectIdentifier("testString") - getObjectAuditOptionsModel.SetAuditlogIdentifier("testString") - getObjectAuditOptionsModel.SetLookupnames(true) - getObjectAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getObjectAuditOptionsModel).ToNot(BeNil()) - Expect(getObjectAuditOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAuditOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(getObjectAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke AddObjectAccessList successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the AddObjectAccessListOptions model + addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) + addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.Accesses = []string{"testString"} + addObjectAccessListOptionsModel.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 := catalogManagementService.AddObjectAccessListWithContext(ctx, addObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + 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 = catalogManagementService.AddObjectAccessListWithContext(ctx, addObjectAccessListOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) - It(`Invoke NewGetObjectOptions successfully`, func() { - // Construct an instance of the GetObjectOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - getObjectOptionsModel := catalogManagementService.NewGetObjectOptions(catalogIdentifier, objectIdentifier) - getObjectOptionsModel.SetCatalogIdentifier("testString") - getObjectOptionsModel.SetObjectIdentifier("testString") - getObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getObjectOptionsModel).ToNot(BeNil()) - Expect(getObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetOfferingAboutOptions successfully`, func() { - // Construct an instance of the GetOfferingAboutOptions model - versionLocID := "testString" - getOfferingAboutOptionsModel := catalogManagementService.NewGetOfferingAboutOptions(versionLocID) - getOfferingAboutOptionsModel.SetVersionLocID("testString") - getOfferingAboutOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingAboutOptionsModel).ToNot(BeNil()) - Expect(getOfferingAboutOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAboutOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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(addObjectAccessListPath)) + 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()) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(201) + fmt.Fprintf(res, "%s", `{"errors": {"mapKey": "Inner"}}`) + })) }) - It(`Invoke NewGetOfferingAccessListOptions successfully`, func() { - // Construct an instance of the GetOfferingAccessListOptions model - catalogIdentifier := "testString" - offeringID := "testString" - getOfferingAccessListOptionsModel := catalogManagementService.NewGetOfferingAccessListOptions(catalogIdentifier, offeringID) - getOfferingAccessListOptionsModel.SetCatalogIdentifier("testString") - getOfferingAccessListOptionsModel.SetOfferingID("testString") - getOfferingAccessListOptionsModel.SetStart("testString") - getOfferingAccessListOptionsModel.SetLimit(int64(10)) - getOfferingAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingAccessListOptionsModel).ToNot(BeNil()) - Expect(getOfferingAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAccessListOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAccessListOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAccessListOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getOfferingAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke AddObjectAccessList successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.AddObjectAccessList(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the AddObjectAccessListOptions model + addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) + addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.Accesses = []string{"testString"} + addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + }) - It(`Invoke NewGetOfferingAccessOptions successfully`, func() { - // Construct an instance of the GetOfferingAccessOptions model - catalogIdentifier := "testString" - offeringID := "testString" - accessIdentifier := "testString" - getOfferingAccessOptionsModel := catalogManagementService.NewGetOfferingAccessOptions(catalogIdentifier, offeringID, accessIdentifier) - getOfferingAccessOptionsModel.SetCatalogIdentifier("testString") - getOfferingAccessOptionsModel.SetOfferingID("testString") - getOfferingAccessOptionsModel.SetAccessIdentifier("testString") - getOfferingAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingAccessOptionsModel).ToNot(BeNil()) - Expect(getOfferingAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAccessOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke AddObjectAccessList with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the AddObjectAccessListOptions model + addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) + addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.Accesses = []string{"testString"} + addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + 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 AddObjectAccessListOptions model with no property values + addObjectAccessListOptionsModelNew := new(catalogmanagementv1.AddObjectAccessListOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewGetOfferingAuditOptions successfully`, func() { - // Construct an instance of the GetOfferingAuditOptions model - catalogIdentifier := "testString" - offeringID := "testString" - auditlogIdentifier := "testString" - getOfferingAuditOptionsModel := catalogManagementService.NewGetOfferingAuditOptions(catalogIdentifier, offeringID, auditlogIdentifier) - getOfferingAuditOptionsModel.SetCatalogIdentifier("testString") - getOfferingAuditOptionsModel.SetOfferingID("testString") - getOfferingAuditOptionsModel.SetAuditlogIdentifier("testString") - getOfferingAuditOptionsModel.SetLookupnames(true) - getOfferingAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingAuditOptionsModel).ToNot(BeNil()) - Expect(getOfferingAuditOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAuditOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(getOfferingAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetOfferingChangeNoticesOptions successfully`, func() { - // Construct an instance of the GetOfferingChangeNoticesOptions model - catalogIdentifier := "testString" - offeringID := "testString" - kind := "testString" - getOfferingChangeNoticesOptionsModel := catalogManagementService.NewGetOfferingChangeNoticesOptions(catalogIdentifier, offeringID, kind) - getOfferingChangeNoticesOptionsModel.SetCatalogIdentifier("testString") - getOfferingChangeNoticesOptionsModel.SetOfferingID("testString") - getOfferingChangeNoticesOptionsModel.SetKind("testString") - getOfferingChangeNoticesOptionsModel.SetTarget("testString") - getOfferingChangeNoticesOptionsModel.SetVersion("testString") - getOfferingChangeNoticesOptionsModel.SetFlavor("testString") - getOfferingChangeNoticesOptionsModel.SetVersions("latest") - getOfferingChangeNoticesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingChangeNoticesOptionsModel).ToNot(BeNil()) - Expect(getOfferingChangeNoticesOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingChangeNoticesOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingChangeNoticesOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingChangeNoticesOptionsModel.Target).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingChangeNoticesOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingChangeNoticesOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingChangeNoticesOptionsModel.Versions).To(Equal(core.StringPtr("latest"))) - Expect(getOfferingChangeNoticesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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(201) + })) }) - It(`Invoke NewGetOfferingContainerImagesOptions successfully`, func() { - // Construct an instance of the GetOfferingContainerImagesOptions model - versionLocID := "testString" - getOfferingContainerImagesOptionsModel := catalogManagementService.NewGetOfferingContainerImagesOptions(versionLocID) - getOfferingContainerImagesOptionsModel.SetVersionLocID("testString") - getOfferingContainerImagesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingContainerImagesOptionsModel).ToNot(BeNil()) - Expect(getOfferingContainerImagesOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingContainerImagesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke AddObjectAccessList successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the AddObjectAccessListOptions model + addObjectAccessListOptionsModel := new(catalogmanagementv1.AddObjectAccessListOptions) + addObjectAccessListOptionsModel.CatalogIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.ObjectIdentifier = core.StringPtr("testString") + addObjectAccessListOptionsModel.Accesses = []string{"testString"} + addObjectAccessListOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.AddObjectAccessList(addObjectAccessListOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) - It(`Invoke NewGetOfferingInstanceAuditOptions successfully`, func() { - // Construct an instance of the GetOfferingInstanceAuditOptions model - instanceIdentifier := "testString" - auditlogIdentifier := "testString" - getOfferingInstanceAuditOptionsModel := catalogManagementService.NewGetOfferingInstanceAuditOptions(instanceIdentifier, auditlogIdentifier) - getOfferingInstanceAuditOptionsModel.SetInstanceIdentifier("testString") - getOfferingInstanceAuditOptionsModel.SetAuditlogIdentifier("testString") - getOfferingInstanceAuditOptionsModel.SetLookupnames(true) - getOfferingInstanceAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingInstanceAuditOptionsModel).ToNot(BeNil()) - Expect(getOfferingInstanceAuditOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingInstanceAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingInstanceAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(getOfferingInstanceAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetOfferingInstanceOptions successfully`, func() { - // Construct an instance of the GetOfferingInstanceOptions model - instanceIdentifier := "testString" - getOfferingInstanceOptionsModel := catalogManagementService.NewGetOfferingInstanceOptions(instanceIdentifier) - getOfferingInstanceOptionsModel.SetInstanceIdentifier("testString") - getOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingInstanceOptionsModel).ToNot(BeNil()) - Expect(getOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`CreateOfferingInstance(createOfferingInstanceOptions *CreateOfferingInstanceOptions) - Operation response error`, func() { + createOfferingInstancePath := "/instances/offerings" + 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(createOfferingInstancePath)) + 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"))) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(201) + fmt.Fprint(res, `} this is not valid json {`) + })) }) - It(`Invoke NewGetOfferingLicenseOptions successfully`, func() { - // Construct an instance of the GetOfferingLicenseOptions model - versionLocID := "testString" - licenseID := "testString" - getOfferingLicenseOptionsModel := catalogManagementService.NewGetOfferingLicenseOptions(versionLocID, licenseID) - getOfferingLicenseOptionsModel.SetVersionLocID("testString") - getOfferingLicenseOptionsModel.SetLicenseID("testString") - getOfferingLicenseOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingLicenseOptionsModel).ToNot(BeNil()) - Expect(getOfferingLicenseOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingLicenseOptionsModel.LicenseID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingLicenseOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke CreateOfferingInstance with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the CreateOfferingInstanceOptions model + createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) + createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.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 := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewGetOfferingOptions successfully`, func() { - // Construct an instance of the GetOfferingOptions model - catalogIdentifier := "testString" - offeringID := "testString" - getOfferingOptionsModel := catalogManagementService.NewGetOfferingOptions(catalogIdentifier, offeringID) - getOfferingOptionsModel.SetCatalogIdentifier("testString") - getOfferingOptionsModel.SetOfferingID("testString") - getOfferingOptionsModel.SetType("testString") - getOfferingOptionsModel.SetDigest(true) - getOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingOptionsModel).ToNot(BeNil()) - Expect(getOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingOptionsModel.Type).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingOptionsModel.Digest).To(Equal(core.BoolPtr(true))) - Expect(getOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetOfferingSourceArchiveOptions successfully`, func() { - // Construct an instance of the GetOfferingSourceArchiveOptions model - version := "testString" - getOfferingSourceArchiveOptionsModel := catalogManagementService.NewGetOfferingSourceArchiveOptions(version) - getOfferingSourceArchiveOptionsModel.SetVersion("testString") - getOfferingSourceArchiveOptionsModel.SetAccept("application/yaml") - getOfferingSourceArchiveOptionsModel.SetCatalogID("testString") - getOfferingSourceArchiveOptionsModel.SetName("testString") - getOfferingSourceArchiveOptionsModel.SetID("testString") - getOfferingSourceArchiveOptionsModel.SetKind("testString") - getOfferingSourceArchiveOptionsModel.SetChannel("testString") - getOfferingSourceArchiveOptionsModel.SetFlavor("testString") - getOfferingSourceArchiveOptionsModel.SetAsIs(true) - getOfferingSourceArchiveOptionsModel.SetInstallType("testString") - getOfferingSourceArchiveOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingSourceArchiveOptionsModel).ToNot(BeNil()) - Expect(getOfferingSourceArchiveOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.Accept).To(Equal(core.StringPtr("application/yaml"))) - Expect(getOfferingSourceArchiveOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.AsIs).To(Equal(core.BoolPtr(true))) - Expect(getOfferingSourceArchiveOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceArchiveOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`CreateOfferingInstance(createOfferingInstanceOptions *CreateOfferingInstanceOptions)`, func() { + createOfferingInstancePath := "/instances/offerings" + 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(createOfferingInstancePath)) + 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "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", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + })) }) - It(`Invoke NewGetOfferingSourceOptions successfully`, func() { - // Construct an instance of the GetOfferingSourceOptions model - version := "testString" - getOfferingSourceOptionsModel := catalogManagementService.NewGetOfferingSourceOptions(version) - getOfferingSourceOptionsModel.SetVersion("testString") - getOfferingSourceOptionsModel.SetAccept("application/yaml") - getOfferingSourceOptionsModel.SetCatalogID("testString") - getOfferingSourceOptionsModel.SetName("testString") - getOfferingSourceOptionsModel.SetID("testString") - getOfferingSourceOptionsModel.SetKind("testString") - getOfferingSourceOptionsModel.SetChannel("testString") - getOfferingSourceOptionsModel.SetFlavor("testString") - getOfferingSourceOptionsModel.SetAsIs(true) - getOfferingSourceOptionsModel.SetInstallType("testString") - getOfferingSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingSourceOptionsModel).ToNot(BeNil()) - Expect(getOfferingSourceOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.Accept).To(Equal(core.StringPtr("application/yaml"))) - Expect(getOfferingSourceOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.AsIs).To(Equal(core.BoolPtr(true))) - Expect(getOfferingSourceOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke CreateOfferingInstance successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the CreateOfferingInstanceOptions model + createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) + createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.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 := catalogManagementService.CreateOfferingInstanceWithContext(ctx, createOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + 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 = catalogManagementService.CreateOfferingInstanceWithContext(ctx, createOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) - It(`Invoke NewGetOfferingSourceURLOptions successfully`, func() { - // Construct an instance of the GetOfferingSourceURLOptions model - keyIdentifier := "testString" - getOfferingSourceURLOptionsModel := catalogManagementService.NewGetOfferingSourceURLOptions(keyIdentifier) - getOfferingSourceURLOptionsModel.SetKeyIdentifier("testString") - getOfferingSourceURLOptionsModel.SetAccept("application/yaml") - getOfferingSourceURLOptionsModel.SetCatalogID("testString") - getOfferingSourceURLOptionsModel.SetName("testString") - getOfferingSourceURLOptionsModel.SetID("testString") - getOfferingSourceURLOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingSourceURLOptionsModel).ToNot(BeNil()) - Expect(getOfferingSourceURLOptionsModel.KeyIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceURLOptionsModel.Accept).To(Equal(core.StringPtr("application/yaml"))) - Expect(getOfferingSourceURLOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceURLOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceURLOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingSourceURLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetOfferingStatsOptions successfully`, func() { - // Construct an instance of the GetOfferingStatsOptions model - catalogIdentifier := "testString" - offeringID := "testString" - getOfferingStatsOptionsModel := catalogManagementService.NewGetOfferingStatsOptions(catalogIdentifier, offeringID) - getOfferingStatsOptionsModel.SetCatalogIdentifier("testString") - getOfferingStatsOptionsModel.SetOfferingID("testString") - getOfferingStatsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingStatsOptionsModel).ToNot(BeNil()) - Expect(getOfferingStatsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingStatsOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingStatsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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(createOfferingInstancePath)) + 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(201) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + })) }) - It(`Invoke NewGetOfferingUpdatesOptions successfully`, func() { - // Construct an instance of the GetOfferingUpdatesOptions model - catalogIdentifier := "testString" - offeringID := "testString" - kind := "testString" - xAuthRefreshToken := "testString" - getOfferingUpdatesOptionsModel := catalogManagementService.NewGetOfferingUpdatesOptions(catalogIdentifier, offeringID, kind, xAuthRefreshToken) - getOfferingUpdatesOptionsModel.SetCatalogIdentifier("testString") - getOfferingUpdatesOptionsModel.SetOfferingID("testString") - getOfferingUpdatesOptionsModel.SetKind("testString") - getOfferingUpdatesOptionsModel.SetXAuthRefreshToken("testString") - getOfferingUpdatesOptionsModel.SetTarget("testString") - getOfferingUpdatesOptionsModel.SetVersion("testString") - getOfferingUpdatesOptionsModel.SetClusterID("testString") - getOfferingUpdatesOptionsModel.SetRegion("testString") - getOfferingUpdatesOptionsModel.SetResourceGroupID("testString") - getOfferingUpdatesOptionsModel.SetNamespace("testString") - getOfferingUpdatesOptionsModel.SetSha("testString") - getOfferingUpdatesOptionsModel.SetChannel("testString") - getOfferingUpdatesOptionsModel.SetNamespaces([]string{"testString"}) - getOfferingUpdatesOptionsModel.SetAllNamespaces(true) - getOfferingUpdatesOptionsModel.SetFlavor("testString") - getOfferingUpdatesOptionsModel.SetInstallType("testString") - getOfferingUpdatesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingUpdatesOptionsModel).ToNot(BeNil()) - Expect(getOfferingUpdatesOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Target).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Namespaces).To(Equal([]string{"testString"})) - Expect(getOfferingUpdatesOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(getOfferingUpdatesOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingUpdatesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetOfferingWorkingCopyOptions successfully`, func() { - // Construct an instance of the GetOfferingWorkingCopyOptions model - versionLocID := "testString" - getOfferingWorkingCopyOptionsModel := catalogManagementService.NewGetOfferingWorkingCopyOptions(versionLocID) - getOfferingWorkingCopyOptionsModel.SetVersionLocID("testString") - getOfferingWorkingCopyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getOfferingWorkingCopyOptionsModel).ToNot(BeNil()) - Expect(getOfferingWorkingCopyOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getOfferingWorkingCopyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetPlanOptions successfully`, func() { - // Construct an instance of the GetPlanOptions model - planLocID := "testString" - getPlanOptionsModel := catalogManagementService.NewGetPlanOptions(planLocID) - getPlanOptionsModel.SetPlanLocID("testString") - getPlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getPlanOptionsModel).ToNot(BeNil()) - Expect(getPlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) - Expect(getPlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetPreinstallOptions successfully`, func() { - // Construct an instance of the GetPreinstallOptions model - versionLocID := "testString" - xAuthRefreshToken := "testString" - getPreinstallOptionsModel := catalogManagementService.NewGetPreinstallOptions(versionLocID, xAuthRefreshToken) - getPreinstallOptionsModel.SetVersionLocID("testString") - getPreinstallOptionsModel.SetXAuthRefreshToken("testString") - getPreinstallOptionsModel.SetClusterID("testString") - getPreinstallOptionsModel.SetRegion("testString") - getPreinstallOptionsModel.SetNamespace("testString") - getPreinstallOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getPreinstallOptionsModel).ToNot(BeNil()) - Expect(getPreinstallOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getPreinstallOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(getPreinstallOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(getPreinstallOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(getPreinstallOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) - Expect(getPreinstallOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewGetShareApprovalListAsSourceOptions successfully`, func() { - // Construct an instance of the GetShareApprovalListAsSourceOptions model - objectType := "offering" - approvalStateIdentifier := "approved" - getShareApprovalListAsSourceOptionsModel := catalogManagementService.NewGetShareApprovalListAsSourceOptions(objectType, approvalStateIdentifier) - getShareApprovalListAsSourceOptionsModel.SetObjectType("offering") - getShareApprovalListAsSourceOptionsModel.SetApprovalStateIdentifier("approved") - getShareApprovalListAsSourceOptionsModel.SetStart("testString") - getShareApprovalListAsSourceOptionsModel.SetLimit(int64(10)) - getShareApprovalListAsSourceOptionsModel.SetEnterpriseID("testString") - getShareApprovalListAsSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getShareApprovalListAsSourceOptionsModel).ToNot(BeNil()) - Expect(getShareApprovalListAsSourceOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) - Expect(getShareApprovalListAsSourceOptionsModel.ApprovalStateIdentifier).To(Equal(core.StringPtr("approved"))) - Expect(getShareApprovalListAsSourceOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(getShareApprovalListAsSourceOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getShareApprovalListAsSourceOptionsModel.EnterpriseID).To(Equal(core.StringPtr("testString"))) - Expect(getShareApprovalListAsSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke CreateOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.CreateOfferingInstance(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the CreateOfferingInstanceOptions model + createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) + createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + }) - It(`Invoke NewGetShareApprovalListOptions successfully`, func() { - // Construct an instance of the GetShareApprovalListOptions model - objectType := "offering" - getShareApprovalListOptionsModel := catalogManagementService.NewGetShareApprovalListOptions(objectType) - getShareApprovalListOptionsModel.SetObjectType("offering") - getShareApprovalListOptionsModel.SetStart("testString") - getShareApprovalListOptionsModel.SetLimit(int64(10)) - getShareApprovalListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getShareApprovalListOptionsModel).ToNot(BeNil()) - Expect(getShareApprovalListOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) - Expect(getShareApprovalListOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(getShareApprovalListOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(getShareApprovalListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke CreateOfferingInstance with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the CreateOfferingInstanceOptions model + createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) + createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + 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 CreateOfferingInstanceOptions model with no property values + createOfferingInstanceOptionsModelNew := new(catalogmanagementv1.CreateOfferingInstanceOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewGetValidationStatusOptions successfully`, func() { - // Construct an instance of the GetValidationStatusOptions model - versionLocID := "testString" - xAuthRefreshToken := "testString" - getValidationStatusOptionsModel := catalogManagementService.NewGetValidationStatusOptions(versionLocID, xAuthRefreshToken) - getValidationStatusOptionsModel.SetVersionLocID("testString") - getValidationStatusOptionsModel.SetXAuthRefreshToken("testString") - getValidationStatusOptionsModel.SetTargetContextName("testString") - getValidationStatusOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getValidationStatusOptionsModel).ToNot(BeNil()) - Expect(getValidationStatusOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getValidationStatusOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(getValidationStatusOptionsModel.TargetContextName).To(Equal(core.StringPtr("testString"))) - Expect(getValidationStatusOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewGetVersionOptions successfully`, func() { - // Construct an instance of the GetVersionOptions model - versionLocID := "testString" - getVersionOptionsModel := catalogManagementService.NewGetVersionOptions(versionLocID) - getVersionOptionsModel.SetVersionLocID("testString") - getVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(getVersionOptionsModel).ToNot(BeNil()) - Expect(getVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(getVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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(201) + })) }) - It(`Invoke NewImportOfferingOptions successfully`, func() { - // Construct an instance of the Flavor model - flavorModel := new(catalogmanagementv1.Flavor) - Expect(flavorModel).ToNot(BeNil()) - flavorModel.Name = core.StringPtr("testString") - flavorModel.Label = core.StringPtr("testString") - flavorModel.LabelI18n = map[string]string{"key1": "testString"} - flavorModel.Index = core.Int64Ptr(int64(38)) - Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + It(`Invoke CreateOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ImportOfferingBodyMetadataOperatingSystem model - importOfferingBodyMetadataOperatingSystemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataOperatingSystem) - Expect(importOfferingBodyMetadataOperatingSystemModel).ToNot(BeNil()) - importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly = core.BoolPtr(true) - importOfferingBodyMetadataOperatingSystemModel.Vendor = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Name = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Href = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.DisplayName = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Family = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Version = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Architecture = core.StringPtr("testString") - Expect(importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly).To(Equal(core.BoolPtr(true))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Vendor).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Href).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.DisplayName).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Family).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Architecture).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - // Construct an instance of the ImportOfferingBodyMetadataFile model - importOfferingBodyMetadataFileModel := new(catalogmanagementv1.ImportOfferingBodyMetadataFile) - Expect(importOfferingBodyMetadataFileModel).ToNot(BeNil()) - importOfferingBodyMetadataFileModel.Size = core.Int64Ptr(int64(38)) - Expect(importOfferingBodyMetadataFileModel.Size).To(Equal(core.Int64Ptr(int64(38)))) + // Construct an instance of the CreateOfferingInstanceOptions model + createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) + createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + createOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + createOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + createOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + createOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + createOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + createOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + createOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + createOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - // Construct an instance of the ImportOfferingBodyMetadataImagesItem model - importOfferingBodyMetadataImagesItemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataImagesItem) - Expect(importOfferingBodyMetadataImagesItemModel).ToNot(BeNil()) - importOfferingBodyMetadataImagesItemModel.ID = core.StringPtr("testString") - importOfferingBodyMetadataImagesItemModel.Name = core.StringPtr("testString") - importOfferingBodyMetadataImagesItemModel.Region = core.StringPtr("testString") - Expect(importOfferingBodyMetadataImagesItemModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataImagesItemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataImagesItemModel.Region).To(Equal(core.StringPtr("testString"))) + // Invoke operation + result, response, operationErr := catalogManagementService.CreateOfferingInstance(createOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) - // Construct an instance of the ImportOfferingBodyMetadata model - importOfferingBodyMetadataModel := new(catalogmanagementv1.ImportOfferingBodyMetadata) - Expect(importOfferingBodyMetadataModel).ToNot(BeNil()) - importOfferingBodyMetadataModel.OperatingSystem = importOfferingBodyMetadataOperatingSystemModel - importOfferingBodyMetadataModel.File = importOfferingBodyMetadataFileModel - importOfferingBodyMetadataModel.MinimumProvisionedSize = core.Int64Ptr(int64(38)) - importOfferingBodyMetadataModel.Images = []catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel} - Expect(importOfferingBodyMetadataModel.OperatingSystem).To(Equal(importOfferingBodyMetadataOperatingSystemModel)) - Expect(importOfferingBodyMetadataModel.File).To(Equal(importOfferingBodyMetadataFileModel)) - Expect(importOfferingBodyMetadataModel.MinimumProvisionedSize).To(Equal(core.Int64Ptr(int64(38)))) - Expect(importOfferingBodyMetadataModel.Images).To(Equal([]catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel})) + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetOfferingInstance(getOfferingInstanceOptions *GetOfferingInstanceOptions) - Operation response error`, func() { + getOfferingInstancePath := "/instances/offerings/testString" + 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() - // Construct an instance of the ImportOfferingOptions model - catalogIdentifier := "testString" - importOfferingOptionsModel := catalogManagementService.NewImportOfferingOptions(catalogIdentifier) - importOfferingOptionsModel.SetCatalogIdentifier("testString") - importOfferingOptionsModel.SetTags([]string{"testString"}) - importOfferingOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) - importOfferingOptionsModel.SetName("testString") - importOfferingOptionsModel.SetLabel("testString") - importOfferingOptionsModel.SetInstallKind("testString") - importOfferingOptionsModel.SetTargetKinds([]string{"testString"}) - importOfferingOptionsModel.SetFormatKind("testString") - importOfferingOptionsModel.SetProductKind("testString") - importOfferingOptionsModel.SetProductKindLabel("testString") - importOfferingOptionsModel.SetSha("testString") - importOfferingOptionsModel.SetVersion("testString") - importOfferingOptionsModel.SetFlavor(flavorModel) - importOfferingOptionsModel.SetMetadata(importOfferingBodyMetadataModel) - importOfferingOptionsModel.SetWorkingDirectory("testString") - importOfferingOptionsModel.SetInstallType("testString") - importOfferingOptionsModel.SetZipurl("testString") - importOfferingOptionsModel.SetOfferingID("testString") - importOfferingOptionsModel.SetTargetVersion("testString") - importOfferingOptionsModel.SetIncludeConfig(true) - importOfferingOptionsModel.SetIsVsi(true) - importOfferingOptionsModel.SetRepotype("testString") - importOfferingOptionsModel.SetXAuthToken("testString") - importOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(importOfferingOptionsModel).ToNot(BeNil()) - Expect(importOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(importOfferingOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) - Expect(importOfferingOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.InstallKind).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.TargetKinds).To(Equal([]string{"testString"})) - Expect(importOfferingOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.ProductKindLabel).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Flavor).To(Equal(flavorModel)) - Expect(importOfferingOptionsModel.Metadata).To(Equal(importOfferingBodyMetadataModel)) - Expect(importOfferingOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Zipurl).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.TargetVersion).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.IncludeConfig).To(Equal(core.BoolPtr(true))) - Expect(importOfferingOptionsModel.IsVsi).To(Equal(core.BoolPtr(true))) - Expect(importOfferingOptionsModel.Repotype).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.XAuthToken).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getOfferingInstancePath)) + Expect(req.Method).To(Equal("GET")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) }) - It(`Invoke NewImportOfferingVersionOptions successfully`, func() { - // Construct an instance of the Flavor model - flavorModel := new(catalogmanagementv1.Flavor) - Expect(flavorModel).ToNot(BeNil()) - flavorModel.Name = core.StringPtr("testString") - flavorModel.Label = core.StringPtr("testString") - flavorModel.LabelI18n = map[string]string{"key1": "testString"} - flavorModel.Index = core.Int64Ptr(int64(38)) - Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + It(`Invoke GetOfferingInstance with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the ImportOfferingBodyMetadataOperatingSystem model - importOfferingBodyMetadataOperatingSystemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataOperatingSystem) - Expect(importOfferingBodyMetadataOperatingSystemModel).ToNot(BeNil()) - importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly = core.BoolPtr(true) - importOfferingBodyMetadataOperatingSystemModel.Vendor = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Name = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Href = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.DisplayName = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Family = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Version = core.StringPtr("testString") - importOfferingBodyMetadataOperatingSystemModel.Architecture = core.StringPtr("testString") - Expect(importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly).To(Equal(core.BoolPtr(true))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Vendor).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Href).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.DisplayName).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Family).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataOperatingSystemModel.Architecture).To(Equal(core.StringPtr("testString"))) + // Construct an instance of the GetOfferingInstanceOptions model + getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) + getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceOptionsModel.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 := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) - // Construct an instance of the ImportOfferingBodyMetadataFile model - importOfferingBodyMetadataFileModel := new(catalogmanagementv1.ImportOfferingBodyMetadataFile) - Expect(importOfferingBodyMetadataFileModel).ToNot(BeNil()) - importOfferingBodyMetadataFileModel.Size = core.Int64Ptr(int64(38)) - Expect(importOfferingBodyMetadataFileModel.Size).To(Equal(core.Int64Ptr(int64(38)))) + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetOfferingInstance(getOfferingInstanceOptions *GetOfferingInstanceOptions)`, func() { + getOfferingInstancePath := "/instances/offerings/testString" + Context(`Using mock server endpoint with timeout`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the ImportOfferingBodyMetadataImagesItem model - importOfferingBodyMetadataImagesItemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataImagesItem) - Expect(importOfferingBodyMetadataImagesItemModel).ToNot(BeNil()) - importOfferingBodyMetadataImagesItemModel.ID = core.StringPtr("testString") - importOfferingBodyMetadataImagesItemModel.Name = core.StringPtr("testString") - importOfferingBodyMetadataImagesItemModel.Region = core.StringPtr("testString") - Expect(importOfferingBodyMetadataImagesItemModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataImagesItemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingBodyMetadataImagesItemModel.Region).To(Equal(core.StringPtr("testString"))) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getOfferingInstancePath)) + Expect(req.Method).To(Equal("GET")) - // Construct an instance of the ImportOfferingBodyMetadata model - importOfferingBodyMetadataModel := new(catalogmanagementv1.ImportOfferingBodyMetadata) - Expect(importOfferingBodyMetadataModel).ToNot(BeNil()) - importOfferingBodyMetadataModel.OperatingSystem = importOfferingBodyMetadataOperatingSystemModel - importOfferingBodyMetadataModel.File = importOfferingBodyMetadataFileModel - importOfferingBodyMetadataModel.MinimumProvisionedSize = core.Int64Ptr(int64(38)) - importOfferingBodyMetadataModel.Images = []catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel} - Expect(importOfferingBodyMetadataModel.OperatingSystem).To(Equal(importOfferingBodyMetadataOperatingSystemModel)) - Expect(importOfferingBodyMetadataModel.File).To(Equal(importOfferingBodyMetadataFileModel)) - Expect(importOfferingBodyMetadataModel.MinimumProvisionedSize).To(Equal(core.Int64Ptr(int64(38)))) - Expect(importOfferingBodyMetadataModel.Images).To(Equal([]catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel})) + // Sleep a short time to support a timeout test + time.Sleep(100 * time.Millisecond) - // Construct an instance of the ImportOfferingVersionOptions model - catalogIdentifier := "testString" - offeringID := "testString" - importOfferingVersionOptionsModel := catalogManagementService.NewImportOfferingVersionOptions(catalogIdentifier, offeringID) - importOfferingVersionOptionsModel.SetCatalogIdentifier("testString") - importOfferingVersionOptionsModel.SetOfferingID("testString") - importOfferingVersionOptionsModel.SetTags([]string{"testString"}) - importOfferingVersionOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) - importOfferingVersionOptionsModel.SetName("testString") - importOfferingVersionOptionsModel.SetLabel("testString") - importOfferingVersionOptionsModel.SetInstallKind("testString") - importOfferingVersionOptionsModel.SetTargetKinds([]string{"testString"}) - importOfferingVersionOptionsModel.SetFormatKind("testString") - importOfferingVersionOptionsModel.SetProductKind("testString") - importOfferingVersionOptionsModel.SetProductKindLabel("testString") - importOfferingVersionOptionsModel.SetSha("testString") - importOfferingVersionOptionsModel.SetVersion("testString") - importOfferingVersionOptionsModel.SetFlavor(flavorModel) - importOfferingVersionOptionsModel.SetMetadata(importOfferingBodyMetadataModel) - importOfferingVersionOptionsModel.SetWorkingDirectory("testString") - importOfferingVersionOptionsModel.SetInstallType("testString") - importOfferingVersionOptionsModel.SetZipurl("testString") - importOfferingVersionOptionsModel.SetTargetVersion("testString") - importOfferingVersionOptionsModel.SetIncludeConfig(true) - importOfferingVersionOptionsModel.SetIsVsi(true) - importOfferingVersionOptionsModel.SetRepotype("testString") - importOfferingVersionOptionsModel.SetXAuthToken("testString") - importOfferingVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(importOfferingVersionOptionsModel).ToNot(BeNil()) - Expect(importOfferingVersionOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(importOfferingVersionOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) - Expect(importOfferingVersionOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.InstallKind).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.TargetKinds).To(Equal([]string{"testString"})) - Expect(importOfferingVersionOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.ProductKindLabel).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Flavor).To(Equal(flavorModel)) - Expect(importOfferingVersionOptionsModel.Metadata).To(Equal(importOfferingBodyMetadataModel)) - Expect(importOfferingVersionOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Zipurl).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.TargetVersion).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.IncludeConfig).To(Equal(core.BoolPtr(true))) - Expect(importOfferingVersionOptionsModel.IsVsi).To(Equal(core.BoolPtr(true))) - Expect(importOfferingVersionOptionsModel.Repotype).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.XAuthToken).To(Equal(core.StringPtr("testString"))) - Expect(importOfferingVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + })) }) - It(`Invoke NewInstallVersionOptions successfully`, func() { - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - Expect(deployRequestBodyOverrideValuesModel).ToNot(BeNil()) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") - Expect(deployRequestBodyOverrideValuesModel.VsiInstanceName).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.VPCProfile).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.SubnetID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.VPCID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.SubnetZone).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.SSHKeyID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.VPCRegion).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.GetProperties()).ToNot(BeEmpty()) - Expect(deployRequestBodyOverrideValuesModel.GetProperty("foo")).To(Equal("testString")) + It(`Invoke GetOfferingInstance successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) - deployRequestBodyOverrideValuesModel.SetProperties(nil) - Expect(deployRequestBodyOverrideValuesModel.GetProperties()).To(BeEmpty()) + // Construct an instance of the GetOfferingInstanceOptions model + getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) + getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} - deployRequestBodyOverrideValuesModelExpectedMap := make(map[string]interface{}) - deployRequestBodyOverrideValuesModelExpectedMap["foo"] = "testString" - deployRequestBodyOverrideValuesModel.SetProperties(deployRequestBodyOverrideValuesModelExpectedMap) - deployRequestBodyOverrideValuesModelActualMap := deployRequestBodyOverrideValuesModel.GetProperties() - Expect(deployRequestBodyOverrideValuesModelActualMap).To(Equal(deployRequestBodyOverrideValuesModelExpectedMap)) + // Invoke operation with a Context to test a timeout error + ctx, cancelFunc := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc() + _, _, operationErr := catalogManagementService.GetOfferingInstanceWithContext(ctx, getOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - Expect(deployRequestBodyEnvironmentVariablesItemModel).ToNot(BeNil()) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Value).To(Equal("testString")) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Secure).To(Equal(core.BoolPtr(true))) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Hidden).To(Equal(core.BoolPtr(true))) + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - Expect(deployRequestBodySchematicsModel).ToNot(BeNil()) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") - Expect(deployRequestBodySchematicsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.Tags).To(Equal([]string{"testString"})) - Expect(deployRequestBodySchematicsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.TerraformVersion).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.Region).To(Equal(core.StringPtr("testString"))) + // Re-test the timeout error with retries disabled + ctx, cancelFunc2 := context.WithTimeout(context.Background(), 80*time.Millisecond) + defer cancelFunc2() + _, _, operationErr = catalogManagementService.GetOfferingInstanceWithContext(ctx, getOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - // Construct an instance of the InstallVersionOptions model - versionLocID := "testString" - xAuthRefreshToken := "testString" - installVersionOptionsModel := catalogManagementService.NewInstallVersionOptions(versionLocID, xAuthRefreshToken) - installVersionOptionsModel.SetVersionLocID("testString") - installVersionOptionsModel.SetXAuthRefreshToken("testString") - installVersionOptionsModel.SetClusterID("testString") - installVersionOptionsModel.SetRegion("testString") - installVersionOptionsModel.SetNamespace("testString") - installVersionOptionsModel.SetNamespaces([]string{"testString"}) - installVersionOptionsModel.SetAllNamespaces(true) - installVersionOptionsModel.SetOverrideValues(deployRequestBodyOverrideValuesModel) - installVersionOptionsModel.SetEnvironmentVariables([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel}) - installVersionOptionsModel.SetEntitlementApikey("testString") - installVersionOptionsModel.SetSchematics(deployRequestBodySchematicsModel) - installVersionOptionsModel.SetScript("testString") - installVersionOptionsModel.SetScriptID("testString") - installVersionOptionsModel.SetVersionLocatorID("testString") - installVersionOptionsModel.SetVcenterID("testString") - installVersionOptionsModel.SetVcenterLocation("testString") - installVersionOptionsModel.SetVcenterUser("testString") - installVersionOptionsModel.SetVcenterPassword("testString") - installVersionOptionsModel.SetVcenterDatastore("testString") - installVersionOptionsModel.SetPlanID("testString") - installVersionOptionsModel.SetChannel("testString") - installVersionOptionsModel.SetInstallPlan("testString") - installVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(installVersionOptionsModel).ToNot(BeNil()) - Expect(installVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.Namespaces).To(Equal([]string{"testString"})) - Expect(installVersionOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(installVersionOptionsModel.OverrideValues).To(Equal(deployRequestBodyOverrideValuesModel)) - Expect(installVersionOptionsModel.EnvironmentVariables).To(Equal([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel})) - Expect(installVersionOptionsModel.EntitlementApikey).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.Schematics).To(Equal(deployRequestBodySchematicsModel)) - Expect(installVersionOptionsModel.Script).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.ScriptID).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.VcenterID).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.VcenterLocation).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.VcenterUser).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.VcenterPassword).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.VcenterDatastore).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) - Expect(installVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(getOfferingInstancePath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + })) }) - It(`Invoke NewJSONPatchOperation successfully`, func() { - op := "add" - path := "testString" - _model, err := catalogManagementService.NewJSONPatchOperation(op, path) - Expect(_model).ToNot(BeNil()) + It(`Invoke GetOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetOfferingInstance(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the GetOfferingInstanceOptions model + getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) + getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke GetOfferingInstance with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetOfferingInstanceOptions model + getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) + getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + 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 GetOfferingInstanceOptions model with no property values + getOfferingInstanceOptionsModelNew := new(catalogmanagementv1.GetOfferingInstanceOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewListCatalogAccountAuditsOptions successfully`, func() { - // Construct an instance of the ListCatalogAccountAuditsOptions model - listCatalogAccountAuditsOptionsModel := catalogManagementService.NewListCatalogAccountAuditsOptions() - listCatalogAccountAuditsOptionsModel.SetStart("testString") - listCatalogAccountAuditsOptionsModel.SetLimit(int64(10)) - listCatalogAccountAuditsOptionsModel.SetLookupnames(true) - listCatalogAccountAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listCatalogAccountAuditsOptionsModel).ToNot(BeNil()) - Expect(listCatalogAccountAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(listCatalogAccountAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listCatalogAccountAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(listCatalogAccountAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewListCatalogAuditsOptions successfully`, func() { - // Construct an instance of the ListCatalogAuditsOptions model - catalogIdentifier := "testString" - listCatalogAuditsOptionsModel := catalogManagementService.NewListCatalogAuditsOptions(catalogIdentifier) - listCatalogAuditsOptionsModel.SetCatalogIdentifier("testString") - listCatalogAuditsOptionsModel.SetStart("testString") - listCatalogAuditsOptionsModel.SetLimit(int64(10)) - listCatalogAuditsOptionsModel.SetLookupnames(true) - listCatalogAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listCatalogAuditsOptionsModel).ToNot(BeNil()) - Expect(listCatalogAuditsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listCatalogAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(listCatalogAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listCatalogAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(listCatalogAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + 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 NewListCatalogsOptions successfully`, func() { - // Construct an instance of the ListCatalogsOptions model - listCatalogsOptionsModel := catalogManagementService.NewListCatalogsOptions() - listCatalogsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listCatalogsOptionsModel).ToNot(BeNil()) - Expect(listCatalogsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke GetOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetOfferingInstanceOptions model + getOfferingInstanceOptionsModel := new(catalogmanagementv1.GetOfferingInstanceOptions) + getOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) }) - It(`Invoke NewListEnterpriseAuditsOptions successfully`, func() { - // Construct an instance of the ListEnterpriseAuditsOptions model - enterpriseIdentifier := "testString" - listEnterpriseAuditsOptionsModel := catalogManagementService.NewListEnterpriseAuditsOptions(enterpriseIdentifier) - listEnterpriseAuditsOptionsModel.SetEnterpriseIdentifier("testString") - listEnterpriseAuditsOptionsModel.SetStart("testString") - listEnterpriseAuditsOptionsModel.SetLimit(int64(10)) - listEnterpriseAuditsOptionsModel.SetLookupnames(true) - listEnterpriseAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listEnterpriseAuditsOptionsModel).ToNot(BeNil()) - Expect(listEnterpriseAuditsOptionsModel.EnterpriseIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listEnterpriseAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(listEnterpriseAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listEnterpriseAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(listEnterpriseAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewListObjectAuditsOptions successfully`, func() { - // Construct an instance of the ListObjectAuditsOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - listObjectAuditsOptionsModel := catalogManagementService.NewListObjectAuditsOptions(catalogIdentifier, objectIdentifier) - listObjectAuditsOptionsModel.SetCatalogIdentifier("testString") - listObjectAuditsOptionsModel.SetObjectIdentifier("testString") - listObjectAuditsOptionsModel.SetStart("testString") - listObjectAuditsOptionsModel.SetLimit(int64(10)) - listObjectAuditsOptionsModel.SetLookupnames(true) - listObjectAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listObjectAuditsOptionsModel).ToNot(BeNil()) - Expect(listObjectAuditsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listObjectAuditsOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listObjectAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(listObjectAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listObjectAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(listObjectAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`PutOfferingInstance(putOfferingInstanceOptions *PutOfferingInstanceOptions) - Operation response error`, func() { + putOfferingInstancePath := "/instances/offerings/testString" + 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(putOfferingInstancePath)) + Expect(req.Method).To(Equal("PUT")) + Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) }) - It(`Invoke NewListObjectsOptions successfully`, func() { - // Construct an instance of the ListObjectsOptions model - catalogIdentifier := "testString" - listObjectsOptionsModel := catalogManagementService.NewListObjectsOptions(catalogIdentifier) - listObjectsOptionsModel.SetCatalogIdentifier("testString") - listObjectsOptionsModel.SetLimit(int64(10)) - listObjectsOptionsModel.SetOffset(int64(0)) - listObjectsOptionsModel.SetName("testString") - listObjectsOptionsModel.SetSort("testString") - listObjectsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listObjectsOptionsModel).ToNot(BeNil()) - Expect(listObjectsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listObjectsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listObjectsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) - Expect(listObjectsOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(listObjectsOptionsModel.Sort).To(Equal(core.StringPtr("testString"))) - Expect(listObjectsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke PutOfferingInstance with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the PutOfferingInstanceOptions model + putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) + putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.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 := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) }) - It(`Invoke NewListOfferingAuditsOptions successfully`, func() { - // Construct an instance of the ListOfferingAuditsOptions model - catalogIdentifier := "testString" - offeringID := "testString" - listOfferingAuditsOptionsModel := catalogManagementService.NewListOfferingAuditsOptions(catalogIdentifier, offeringID) - listOfferingAuditsOptionsModel.SetCatalogIdentifier("testString") - listOfferingAuditsOptionsModel.SetOfferingID("testString") - listOfferingAuditsOptionsModel.SetStart("testString") - listOfferingAuditsOptionsModel.SetLimit(int64(10)) - listOfferingAuditsOptionsModel.SetLookupnames(true) - listOfferingAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listOfferingAuditsOptionsModel).ToNot(BeNil()) - Expect(listOfferingAuditsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingAuditsOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listOfferingAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(listOfferingAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewListOfferingInstanceAuditsOptions successfully`, func() { - // Construct an instance of the ListOfferingInstanceAuditsOptions model - instanceIdentifier := "testString" - listOfferingInstanceAuditsOptionsModel := catalogManagementService.NewListOfferingInstanceAuditsOptions(instanceIdentifier) - listOfferingInstanceAuditsOptionsModel.SetInstanceIdentifier("testString") - listOfferingInstanceAuditsOptionsModel.SetStart("testString") - listOfferingInstanceAuditsOptionsModel.SetLimit(int64(10)) - listOfferingInstanceAuditsOptionsModel.SetLookupnames(true) - listOfferingInstanceAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listOfferingInstanceAuditsOptionsModel).ToNot(BeNil()) - Expect(listOfferingInstanceAuditsOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingInstanceAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingInstanceAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listOfferingInstanceAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) - Expect(listOfferingInstanceAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + }) + Describe(`PutOfferingInstance(putOfferingInstanceOptions *PutOfferingInstanceOptions)`, func() { + putOfferingInstancePath := "/instances/offerings/testString" + 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(putOfferingInstancePath)) + Expect(req.Method).To(Equal("PUT")) + + // 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.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "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(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + })) }) - It(`Invoke NewListOfferingsOptions successfully`, func() { - // Construct an instance of the ListOfferingsOptions model - catalogIdentifier := "testString" - listOfferingsOptionsModel := catalogManagementService.NewListOfferingsOptions(catalogIdentifier) - listOfferingsOptionsModel.SetCatalogIdentifier("testString") - listOfferingsOptionsModel.SetDigest(true) - listOfferingsOptionsModel.SetLimit(int64(10)) - listOfferingsOptionsModel.SetOffset(int64(0)) - listOfferingsOptionsModel.SetName("testString") - listOfferingsOptionsModel.SetSort("testString") - listOfferingsOptionsModel.SetIncludeHidden(true) - listOfferingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listOfferingsOptionsModel).ToNot(BeNil()) - Expect(listOfferingsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) - Expect(listOfferingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(listOfferingsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) - Expect(listOfferingsOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingsOptionsModel.Sort).To(Equal(core.StringPtr("testString"))) - Expect(listOfferingsOptionsModel.IncludeHidden).To(Equal(core.BoolPtr(true))) - Expect(listOfferingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke PutOfferingInstance successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the PutOfferingInstanceOptions model + putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) + putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.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 := catalogManagementService.PutOfferingInstanceWithContext(ctx, putOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + 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 = catalogManagementService.PutOfferingInstanceWithContext(ctx, putOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) }) - It(`Invoke NewListOperatorsOptions successfully`, func() { - // Construct an instance of the ListOperatorsOptions model - xAuthRefreshToken := "testString" - clusterID := "testString" - region := "testString" - versionLocatorID := "testString" - listOperatorsOptionsModel := catalogManagementService.NewListOperatorsOptions(xAuthRefreshToken, clusterID, region, versionLocatorID) - listOperatorsOptionsModel.SetXAuthRefreshToken("testString") - listOperatorsOptionsModel.SetClusterID("testString") - listOperatorsOptionsModel.SetRegion("testString") - listOperatorsOptionsModel.SetVersionLocatorID("testString") - listOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(listOperatorsOptionsModel).ToNot(BeNil()) - Expect(listOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(listOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(listOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(listOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) - Expect(listOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + AfterEach(func() { + testServer.Close() }) - It(`Invoke NewPreinstallVersionOptions successfully`, func() { - // Construct an instance of the DeployRequestBodyOverrideValues model - deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) - Expect(deployRequestBodyOverrideValuesModel).ToNot(BeNil()) - deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") - deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") - Expect(deployRequestBodyOverrideValuesModel.VsiInstanceName).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.VPCProfile).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.SubnetID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.VPCID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.SubnetZone).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.SSHKeyID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.VPCRegion).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyOverrideValuesModel.GetProperties()).ToNot(BeEmpty()) - Expect(deployRequestBodyOverrideValuesModel.GetProperty("foo")).To(Equal("testString")) + }) + Context(`Using mock server endpoint`, func() { + BeforeEach(func() { + testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + defer GinkgoRecover() - deployRequestBodyOverrideValuesModel.SetProperties(nil) - Expect(deployRequestBodyOverrideValuesModel.GetProperties()).To(BeEmpty()) + // Verify the contents of the request + Expect(req.URL.EscapedPath()).To(Equal(putOfferingInstancePath)) + Expect(req.Method).To(Equal("PUT")) - deployRequestBodyOverrideValuesModelExpectedMap := make(map[string]interface{}) - deployRequestBodyOverrideValuesModelExpectedMap["foo"] = "testString" - deployRequestBodyOverrideValuesModel.SetProperties(deployRequestBodyOverrideValuesModelExpectedMap) - deployRequestBodyOverrideValuesModelActualMap := deployRequestBodyOverrideValuesModel.GetProperties() - Expect(deployRequestBodyOverrideValuesModelActualMap).To(Equal(deployRequestBodyOverrideValuesModelExpectedMap)) + // For gzip-disabled operation, verify Content-Encoding is not set. + Expect(req.Header.Get("Content-Encoding")).To(BeEmpty()) - // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model - deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) - Expect(deployRequestBodyEnvironmentVariablesItemModel).ToNot(BeNil()) - deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") - deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" - deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) - deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Value).To(Equal("testString")) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Secure).To(Equal(core.BoolPtr(true))) - Expect(deployRequestBodyEnvironmentVariablesItemModel.Hidden).To(Equal(core.BoolPtr(true))) + // 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()) - // Construct an instance of the DeployRequestBodySchematics model - deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) - Expect(deployRequestBodySchematicsModel).ToNot(BeNil()) - deployRequestBodySchematicsModel.Name = core.StringPtr("testString") - deployRequestBodySchematicsModel.Description = core.StringPtr("testString") - deployRequestBodySchematicsModel.Tags = []string{"testString"} - deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") - deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") - deployRequestBodySchematicsModel.Region = core.StringPtr("testString") - Expect(deployRequestBodySchematicsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.Tags).To(Equal([]string{"testString"})) - Expect(deployRequestBodySchematicsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.TerraformVersion).To(Equal(core.StringPtr("testString"))) - Expect(deployRequestBodySchematicsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "kind_format_label": "KindFormatLabel", "version": "Version", "version_id": "VersionID", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "install_plan": "InstallPlan", "channel": "Channel", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "metadata": {"anyKey": "anyValue"}, "resource_group_id": "ResourceGroupID", "location": "Location", "disabled": true, "account": "Account", "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "2019-01-01T12:00:00.000Z", "code": "Code"}, "kind_target": "KindTarget", "kind_target_label": "KindTargetLabel", "sha": "Sha", "plan_id": "PlanID", "parent_crn": "ParentCRN"}`) + })) + }) + It(`Invoke PutOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) - // Construct an instance of the PreinstallVersionOptions model - versionLocID := "testString" - xAuthRefreshToken := "testString" - preinstallVersionOptionsModel := catalogManagementService.NewPreinstallVersionOptions(versionLocID, xAuthRefreshToken) - preinstallVersionOptionsModel.SetVersionLocID("testString") - preinstallVersionOptionsModel.SetXAuthRefreshToken("testString") - preinstallVersionOptionsModel.SetClusterID("testString") - preinstallVersionOptionsModel.SetRegion("testString") - preinstallVersionOptionsModel.SetNamespace("testString") - preinstallVersionOptionsModel.SetNamespaces([]string{"testString"}) - preinstallVersionOptionsModel.SetAllNamespaces(true) - preinstallVersionOptionsModel.SetOverrideValues(deployRequestBodyOverrideValuesModel) - preinstallVersionOptionsModel.SetEnvironmentVariables([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel}) - preinstallVersionOptionsModel.SetEntitlementApikey("testString") - preinstallVersionOptionsModel.SetSchematics(deployRequestBodySchematicsModel) - preinstallVersionOptionsModel.SetScript("testString") - preinstallVersionOptionsModel.SetScriptID("testString") - preinstallVersionOptionsModel.SetVersionLocatorID("testString") - preinstallVersionOptionsModel.SetVcenterID("testString") - preinstallVersionOptionsModel.SetVcenterLocation("testString") - preinstallVersionOptionsModel.SetVcenterUser("testString") - preinstallVersionOptionsModel.SetVcenterPassword("testString") - preinstallVersionOptionsModel.SetVcenterDatastore("testString") - preinstallVersionOptionsModel.SetPlanID("testString") - preinstallVersionOptionsModel.SetChannel("testString") - preinstallVersionOptionsModel.SetInstallPlan("testString") - preinstallVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(preinstallVersionOptionsModel).ToNot(BeNil()) - Expect(preinstallVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.Namespaces).To(Equal([]string{"testString"})) - Expect(preinstallVersionOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(preinstallVersionOptionsModel.OverrideValues).To(Equal(deployRequestBodyOverrideValuesModel)) - Expect(preinstallVersionOptionsModel.EnvironmentVariables).To(Equal([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel})) - Expect(preinstallVersionOptionsModel.EntitlementApikey).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.Schematics).To(Equal(deployRequestBodySchematicsModel)) - Expect(preinstallVersionOptionsModel.Script).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.ScriptID).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.VcenterID).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.VcenterLocation).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.VcenterUser).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.VcenterPassword).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.VcenterDatastore).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) - Expect(preinstallVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.PutOfferingInstance(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the PutOfferingInstanceOptions model + putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) + putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke PutOfferingInstance with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the PutOfferingInstanceOptions model + putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) + putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + 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 PutOfferingInstanceOptions model with no property values + putOfferingInstanceOptionsModelNew := new(catalogmanagementv1.PutOfferingInstanceOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModelNew) + 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 PutOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + + // Construct an instance of the PutOfferingInstanceOptions model + putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) + putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + putOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Rev = core.StringPtr("testString") + putOfferingInstanceOptionsModel.URL = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Label = core.StringPtr("testString") + putOfferingInstanceOptionsModel.CatalogID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.OfferingID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormat = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindFormatLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Version = core.StringPtr("testString") + putOfferingInstanceOptionsModel.VersionID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterRegion = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ClusterNamespaces = []string{"testString"} + putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) + putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + putOfferingInstanceOptionsModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Location = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Disabled = core.BoolPtr(true) + putOfferingInstanceOptionsModel.Account = core.StringPtr("testString") + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel + putOfferingInstanceOptionsModel.KindTarget = core.StringPtr("testString") + putOfferingInstanceOptionsModel.KindTargetLabel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Sha = core.StringPtr("testString") + putOfferingInstanceOptionsModel.PlanID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.ParentCRN = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.PutOfferingInstance(putOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`DeleteOfferingInstance(deleteOfferingInstanceOptions *DeleteOfferingInstanceOptions)`, func() { + deleteOfferingInstancePath := "/instances/offerings/testString" + 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(deleteOfferingInstancePath)) + Expect(req.Method).To(Equal("DELETE")) + + Expect(req.Header["X-Auth-Refresh-Token"]).ToNot(BeNil()) + Expect(req.Header["X-Auth-Refresh-Token"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) + res.WriteHeader(200) + })) + }) + It(`Invoke DeleteOfferingInstance successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeleteOfferingInstance(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the DeleteOfferingInstanceOptions model + deleteOfferingInstanceOptionsModel := new(catalogmanagementv1.DeleteOfferingInstanceOptions) + deleteOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + deleteOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deleteOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeleteOfferingInstance(deleteOfferingInstanceOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke DeleteOfferingInstance with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeleteOfferingInstanceOptions model + deleteOfferingInstanceOptionsModel := new(catalogmanagementv1.DeleteOfferingInstanceOptions) + deleteOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") + deleteOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") + deleteOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.DeleteOfferingInstance(deleteOfferingInstanceOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeleteOfferingInstanceOptions model with no property values + deleteOfferingInstanceOptionsModelNew := new(catalogmanagementv1.DeleteOfferingInstanceOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeleteOfferingInstance(deleteOfferingInstanceOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`ListOfferingInstanceAudits(listOfferingInstanceAuditsOptions *ListOfferingInstanceAuditsOptions) - Operation response error`, func() { + listOfferingInstanceAuditsPath := "/instances/offerings/testString/audits" + 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(listOfferingInstanceAuditsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // TODO: Add check for lookupnames query parameter + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke ListOfferingInstanceAudits with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ListOfferingInstanceAuditsOptions model + listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listOfferingInstanceAuditsOptionsModel.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 := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`ListOfferingInstanceAudits(listOfferingInstanceAuditsOptions *ListOfferingInstanceAuditsOptions)`, func() { + listOfferingInstanceAuditsPath := "/instances/offerings/testString/audits" + 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(listOfferingInstanceAuditsPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // TODO: Add check for lookupnames 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", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) + })) + }) + It(`Invoke ListOfferingInstanceAudits successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the ListOfferingInstanceAuditsOptions model + listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listOfferingInstanceAuditsOptionsModel.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 := catalogManagementService.ListOfferingInstanceAuditsWithContext(ctx, listOfferingInstanceAuditsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + 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 = catalogManagementService.ListOfferingInstanceAuditsWithContext(ctx, listOfferingInstanceAuditsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + 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(listOfferingInstanceAuditsPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.URL.Query()["start"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) + // TODO: Add check for lookupnames query parameter + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"start": "Start", "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}, "prev": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "audits": [{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message"}]}`) + })) + }) + It(`Invoke ListOfferingInstanceAudits successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the ListOfferingInstanceAuditsOptions model + listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke ListOfferingInstanceAudits with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ListOfferingInstanceAuditsOptions model + listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + 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 ListOfferingInstanceAuditsOptions model with no property values + listOfferingInstanceAuditsOptionsModelNew := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModelNew) + 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 ListOfferingInstanceAudits successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ListOfferingInstanceAuditsOptions model + listOfferingInstanceAuditsOptionsModel := new(catalogmanagementv1.ListOfferingInstanceAuditsOptions) + listOfferingInstanceAuditsOptionsModel.InstanceIdentifier = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Start = core.StringPtr("testString") + listOfferingInstanceAuditsOptionsModel.Limit = core.Int64Ptr(int64(10)) + listOfferingInstanceAuditsOptionsModel.Lookupnames = core.BoolPtr(true) + listOfferingInstanceAuditsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.ListOfferingInstanceAudits(listOfferingInstanceAuditsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + Context(`Test pagination helper method on response`, func() { + It(`Invoke GetNextStart successfully`, func() { + responseObject := new(catalogmanagementv1.AuditLogs) + nextObject := new(catalogmanagementv1.PaginationTokenLink) + 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(catalogmanagementv1.AuditLogs) + + value, err := responseObject.GetNextStart() + Expect(err).To(BeNil()) + Expect(value).To(BeNil()) + }) + }) + Context(`Using mock server endpoint - paginated response`, func() { + BeforeEach(func() { + var requestNumber int = 0 + 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(listOfferingInstanceAuditsPath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + requestNumber++ + if requestNumber == 1 { + fmt.Fprintf(res, "%s", `{"next":{"start":"1"},"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) + } else if requestNumber == 2 { + fmt.Fprintf(res, "%s", `{"total_count":2,"limit":1,"audits":[{"id":"ID","_rev":"Rev","created":"2019-01-01T12:00:00.000Z","change_type":"ChangeType","target_type":"TargetType","target_id":"TargetID","who_email":"WhoEmail","who_delegate_email":"WhoDelegateEmail","message":"Message"}]}`) + } else { + res.WriteHeader(400) + } + })) + }) + It(`Use OfferingInstanceAuditsPager.GetNext successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + listOfferingInstanceAuditsOptionsModel := &catalogmanagementv1.ListOfferingInstanceAuditsOptions{ + InstanceIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Lookupnames: core.BoolPtr(true), + } + + pager, err := catalogManagementService.NewOfferingInstanceAuditsPager(listOfferingInstanceAuditsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + var allResults []catalogmanagementv1.AuditLogDigest + for pager.HasNext() { + nextPage, err := pager.GetNext() + Expect(err).To(BeNil()) + Expect(nextPage).ToNot(BeNil()) + allResults = append(allResults, nextPage...) + } + Expect(len(allResults)).To(Equal(2)) + }) + It(`Use OfferingInstanceAuditsPager.GetAll successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + listOfferingInstanceAuditsOptionsModel := &catalogmanagementv1.ListOfferingInstanceAuditsOptions{ + InstanceIdentifier: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + Lookupnames: core.BoolPtr(true), + } + + pager, err := catalogManagementService.NewOfferingInstanceAuditsPager(listOfferingInstanceAuditsOptionsModel) + Expect(err).To(BeNil()) + Expect(pager).ToNot(BeNil()) + + allResults, err := pager.GetAll() + Expect(err).To(BeNil()) + Expect(allResults).ToNot(BeNil()) + Expect(len(allResults)).To(Equal(2)) + }) + }) + }) + Describe(`GetOfferingInstanceAudit(getOfferingInstanceAuditOptions *GetOfferingInstanceAuditOptions) - Operation response error`, func() { + getOfferingInstanceAuditPath := "/instances/offerings/testString/audits/testString" + 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(getOfferingInstanceAuditPath)) + Expect(req.Method).To(Equal("GET")) + // TODO: Add check for lookupnames query parameter + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetOfferingInstanceAudit with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetOfferingInstanceAuditOptions model + getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getOfferingInstanceAuditOptionsModel.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 := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetOfferingInstanceAudit(getOfferingInstanceAuditOptions *GetOfferingInstanceAuditOptions)`, func() { + getOfferingInstanceAuditPath := "/instances/offerings/testString/audits/testString" + 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(getOfferingInstanceAuditPath)) + Expect(req.Method).To(Equal("GET")) + + // TODO: Add check for lookupnames 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", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) + })) + }) + It(`Invoke GetOfferingInstanceAudit successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the GetOfferingInstanceAuditOptions model + getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getOfferingInstanceAuditOptionsModel.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 := catalogManagementService.GetOfferingInstanceAuditWithContext(ctx, getOfferingInstanceAuditOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + 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 = catalogManagementService.GetOfferingInstanceAuditWithContext(ctx, getOfferingInstanceAuditOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + 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(getOfferingInstanceAuditPath)) + Expect(req.Method).To(Equal("GET")) + + // TODO: Add check for lookupnames query parameter + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "created": "2019-01-01T12:00:00.000Z", "change_type": "ChangeType", "target_type": "TargetType", "target_id": "TargetID", "who_email": "WhoEmail", "who_delegate_email": "WhoDelegateEmail", "message": "Message", "gid": "Gid", "who_id": "WhoID", "who_name": "WhoName", "who_delegate_id": "WhoDelegateID", "who_delegate_name": "WhoDelegateName", "data": "anyValue"}`) + })) + }) + It(`Invoke GetOfferingInstanceAudit successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the GetOfferingInstanceAuditOptions model + getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke GetOfferingInstanceAudit with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetOfferingInstanceAuditOptions model + getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + 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 GetOfferingInstanceAuditOptions model with no property values + getOfferingInstanceAuditOptionsModelNew := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModelNew) + 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 GetOfferingInstanceAudit successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetOfferingInstanceAuditOptions model + getOfferingInstanceAuditOptionsModel := new(catalogmanagementv1.GetOfferingInstanceAuditOptions) + getOfferingInstanceAuditOptionsModel.InstanceIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.AuditlogIdentifier = core.StringPtr("testString") + getOfferingInstanceAuditOptionsModel.Lookupnames = core.BoolPtr(true) + getOfferingInstanceAuditOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.GetOfferingInstanceAudit(getOfferingInstanceAuditOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetPlan(getPlanOptions *GetPlanOptions) - Operation response error`, func() { + getPlanPath := "/plans/testString" + 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(getPlanPath)) + Expect(req.Method).To(Equal("GET")) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke GetPlan with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetPlanOptions model + getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) + getPlanOptionsModel.PlanLocID = core.StringPtr("testString") + getPlanOptionsModel.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 := catalogManagementService.GetPlan(getPlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.GetPlan(getPlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`GetPlan(getPlanOptions *GetPlanOptions)`, func() { + getPlanPath := "/plans/testString" + 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(getPlanPath)) + Expect(req.Method).To(Equal("GET")) + + // 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", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + })) + }) + It(`Invoke GetPlan successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the GetPlanOptions model + getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) + getPlanOptionsModel.PlanLocID = core.StringPtr("testString") + getPlanOptionsModel.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 := catalogManagementService.GetPlanWithContext(ctx, getPlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.GetPlan(getPlanOptionsModel) + 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 = catalogManagementService.GetPlanWithContext(ctx, getPlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + 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(getPlanPath)) + Expect(req.Method).To(Equal("GET")) + + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "offering_icon_url": "OfferingIconURL", "offering_docs_url": "OfferingDocsURL", "offering_support_url": "OfferingSupportURL", "tags": ["Tags"], "keywords": ["Keywords"], "rating": {"one_star_count": 12, "two_star_count": 12, "three_star_count": 14, "four_star_count": 13}, "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "kinds": [{"id": "ID", "format_kind": "FormatKind", "format_kind_label": "FormatKindLabel", "install_kind": "InstallKind", "install_kind_label": "InstallKindLabel", "target_kind": "TargetKind", "target_kind_label": "TargetKindLabel", "metadata": {"anyKey": "anyValue"}, "tags": ["Tags"], "additional_features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "versions": [{"id": "ID", "_rev": "Rev", "crn": "CRN", "version": "Version", "flavor": {"name": "Name", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "index": 5}, "sha": "Sha", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "kind_id": "KindID", "tags": ["Tags"], "repo_url": "RepoURL", "source_url": "SourceURL", "tgz_url": "TgzURL", "configuration": [{"key": "Key", "type": "Type", "default_value": "anyValue", "display_name": "DisplayName", "value_constraint": "ValueConstraint", "description": "Description", "required": true, "options": ["anyValue"], "hidden": true, "custom_config": {"type": "Type", "grouping": "Grouping", "original_grouping": "OriginalGrouping", "grouping_index": 13, "config_constraints": {"anyKey": "anyValue"}, "associations": {"parameters": [{"name": "Name", "optionsRefresh": true}]}}, "type_metadata": "TypeMetadata"}], "outputs": [{"key": "Key", "description": "Description"}], "iam_permissions": [{"service_name": "ServiceName", "role_crns": ["RoleCrns"], "resources": [{"name": "Name", "description": "Description", "role_crns": ["RoleCrns"]}]}], "metadata": {"anyKey": "anyValue"}, "validation": {"validated": "2019-01-01T12:00:00.000Z", "requested": "2019-01-01T12:00:00.000Z", "state": "State", "last_operation": "LastOperation", "target": {"anyKey": "anyValue"}, "message": "Message"}, "required_resources": [{"type": "mem", "value": "anyValue"}], "single_instance": true, "schematics_env_values": {"value": "[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]", "sm_ref": "cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"}, "install": {"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}, "pre_install": [{"instructions": "Instructions", "instructions_i18n": {"mapKey": "Inner"}, "script": "Script", "script_permission": "ScriptPermission", "delete_script": "DeleteScript", "scope": "Scope"}], "scripts": {"mapKey": {"short_description": "ShortDescription", "type": "ansible", "path": "scripts/validate-post-ansible-playbook.yaml", "stage": "pre", "action": "validate"}}, "entitlement": {"provider_name": "ProviderName", "provider_id": "ProviderID", "product_id": "ProductID", "part_numbers": ["PartNumbers"], "image_repo_name": "ImageRepoName"}, "licenses": [{"id": "ID", "name": "Name", "type": "Type", "url": "URL", "description": "Description"}], "image_manifest_url": "ImageManifestURL", "deprecated": true, "package_version": "PackageVersion", "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "version_locator": "VersionLocator", "long_description": "LongDescription", "long_description_i18n": {"mapKey": "Inner"}, "whitelisted_accounts": ["WhitelistedAccounts"], "image_pull_key_name": "ImagePullKeyName", "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "solution_info": {"architecture_diagrams": [{"diagram": {"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "cost_estimate": {"version": "Version", "currency": "Currency", "projects": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "pastBreakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "breakdown": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "diff": {"totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "resources": [{"name": "Name", "metadata": {"anyKey": "anyValue"}, "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost", "costComponents": [{"name": "Name", "unit": "Unit", "hourlyQuantity": "HourlyQuantity", "monthlyQuantity": "MonthlyQuantity", "price": "Price", "hourlyCost": "HourlyCost", "monthlyCost": "MonthlyCost"}]}]}, "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}}], "summary": {"totalDetectedResources": 22, "totalSupportedResources": 23, "totalUnsupportedResources": 25, "totalUsageBasedResources": 24, "totalNoPriceResources": 21, "unsupportedResourceCounts": {"mapKey": 5}, "noPriceResourceCounts": {"mapKey": 5}}, "totalHourlyCost": "TotalHourlyCost", "totalMonthlyCost": "TotalMonthlyCost", "pastTotalHourlyCost": "PastTotalHourlyCost", "pastTotalMonthlyCost": "PastTotalMonthlyCost", "diffTotalHourlyCost": "DiffTotalHourlyCost", "diffTotalMonthlyCost": "DiffTotalMonthlyCost", "timeGenerated": "2019-01-01T12:00:00.000Z"}, "dependencies": [{"catalog_id": "CatalogID", "id": "ID", "name": "Name", "kind": "Kind", "version": "Version", "flavors": ["Flavors"]}], "install_type": "InstallType"}, "is_consumable": true, "compliance_v3": {"authority": "Authority", "claims": {"profiles": [{"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}], "controls": [{"profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "names": ["Names"]}]}, "evaluations": [{"scan_id": "ScanID", "account_id": "AccountID", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "result": {"failure_count": 12, "scan_time": "2019-01-01T12:00:00.000Z", "error_message": "ErrorMessage", "complete_scan": true, "unscanned_resources": ["UnscannedResources"]}, "controls": [{"id": "ID", "name": "Name", "description": "Description", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "failure_count": 12, "pass_count": 9, "parent": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "profile": {"id": "ID", "name": "Name", "version": "Version", "description": "Description", "type": "Type", "ui_href": "UIHref"}, "parent_name": "ParentName", "specifications": [{"id": "ID", "description": "Description", "component_name": "ComponentName", "assessments": [{"id": "ID", "description": "Description", "version": "Version", "type": "Type", "method": "Method", "ui_href": "UIHref"}], "ui_href": "UIHref"}], "ui_href": "UIHref"}, "ui_href": "UIHref"}]}]}, "change_notices": {"breaking": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "new": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "update": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}]}, "plan_ids": ["PlanIds"], "stack": {"anyKey": "anyValue"}}], "all_versions": {"first": {"href": "Href", "start": "Start"}, "next": {"href": "Href", "start": "Start"}}}], "publish": {"pc_managed": false, "approval_type": "ApprovalType", "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "original_crn": "OriginalCRN", "public_crn": "PublicCRN", "approval_record": {"anyKey": "anyValue"}, "permit_ibm_public_publish": true, "ibm_approved": false, "public_approved": true}, "pc_managed": false, "publish_approved": false, "share_with_all": true, "share_with_ibm": true, "share_enabled": true, "public_original_crn": "PublicOriginalCRN", "publish_public_crn": "PublishPublicCRN", "portal_approval_record": "PortalApprovalRecord", "portal_ui_url": "PortalUIURL", "catalog_id": "CatalogID", "catalog_name": "CatalogName", "metadata": {"anyKey": "anyValue"}, "disclaimer": "Disclaimer", "hidden": true, "provider": "Provider", "provider_info": {"id": "ID", "name": "Name"}, "repo_info": {"token": "Token", "type": "Type"}, "image_pull_keys": [{"name": "Name", "value": "Value", "description": "Description"}], "support": {"url": "URL", "process": "Process", "process_i18n": {"mapKey": "Inner"}, "locations": ["Locations"], "support_details": [{"type": "Type", "contact": "Contact", "response_wait_time": {"value": 5, "type": "Type"}, "availability": {"times": [{"day": 3, "start_time": "StartTime", "end_time": "EndTime"}], "timezone": "Timezone", "always_available": false}}], "support_escalation": {"escalation_wait_time": {"value": 5, "type": "Type"}, "response_wait_time": {"value": 5, "type": "Type"}, "contact": "Contact"}, "support_type": "SupportType"}, "media": [{"url": "URL", "api_url": "APIURL", "url_proxy": {"url": "URL", "sha": "Sha"}, "caption": "Caption", "caption_i18n": {"mapKey": "Inner"}, "type": "Type", "thumbnail_url": "ThumbnailURL"}], "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "product_kind": "ProductKind", "badges": [{"id": "ID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}, "icon": "Icon", "authority": "Authority", "tag": "Tag", "learn_more_links": {"first_party": "FirstParty", "third_party": "ThirdParty"}, "constraints": [{"type": "Type", "rule": "anyValue"}]}], "plans": [{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "created": "2019-01-01T12:00:00.000Z", "updated": "2019-01-01T12:00:00.000Z", "offering_id": "OfferingID", "catalog_id": "CatalogID", "label": "Label", "label_i18n": {"mapKey": "Inner"}, "name": "Name", "short_description": "ShortDescription", "short_description_i18n": {"mapKey": "Inner"}, "pricing_tags": ["PricingTags"], "version_range": {"kinds": ["Kinds"], "version": "Version", "flavors": ["Flavors"]}, "features": [{"title": "Title", "title_i18n": {"mapKey": "Inner"}, "description": "Description", "description_i18n": {"mapKey": "Inner"}}], "state": {"current": "Current", "current_entered": "2019-01-01T12:00:00.000Z", "pending": "Pending", "pending_requested": "2019-01-01T12:00:00.000Z", "previous": "Previous"}, "deprecate_pending": {"deprecate_date": "2019-01-01T12:00:00.000Z", "deprecate_state": "DeprecateState", "description": "Description"}, "metadata": {"anyKey": "anyValue"}, "publish_approved": false}]}`) + })) + }) + It(`Invoke GetPlan successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.GetPlan(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the GetPlanOptions model + getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) + getPlanOptionsModel.PlanLocID = core.StringPtr("testString") + getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.GetPlan(getPlanOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke GetPlan with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetPlanOptions model + getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) + getPlanOptionsModel.PlanLocID = core.StringPtr("testString") + getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.GetPlan(getPlanOptionsModel) + 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 GetPlanOptions model with no property values + getPlanOptionsModelNew := new(catalogmanagementv1.GetPlanOptions) + // Invoke operation with invalid model (negative test) + result, response, operationErr = catalogManagementService.GetPlan(getPlanOptionsModelNew) + 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 GetPlan successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the GetPlanOptions model + getPlanOptionsModel := new(catalogmanagementv1.GetPlanOptions) + getPlanOptionsModel.PlanLocID = core.StringPtr("testString") + getPlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.GetPlan(getPlanOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`DeletePlan(deletePlanOptions *DeletePlanOptions)`, func() { + deletePlanPath := "/plans/testString" + 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(deletePlanPath)) + Expect(req.Method).To(Equal("DELETE")) + + res.WriteHeader(200) + })) + }) + It(`Invoke DeletePlan successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.DeletePlan(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the DeletePlanOptions model + deletePlanOptionsModel := new(catalogmanagementv1.DeletePlanOptions) + deletePlanOptionsModel.PlanLocID = core.StringPtr("testString") + deletePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.DeletePlan(deletePlanOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke DeletePlan with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the DeletePlanOptions model + deletePlanOptionsModel := new(catalogmanagementv1.DeletePlanOptions) + deletePlanOptionsModel.PlanLocID = core.StringPtr("testString") + deletePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.DeletePlan(deletePlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the DeletePlanOptions model with no property values + deletePlanOptionsModelNew := new(catalogmanagementv1.DeletePlanOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.DeletePlan(deletePlanOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`ConsumablePlan(consumablePlanOptions *ConsumablePlanOptions)`, func() { + consumablePlanPath := "/plans/testString/consume-publish" + 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(consumablePlanPath)) + Expect(req.Method).To(Equal("POST")) + + res.WriteHeader(202) + })) + }) + It(`Invoke ConsumablePlan successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.ConsumablePlan(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the ConsumablePlanOptions model + consumablePlanOptionsModel := new(catalogmanagementv1.ConsumablePlanOptions) + consumablePlanOptionsModel.PlanLocID = core.StringPtr("testString") + consumablePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.ConsumablePlan(consumablePlanOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke ConsumablePlan with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ConsumablePlanOptions model + consumablePlanOptionsModel := new(catalogmanagementv1.ConsumablePlanOptions) + consumablePlanOptionsModel.PlanLocID = core.StringPtr("testString") + consumablePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.ConsumablePlan(consumablePlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the ConsumablePlanOptions model with no property values + consumablePlanOptionsModelNew := new(catalogmanagementv1.ConsumablePlanOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.ConsumablePlan(consumablePlanOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`SetDeprecatePlan(setDeprecatePlanOptions *SetDeprecatePlanOptions)`, func() { + setDeprecatePlanPath := "/plans/testString/deprecate/true" + 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(setDeprecatePlanPath)) + 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()) + + res.WriteHeader(202) + })) + }) + It(`Invoke SetDeprecatePlan successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + response, operationErr := catalogManagementService.SetDeprecatePlan(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + + // Construct an instance of the SetDeprecatePlanOptions model + setDeprecatePlanOptionsModel := new(catalogmanagementv1.SetDeprecatePlanOptions) + setDeprecatePlanOptionsModel.PlanLocID = core.StringPtr("testString") + setDeprecatePlanOptionsModel.Setting = core.StringPtr("true") + setDeprecatePlanOptionsModel.Description = core.StringPtr("testString") + setDeprecatePlanOptionsModel.DaysUntilDeprecate = core.Int64Ptr(int64(38)) + setDeprecatePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + response, operationErr = catalogManagementService.SetDeprecatePlan(setDeprecatePlanOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + }) + It(`Invoke SetDeprecatePlan with error: Operation validation and request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the SetDeprecatePlanOptions model + setDeprecatePlanOptionsModel := new(catalogmanagementv1.SetDeprecatePlanOptions) + setDeprecatePlanOptionsModel.PlanLocID = core.StringPtr("testString") + setDeprecatePlanOptionsModel.Setting = core.StringPtr("true") + setDeprecatePlanOptionsModel.Description = core.StringPtr("testString") + setDeprecatePlanOptionsModel.DaysUntilDeprecate = core.Int64Ptr(int64(38)) + setDeprecatePlanOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + response, operationErr := catalogManagementService.SetDeprecatePlan(setDeprecatePlanOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring(core.ERRORMSG_SERVICE_URL_MISSING)) + Expect(response).To(BeNil()) + // Construct a second instance of the SetDeprecatePlanOptions model with no property values + setDeprecatePlanOptionsModelNew := new(catalogmanagementv1.SetDeprecatePlanOptions) + // Invoke operation with invalid model (negative test) + response, operationErr = catalogManagementService.SetDeprecatePlan(setDeprecatePlanOptionsModelNew) + Expect(operationErr).ToNot(BeNil()) + Expect(response).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`PreviewRegions(previewRegionsOptions *PreviewRegionsOptions) - Operation response error`, func() { + previewRegionsPath := "/regions" + 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(previewRegionsPath)) + Expect(req.Method).To(Equal("POST")) + Expect(req.URL.Query()["filter"]).To(Equal([]string{"testString"})) + // TODO: Add check for get_inactive query parameter + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(100))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke PreviewRegions with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the PreviewRegionsOptions model + previewRegionsOptionsModel := new(catalogmanagementv1.PreviewRegionsOptions) + previewRegionsOptionsModel.Filter = core.StringPtr("testString") + previewRegionsOptionsModel.GetInactive = core.BoolPtr(true) + previewRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + previewRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + previewRegionsOptionsModel.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 := catalogManagementService.PreviewRegions(previewRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.PreviewRegions(previewRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`PreviewRegions(previewRegionsOptions *PreviewRegionsOptions)`, func() { + previewRegionsPath := "/regions" + 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(previewRegionsPath)) + Expect(req.Method).To(Equal("POST")) + + Expect(req.URL.Query()["filter"]).To(Equal([]string{"testString"})) + // TODO: Add check for get_inactive query parameter + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(100))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(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", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "regions": [{"id": "ID", "name": "Name", "catalog_crn": "CatalogCRN", "kind": "Kind", "public": true, "ui": {"_language_": {"description": "Description", "display_name": "DisplayName"}}, "icon": "Icon", "parent_id": "ParentID", "metro_id": "MetroID", "country_id": "CountryID", "geo_id": "GeoID", "authority": {"url": "URL", "crn": "CRN", "provider": "Provider"}, "tags": ["Tags"], "capabilities": "Capabilities", "created": "Created", "updated": "Updated", "active": true, "visibility": {"anyKey": "anyValue"}}]}`) + })) + }) + It(`Invoke PreviewRegions successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the PreviewRegionsOptions model + previewRegionsOptionsModel := new(catalogmanagementv1.PreviewRegionsOptions) + previewRegionsOptionsModel.Filter = core.StringPtr("testString") + previewRegionsOptionsModel.GetInactive = core.BoolPtr(true) + previewRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + previewRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + previewRegionsOptionsModel.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 := catalogManagementService.PreviewRegionsWithContext(ctx, previewRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.PreviewRegions(previewRegionsOptionsModel) + 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 = catalogManagementService.PreviewRegionsWithContext(ctx, previewRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + 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(previewRegionsPath)) + Expect(req.Method).To(Equal("POST")) + + Expect(req.URL.Query()["filter"]).To(Equal([]string{"testString"})) + // TODO: Add check for get_inactive query parameter + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(100))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "regions": [{"id": "ID", "name": "Name", "catalog_crn": "CatalogCRN", "kind": "Kind", "public": true, "ui": {"_language_": {"description": "Description", "display_name": "DisplayName"}}, "icon": "Icon", "parent_id": "ParentID", "metro_id": "MetroID", "country_id": "CountryID", "geo_id": "GeoID", "authority": {"url": "URL", "crn": "CRN", "provider": "Provider"}, "tags": ["Tags"], "capabilities": "Capabilities", "created": "Created", "updated": "Updated", "active": true, "visibility": {"anyKey": "anyValue"}}]}`) + })) + }) + It(`Invoke PreviewRegions successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.PreviewRegions(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the PreviewRegionsOptions model + previewRegionsOptionsModel := new(catalogmanagementv1.PreviewRegionsOptions) + previewRegionsOptionsModel.Filter = core.StringPtr("testString") + previewRegionsOptionsModel.GetInactive = core.BoolPtr(true) + previewRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + previewRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + previewRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.PreviewRegions(previewRegionsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke PreviewRegions with error: Operation request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the PreviewRegionsOptions model + previewRegionsOptionsModel := new(catalogmanagementv1.PreviewRegionsOptions) + previewRegionsOptionsModel.Filter = core.StringPtr("testString") + previewRegionsOptionsModel.GetInactive = core.BoolPtr(true) + previewRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + previewRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + previewRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.PreviewRegions(previewRegionsOptionsModel) + 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 PreviewRegions successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the PreviewRegionsOptions model + previewRegionsOptionsModel := new(catalogmanagementv1.PreviewRegionsOptions) + previewRegionsOptionsModel.Filter = core.StringPtr("testString") + previewRegionsOptionsModel.GetInactive = core.BoolPtr(true) + previewRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + previewRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + previewRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.PreviewRegions(previewRegionsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`ListRegions(listRegionsOptions *ListRegionsOptions) - Operation response error`, func() { + listRegionsPath := "/regions" + 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(listRegionsPath)) + Expect(req.Method).To(Equal("GET")) + Expect(req.URL.Query()["filter"]).To(Equal([]string{"testString"})) + // TODO: Add check for get_inactive query parameter + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(100))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprint(res, `} this is not valid json {`) + })) + }) + It(`Invoke ListRegions with error: Operation response processing error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ListRegionsOptions model + listRegionsOptionsModel := new(catalogmanagementv1.ListRegionsOptions) + listRegionsOptionsModel.Filter = core.StringPtr("testString") + listRegionsOptionsModel.GetInactive = core.BoolPtr(true) + listRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + listRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listRegionsOptionsModel.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 := catalogManagementService.ListRegions(listRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + + // Enable retries and test again + catalogManagementService.EnableRetries(0, 0) + result, response, operationErr = catalogManagementService.ListRegions(listRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`ListRegions(listRegionsOptions *ListRegionsOptions)`, func() { + listRegionsPath := "/regions" + 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(listRegionsPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.URL.Query()["filter"]).To(Equal([]string{"testString"})) + // TODO: Add check for get_inactive query parameter + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(100))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(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", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "regions": [{"id": "ID", "name": "Name", "catalog_crn": "CatalogCRN", "kind": "Kind", "public": true, "ui": {"_language_": {"description": "Description", "display_name": "DisplayName"}}, "icon": "Icon", "parent_id": "ParentID", "metro_id": "MetroID", "country_id": "CountryID", "geo_id": "GeoID", "authority": {"url": "URL", "crn": "CRN", "provider": "Provider"}, "tags": ["Tags"], "capabilities": "Capabilities", "created": "Created", "updated": "Updated", "active": true, "visibility": {"anyKey": "anyValue"}}]}`) + })) + }) + It(`Invoke ListRegions successfully with retries`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + catalogManagementService.EnableRetries(0, 0) + + // Construct an instance of the ListRegionsOptions model + listRegionsOptionsModel := new(catalogmanagementv1.ListRegionsOptions) + listRegionsOptionsModel.Filter = core.StringPtr("testString") + listRegionsOptionsModel.GetInactive = core.BoolPtr(true) + listRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + listRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listRegionsOptionsModel.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 := catalogManagementService.ListRegionsWithContext(ctx, listRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + + // Disable retries and test again + catalogManagementService.DisableRetries() + result, response, operationErr := catalogManagementService.ListRegions(listRegionsOptionsModel) + 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 = catalogManagementService.ListRegionsWithContext(ctx, listRegionsOptionsModel) + Expect(operationErr).ToNot(BeNil()) + Expect(operationErr.Error()).To(ContainSubstring("deadline exceeded")) + }) + AfterEach(func() { + testServer.Close() + }) + }) + 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(listRegionsPath)) + Expect(req.Method).To(Equal("GET")) + + Expect(req.URL.Query()["filter"]).To(Equal([]string{"testString"})) + // TODO: Add check for get_inactive query parameter + Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(100))})) + Expect(req.URL.Query()["offset"]).To(Equal([]string{fmt.Sprint(int64(0))})) + // Set mock response + res.Header().Set("Content-type", "application/json") + res.WriteHeader(200) + fmt.Fprintf(res, "%s", `{"offset": 6, "limit": 5, "total_count": 10, "resource_count": 13, "first": {"href": "Href", "start": "Start"}, "last": {"href": "Href", "start": "Start"}, "regions": [{"id": "ID", "name": "Name", "catalog_crn": "CatalogCRN", "kind": "Kind", "public": true, "ui": {"_language_": {"description": "Description", "display_name": "DisplayName"}}, "icon": "Icon", "parent_id": "ParentID", "metro_id": "MetroID", "country_id": "CountryID", "geo_id": "GeoID", "authority": {"url": "URL", "crn": "CRN", "provider": "Provider"}, "tags": ["Tags"], "capabilities": "Capabilities", "created": "Created", "updated": "Updated", "active": true, "visibility": {"anyKey": "anyValue"}}]}`) + })) + }) + It(`Invoke ListRegions successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Invoke operation with nil options model (negative test) + result, response, operationErr := catalogManagementService.ListRegions(nil) + Expect(operationErr).NotTo(BeNil()) + Expect(response).To(BeNil()) + Expect(result).To(BeNil()) + + // Construct an instance of the ListRegionsOptions model + listRegionsOptionsModel := new(catalogmanagementv1.ListRegionsOptions) + listRegionsOptionsModel.Filter = core.StringPtr("testString") + listRegionsOptionsModel.GetInactive = core.BoolPtr(true) + listRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + listRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation with valid options model (positive test) + result, response, operationErr = catalogManagementService.ListRegions(listRegionsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + Expect(result).ToNot(BeNil()) + + }) + It(`Invoke ListRegions with error: Operation request error`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ListRegionsOptions model + listRegionsOptionsModel := new(catalogmanagementv1.ListRegionsOptions) + listRegionsOptionsModel.Filter = core.StringPtr("testString") + listRegionsOptionsModel.GetInactive = core.BoolPtr(true) + listRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + listRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + // Invoke operation with empty URL (negative test) + err := catalogManagementService.SetServiceURL("") + Expect(err).To(BeNil()) + result, response, operationErr := catalogManagementService.ListRegions(listRegionsOptionsModel) + 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 ListRegions successfully`, func() { + catalogManagementService, serviceErr := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: testServer.URL, + Authenticator: &core.NoAuthAuthenticator{}, + }) + Expect(serviceErr).To(BeNil()) + Expect(catalogManagementService).ToNot(BeNil()) + + // Construct an instance of the ListRegionsOptions model + listRegionsOptionsModel := new(catalogmanagementv1.ListRegionsOptions) + listRegionsOptionsModel.Filter = core.StringPtr("testString") + listRegionsOptionsModel.GetInactive = core.BoolPtr(true) + listRegionsOptionsModel.Limit = core.Int64Ptr(int64(100)) + listRegionsOptionsModel.Offset = core.Int64Ptr(int64(0)) + listRegionsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} + + // Invoke operation + result, response, operationErr := catalogManagementService.ListRegions(listRegionsOptionsModel) + Expect(operationErr).To(BeNil()) + Expect(response).ToNot(BeNil()) + + // Verify a nil result + Expect(result).To(BeNil()) + }) + AfterEach(func() { + testServer.Close() + }) + }) + }) + Describe(`Model constructor tests`, func() { + Context(`Using a service client instance`, func() { + catalogManagementService, _ := catalogmanagementv1.NewCatalogManagementV1(&catalogmanagementv1.CatalogManagementV1Options{ + URL: "http://catalogmanagementv1modelgenerator.com", + Authenticator: &core.NoAuthAuthenticator{}, + }) + It(`Invoke NewAddObjectAccessListOptions successfully`, func() { + // Construct an instance of the AddObjectAccessListOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + accesses := []string{"testString"} + addObjectAccessListOptionsModel := catalogManagementService.NewAddObjectAccessListOptions(catalogIdentifier, objectIdentifier, accesses) + addObjectAccessListOptionsModel.SetCatalogIdentifier("testString") + addObjectAccessListOptionsModel.SetObjectIdentifier("testString") + addObjectAccessListOptionsModel.SetAccesses([]string{"testString"}) + addObjectAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(addObjectAccessListOptionsModel).ToNot(BeNil()) + Expect(addObjectAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(addObjectAccessListOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(addObjectAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(addObjectAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewAddOfferingAccessListOptions successfully`, func() { + // Construct an instance of the AddOfferingAccessListOptions model + catalogIdentifier := "testString" + offeringID := "testString" + accesses := []string{"testString"} + addOfferingAccessListOptionsModel := catalogManagementService.NewAddOfferingAccessListOptions(catalogIdentifier, offeringID, accesses) + addOfferingAccessListOptionsModel.SetCatalogIdentifier("testString") + addOfferingAccessListOptionsModel.SetOfferingID("testString") + addOfferingAccessListOptionsModel.SetAccesses([]string{"testString"}) + addOfferingAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(addOfferingAccessListOptionsModel).ToNot(BeNil()) + Expect(addOfferingAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(addOfferingAccessListOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(addOfferingAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(addOfferingAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewAddShareApprovalListOptions successfully`, func() { + // Construct an instance of the AddShareApprovalListOptions model + objectType := "offering" + accesses := []string{"testString"} + addShareApprovalListOptionsModel := catalogManagementService.NewAddShareApprovalListOptions(objectType, accesses) + addShareApprovalListOptionsModel.SetObjectType("offering") + addShareApprovalListOptionsModel.SetAccesses([]string{"testString"}) + addShareApprovalListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(addShareApprovalListOptionsModel).ToNot(BeNil()) + Expect(addShareApprovalListOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) + Expect(addShareApprovalListOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(addShareApprovalListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewArchiveVersionOptions successfully`, func() { + // Construct an instance of the ArchiveVersionOptions model + versionLocID := "testString" + archiveVersionOptionsModel := catalogManagementService.NewArchiveVersionOptions(versionLocID) + archiveVersionOptionsModel.SetVersionLocID("testString") + archiveVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(archiveVersionOptionsModel).ToNot(BeNil()) + Expect(archiveVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(archiveVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCommitVersionOptions successfully`, func() { + // Construct an instance of the CommitVersionOptions model + versionLocID := "testString" + commitVersionOptionsModel := catalogManagementService.NewCommitVersionOptions(versionLocID) + commitVersionOptionsModel.SetVersionLocID("testString") + commitVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(commitVersionOptionsModel).ToNot(BeNil()) + Expect(commitVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(commitVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewConsumablePlanOptions successfully`, func() { + // Construct an instance of the ConsumablePlanOptions model + planLocID := "testString" + consumablePlanOptionsModel := catalogManagementService.NewConsumablePlanOptions(planLocID) + consumablePlanOptionsModel.SetPlanLocID("testString") + consumablePlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(consumablePlanOptionsModel).ToNot(BeNil()) + Expect(consumablePlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) + Expect(consumablePlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewConsumableShareObjectOptions successfully`, func() { + // Construct an instance of the ConsumableShareObjectOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + consumableShareObjectOptionsModel := catalogManagementService.NewConsumableShareObjectOptions(catalogIdentifier, objectIdentifier) + consumableShareObjectOptionsModel.SetCatalogIdentifier("testString") + consumableShareObjectOptionsModel.SetObjectIdentifier("testString") + consumableShareObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(consumableShareObjectOptionsModel).ToNot(BeNil()) + Expect(consumableShareObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(consumableShareObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(consumableShareObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewConsumableVersionOptions successfully`, func() { + // Construct an instance of the ConsumableVersionOptions model + versionLocID := "testString" + consumableVersionOptionsModel := catalogManagementService.NewConsumableVersionOptions(versionLocID) + consumableVersionOptionsModel.SetVersionLocID("testString") + consumableVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(consumableVersionOptionsModel).ToNot(BeNil()) + Expect(consumableVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(consumableVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCopyFromPreviousVersionOptions successfully`, func() { + // Construct an instance of the CopyFromPreviousVersionOptions model + versionLocID := "testString" + typeVar := "testString" + versionLocIDToCopyFrom := "testString" + copyFromPreviousVersionOptionsModel := catalogManagementService.NewCopyFromPreviousVersionOptions(versionLocID, typeVar, versionLocIDToCopyFrom) + copyFromPreviousVersionOptionsModel.SetVersionLocID("testString") + copyFromPreviousVersionOptionsModel.SetType("testString") + copyFromPreviousVersionOptionsModel.SetVersionLocIDToCopyFrom("testString") + copyFromPreviousVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(copyFromPreviousVersionOptionsModel).ToNot(BeNil()) + Expect(copyFromPreviousVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(copyFromPreviousVersionOptionsModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(copyFromPreviousVersionOptionsModel.VersionLocIDToCopyFrom).To(Equal(core.StringPtr("testString"))) + Expect(copyFromPreviousVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCopyVersionOptions successfully`, func() { + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + Expect(flavorModel).ToNot(BeNil()) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) + Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the CopyVersionOptions model + versionLocID := "testString" + copyVersionOptionsModel := catalogManagementService.NewCopyVersionOptions(versionLocID) + copyVersionOptionsModel.SetVersionLocID("testString") + copyVersionOptionsModel.SetTags([]string{"testString"}) + copyVersionOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) + copyVersionOptionsModel.SetTargetKinds([]string{"testString"}) + copyVersionOptionsModel.SetFormatKind("testString") + copyVersionOptionsModel.SetFlavor(flavorModel) + copyVersionOptionsModel.SetWorkingDirectory("testString") + copyVersionOptionsModel.SetInstallType("testString") + copyVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(copyVersionOptionsModel).ToNot(BeNil()) + Expect(copyVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(copyVersionOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(copyVersionOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) + Expect(copyVersionOptionsModel.TargetKinds).To(Equal([]string{"testString"})) + Expect(copyVersionOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) + Expect(copyVersionOptionsModel.Flavor).To(Equal(flavorModel)) + Expect(copyVersionOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) + Expect(copyVersionOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(copyVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCreateCatalogOptions successfully`, func() { + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + Expect(featureModel).ToNot(BeNil()) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} + Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + + // Construct an instance of the FilterTerms model + filterTermsModel := new(catalogmanagementv1.FilterTerms) + Expect(filterTermsModel).ToNot(BeNil()) + filterTermsModel.FilterTerms = []string{"testString"} + Expect(filterTermsModel.FilterTerms).To(Equal([]string{"testString"})) + + // Construct an instance of the CategoryFilter model + categoryFilterModel := new(catalogmanagementv1.CategoryFilter) + Expect(categoryFilterModel).ToNot(BeNil()) + categoryFilterModel.Include = core.BoolPtr(true) + categoryFilterModel.Filter = filterTermsModel + Expect(categoryFilterModel.Include).To(Equal(core.BoolPtr(true))) + Expect(categoryFilterModel.Filter).To(Equal(filterTermsModel)) + + // Construct an instance of the IDFilter model + idFilterModel := new(catalogmanagementv1.IDFilter) + Expect(idFilterModel).ToNot(BeNil()) + idFilterModel.Include = filterTermsModel + idFilterModel.Exclude = filterTermsModel + Expect(idFilterModel.Include).To(Equal(filterTermsModel)) + Expect(idFilterModel.Exclude).To(Equal(filterTermsModel)) + + // Construct an instance of the Filters model + filtersModel := new(catalogmanagementv1.Filters) + Expect(filtersModel).ToNot(BeNil()) + filtersModel.IncludeAll = core.BoolPtr(true) + filtersModel.CategoryFilters = map[string]catalogmanagementv1.CategoryFilter{"key1": *categoryFilterModel} + filtersModel.IDFilters = idFilterModel + filtersModel.CategoryFilters["foo"] = *categoryFilterModel + Expect(filtersModel.IncludeAll).To(Equal(core.BoolPtr(true))) + Expect(filtersModel.IDFilters).To(Equal(idFilterModel)) + Expect(filtersModel.CategoryFilters["foo"]).To(Equal(*categoryFilterModel)) + + // Construct an instance of the TrustedProfileInfo model + trustedProfileInfoModel := new(catalogmanagementv1.TrustedProfileInfo) + Expect(trustedProfileInfoModel).ToNot(BeNil()) + trustedProfileInfoModel.TrustedProfileID = core.StringPtr("testString") + trustedProfileInfoModel.CatalogCRN = core.StringPtr("testString") + trustedProfileInfoModel.CatalogName = core.StringPtr("testString") + trustedProfileInfoModel.TargetServiceID = core.StringPtr("testString") + Expect(trustedProfileInfoModel.TrustedProfileID).To(Equal(core.StringPtr("testString"))) + Expect(trustedProfileInfoModel.CatalogCRN).To(Equal(core.StringPtr("testString"))) + Expect(trustedProfileInfoModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(trustedProfileInfoModel.TargetServiceID).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the TargetAccountContext model + targetAccountContextModel := new(catalogmanagementv1.TargetAccountContext) + Expect(targetAccountContextModel).ToNot(BeNil()) + targetAccountContextModel.APIKey = core.StringPtr("testString") + targetAccountContextModel.TrustedProfile = trustedProfileInfoModel + targetAccountContextModel.Name = core.StringPtr("testString") + targetAccountContextModel.Label = core.StringPtr("testString") + targetAccountContextModel.ProjectID = core.StringPtr("testString") + Expect(targetAccountContextModel.APIKey).To(Equal(core.StringPtr("testString"))) + Expect(targetAccountContextModel.TrustedProfile).To(Equal(trustedProfileInfoModel)) + Expect(targetAccountContextModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(targetAccountContextModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(targetAccountContextModel.ProjectID).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the CreateCatalogOptions model + createCatalogOptionsModel := catalogManagementService.NewCreateCatalogOptions() + createCatalogOptionsModel.SetLabel("testString") + createCatalogOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + createCatalogOptionsModel.SetShortDescription("testString") + createCatalogOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + createCatalogOptionsModel.SetCatalogIconURL("testString") + createCatalogOptionsModel.SetCatalogBannerURL("testString") + createCatalogOptionsModel.SetTags([]string{"testString"}) + createCatalogOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) + createCatalogOptionsModel.SetDisabled(true) + createCatalogOptionsModel.SetResourceGroupID("testString") + createCatalogOptionsModel.SetOwningAccount("testString") + createCatalogOptionsModel.SetCatalogFilters(filtersModel) + createCatalogOptionsModel.SetKind("testString") + createCatalogOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + createCatalogOptionsModel.SetTargetAccountContexts([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel}) + createCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createCatalogOptionsModel).ToNot(BeNil()) + Expect(createCatalogOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createCatalogOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createCatalogOptionsModel.CatalogIconURL).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.CatalogBannerURL).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(createCatalogOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(createCatalogOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) + Expect(createCatalogOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.OwningAccount).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.CatalogFilters).To(Equal(filtersModel)) + Expect(createCatalogOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(createCatalogOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(createCatalogOptionsModel.TargetAccountContexts).To(Equal([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel})) + Expect(createCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCreateObjectAccessOptions successfully`, func() { + // Construct an instance of the CreateObjectAccessOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + accessIdentifier := "testString" + createObjectAccessOptionsModel := catalogManagementService.NewCreateObjectAccessOptions(catalogIdentifier, objectIdentifier, accessIdentifier) + createObjectAccessOptionsModel.SetCatalogIdentifier("testString") + createObjectAccessOptionsModel.SetObjectIdentifier("testString") + createObjectAccessOptionsModel.SetAccessIdentifier("testString") + createObjectAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createObjectAccessOptionsModel).ToNot(BeNil()) + Expect(createObjectAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(createObjectAccessOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(createObjectAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(createObjectAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCreateObjectOptions successfully`, func() { + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + Expect(publishObjectModel).ToNot(BeNil()) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + Expect(stateModel).ToNot(BeNil()) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the CreateObjectOptions model + catalogIdentifier := "testString" + createObjectOptionsModel := catalogManagementService.NewCreateObjectOptions(catalogIdentifier) + createObjectOptionsModel.SetCatalogIdentifier("testString") + createObjectOptionsModel.SetName("testString") + createObjectOptionsModel.SetCRN("testString") + createObjectOptionsModel.SetURL("testString") + createObjectOptionsModel.SetParentID("testString") + createObjectOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + createObjectOptionsModel.SetLabel("testString") + createObjectOptionsModel.SetTags([]string{"testString"}) + createObjectOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + createObjectOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + createObjectOptionsModel.SetShortDescription("testString") + createObjectOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + createObjectOptionsModel.SetKind("testString") + createObjectOptionsModel.SetPublish(publishObjectModel) + createObjectOptionsModel.SetState(stateModel) + createObjectOptionsModel.SetCatalogID("testString") + createObjectOptionsModel.SetCatalogName("testString") + createObjectOptionsModel.SetData(map[string]interface{}{"anyKey": "anyValue"}) + createObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createObjectOptionsModel).ToNot(BeNil()) + Expect(createObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.ParentID).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createObjectOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(createObjectOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(createObjectOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(createObjectOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createObjectOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.Publish).To(Equal(publishObjectModel)) + Expect(createObjectOptionsModel.State).To(Equal(stateModel)) + Expect(createObjectOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(createObjectOptionsModel.Data).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(createObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCreateOfferingInstanceOptions successfully`, func() { + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + Expect(offeringInstanceLastOperationModel).ToNot(BeNil()) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + Expect(offeringInstanceLastOperationModel.Operation).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.State).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.Message).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.TransactionID).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(offeringInstanceLastOperationModel.Code).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the CreateOfferingInstanceOptions model + xAuthRefreshToken := "testString" + createOfferingInstanceOptionsModel := catalogManagementService.NewCreateOfferingInstanceOptions(xAuthRefreshToken) + createOfferingInstanceOptionsModel.SetXAuthRefreshToken("testString") + createOfferingInstanceOptionsModel.SetID("testString") + createOfferingInstanceOptionsModel.SetRev("testString") + createOfferingInstanceOptionsModel.SetURL("testString") + createOfferingInstanceOptionsModel.SetCRN("testString") + createOfferingInstanceOptionsModel.SetLabel("testString") + createOfferingInstanceOptionsModel.SetCatalogID("testString") + createOfferingInstanceOptionsModel.SetOfferingID("testString") + createOfferingInstanceOptionsModel.SetKindFormat("testString") + createOfferingInstanceOptionsModel.SetKindFormatLabel("testString") + createOfferingInstanceOptionsModel.SetVersion("testString") + createOfferingInstanceOptionsModel.SetVersionID("testString") + createOfferingInstanceOptionsModel.SetClusterID("testString") + createOfferingInstanceOptionsModel.SetClusterRegion("testString") + createOfferingInstanceOptionsModel.SetClusterNamespaces([]string{"testString"}) + createOfferingInstanceOptionsModel.SetClusterAllNamespaces(true) + createOfferingInstanceOptionsModel.SetSchematicsWorkspaceID("testString") + createOfferingInstanceOptionsModel.SetInstallPlan("testString") + createOfferingInstanceOptionsModel.SetChannel("testString") + createOfferingInstanceOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + createOfferingInstanceOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + createOfferingInstanceOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + createOfferingInstanceOptionsModel.SetResourceGroupID("testString") + createOfferingInstanceOptionsModel.SetLocation("testString") + createOfferingInstanceOptionsModel.SetDisabled(true) + createOfferingInstanceOptionsModel.SetAccount("testString") + createOfferingInstanceOptionsModel.SetLastOperation(offeringInstanceLastOperationModel) + createOfferingInstanceOptionsModel.SetKindTarget("testString") + createOfferingInstanceOptionsModel.SetKindTargetLabel("testString") + createOfferingInstanceOptionsModel.SetSha("testString") + createOfferingInstanceOptionsModel.SetPlanID("testString") + createOfferingInstanceOptionsModel.SetParentCRN("testString") + createOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createOfferingInstanceOptionsModel).ToNot(BeNil()) + Expect(createOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.KindFormat).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.KindFormatLabel).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.VersionID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.ClusterRegion).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.ClusterNamespaces).To(Equal([]string{"testString"})) + Expect(createOfferingInstanceOptionsModel.ClusterAllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(createOfferingInstanceOptionsModel.SchematicsWorkspaceID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(createOfferingInstanceOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(createOfferingInstanceOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(createOfferingInstanceOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Location).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) + Expect(createOfferingInstanceOptionsModel.Account).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.LastOperation).To(Equal(offeringInstanceLastOperationModel)) + Expect(createOfferingInstanceOptionsModel.KindTarget).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.KindTargetLabel).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.ParentCRN).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewCreateOfferingOptions successfully`, func() { + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + Expect(ratingModel).ToNot(BeNil()) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) + Expect(ratingModel.OneStarCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(ratingModel.TwoStarCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(ratingModel.ThreeStarCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(ratingModel.FourStarCount).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + Expect(featureModel).ToNot(BeNil()) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} + Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + Expect(flavorModel).ToNot(BeNil()) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) + Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + Expect(renderTypeAssociationsParametersItemModel).ToNot(BeNil()) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) + Expect(renderTypeAssociationsParametersItemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeAssociationsParametersItemModel.OptionsRefresh).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + Expect(renderTypeAssociationsModel).ToNot(BeNil()) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} + Expect(renderTypeAssociationsModel.Parameters).To(Equal([]catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel})) + + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + Expect(renderTypeModel).ToNot(BeNil()) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel + Expect(renderTypeModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeModel.Grouping).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeModel.OriginalGrouping).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeModel.GroupingIndex).To(Equal(core.Int64Ptr(int64(38)))) + Expect(renderTypeModel.ConfigConstraints).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(renderTypeModel.Associations).To(Equal(renderTypeAssociationsModel)) + + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + Expect(configurationModel).ToNot(BeNil()) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") + Expect(configurationModel.Key).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.DefaultValue).To(Equal("testString")) + Expect(configurationModel.DisplayName).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.ValueConstraint).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.Required).To(Equal(core.BoolPtr(true))) + Expect(configurationModel.Options).To(Equal([]interface{}{"testString"})) + Expect(configurationModel.Hidden).To(Equal(core.BoolPtr(true))) + Expect(configurationModel.CustomConfig).To(Equal(renderTypeModel)) + Expect(configurationModel.TypeMetadata).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + Expect(outputModel).ToNot(BeNil()) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") + Expect(outputModel.Key).To(Equal(core.StringPtr("testString"))) + Expect(outputModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + Expect(iamResourceModel).ToNot(BeNil()) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} + Expect(iamResourceModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(iamResourceModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(iamResourceModel.RoleCrns).To(Equal([]string{"testString"})) + + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + Expect(iamPermissionModel).ToNot(BeNil()) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} + Expect(iamPermissionModel.ServiceName).To(Equal(core.StringPtr("testString"))) + Expect(iamPermissionModel.RoleCrns).To(Equal([]string{"testString"})) + Expect(iamPermissionModel.Resources).To(Equal([]catalogmanagementv1.IamResource{*iamResourceModel})) + + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + Expect(validationModel).ToNot(BeNil()) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") + Expect(validationModel.Validated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(validationModel.Requested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(validationModel.State).To(Equal(core.StringPtr("testString"))) + Expect(validationModel.LastOperation).To(Equal(core.StringPtr("testString"))) + Expect(validationModel.Target).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(validationModel.Message).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + Expect(resourceModel).ToNot(BeNil()) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" + Expect(resourceModel.Type).To(Equal(core.StringPtr("mem"))) + Expect(resourceModel.Value).To(Equal("testString")) + + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + Expect(schematicsEnvValuesModel).ToNot(BeNil()) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") + Expect(schematicsEnvValuesModel.Value).To(Equal(core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]"))) + Expect(schematicsEnvValuesModel.SmRef).To(Equal(core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"))) + + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + Expect(scriptModel).ToNot(BeNil()) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") + Expect(scriptModel.Instructions).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.InstructionsI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(scriptModel.Script).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.ScriptPermission).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.DeleteScript).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.Scope).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + Expect(scriptRefModel).ToNot(BeNil()) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") + Expect(scriptRefModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(scriptRefModel.Type).To(Equal(core.StringPtr("ansible"))) + Expect(scriptRefModel.Path).To(Equal(core.StringPtr("scripts/validate-post-ansible-playbook.yaml"))) + Expect(scriptRefModel.Stage).To(Equal(core.StringPtr("pre"))) + Expect(scriptRefModel.Action).To(Equal(core.StringPtr("validate"))) + + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + Expect(versionEntitlementModel).ToNot(BeNil()) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") + Expect(versionEntitlementModel.ProviderName).To(Equal(core.StringPtr("testString"))) + Expect(versionEntitlementModel.ProviderID).To(Equal(core.StringPtr("testString"))) + Expect(versionEntitlementModel.ProductID).To(Equal(core.StringPtr("testString"))) + Expect(versionEntitlementModel.PartNumbers).To(Equal([]string{"testString"})) + Expect(versionEntitlementModel.ImageRepoName).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + Expect(licenseModel).ToNot(BeNil()) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") + Expect(licenseModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + Expect(stateModel).ToNot(BeNil()) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + Expect(deprecatePendingModel).ToNot(BeNil()) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") + Expect(deprecatePendingModel.DeprecateDate).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(deprecatePendingModel.DeprecateState).To(Equal(core.StringPtr("testString"))) + Expect(deprecatePendingModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + Expect(urlProxyModel).ToNot(BeNil()) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") + Expect(urlProxyModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(urlProxyModel.Sha).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + Expect(mediaItemModel).ToNot(BeNil()) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") + Expect(mediaItemModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.APIURL).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.URLProxy).To(Equal(urlProxyModel)) + Expect(mediaItemModel.Caption).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.CaptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(mediaItemModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.ThumbnailURL).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + Expect(architectureDiagramModel).ToNot(BeNil()) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} + Expect(architectureDiagramModel.Diagram).To(Equal(mediaItemModel)) + Expect(architectureDiagramModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(architectureDiagramModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + Expect(costComponentModel).ToNot(BeNil()) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") + Expect(costComponentModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.Unit).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.HourlyQuantity).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.MonthlyQuantity).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.Price).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.HourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.MonthlyCost).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + Expect(costResourceModel).ToNot(BeNil()) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} + Expect(costResourceModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(costResourceModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(costResourceModel.HourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costResourceModel.MonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costResourceModel.CostComponents).To(Equal([]catalogmanagementv1.CostComponent{*costComponentModel})) + + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + Expect(costBreakdownModel).ToNot(BeNil()) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} + Expect(costBreakdownModel.TotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costBreakdownModel.TotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costBreakdownModel.Resources).To(Equal([]catalogmanagementv1.CostResource{*costResourceModel})) + + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + Expect(costSummaryModel).ToNot(BeNil()) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} + Expect(costSummaryModel.TotalDetectedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalSupportedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalUnsupportedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalUsageBasedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalNoPriceResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.UnsupportedResourceCounts).To(Equal(map[string]int64{"key1": int64(38)})) + Expect(costSummaryModel.NoPriceResourceCounts).To(Equal(map[string]int64{"key1": int64(38)})) + + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + Expect(projectModel).ToNot(BeNil()) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel + Expect(projectModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(projectModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(projectModel.PastBreakdown).To(Equal(costBreakdownModel)) + Expect(projectModel.Breakdown).To(Equal(costBreakdownModel)) + Expect(projectModel.Diff).To(Equal(costBreakdownModel)) + Expect(projectModel.Summary).To(Equal(costSummaryModel)) + + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + Expect(costEstimateModel).ToNot(BeNil()) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + Expect(costEstimateModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.Currency).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.Projects).To(Equal([]catalogmanagementv1.Project{*projectModel})) + Expect(costEstimateModel.Summary).To(Equal(costSummaryModel)) + Expect(costEstimateModel.TotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.TotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.PastTotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.PastTotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.DiffTotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.DiffTotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.TimeGenerated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + Expect(offeringReferenceModel).ToNot(BeNil()) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} + Expect(offeringReferenceModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Flavors).To(Equal([]string{"testString"})) + + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + Expect(solutionInfoModel).ToNot(BeNil()) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") + Expect(solutionInfoModel.ArchitectureDiagrams).To(Equal([]catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel})) + Expect(solutionInfoModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(solutionInfoModel.CostEstimate).To(Equal(costEstimateModel)) + Expect(solutionInfoModel.Dependencies).To(Equal([]catalogmanagementv1.OfferingReference{*offeringReferenceModel})) + Expect(solutionInfoModel.InstallType).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + Expect(sccProfileModel).ToNot(BeNil()) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") + Expect(sccProfileModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + Expect(claimedControlModel).ToNot(BeNil()) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} + Expect(claimedControlModel.Profile).To(Equal(sccProfileModel)) + Expect(claimedControlModel.Names).To(Equal([]string{"testString"})) + + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + Expect(claimsModel).ToNot(BeNil()) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} + Expect(claimsModel.Profiles).To(Equal([]catalogmanagementv1.SccProfile{*sccProfileModel})) + Expect(claimsModel.Controls).To(Equal([]catalogmanagementv1.ClaimedControl{*claimedControlModel})) + + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + Expect(resultModel).ToNot(BeNil()) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} + Expect(resultModel.FailureCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(resultModel.ScanTime).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(resultModel.ErrorMessage).To(Equal(core.StringPtr("testString"))) + Expect(resultModel.CompleteScan).To(Equal(core.BoolPtr(true))) + Expect(resultModel.UnscannedResources).To(Equal([]string{"testString"})) + + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + Expect(sccAssessmentModel).ToNot(BeNil()) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") + Expect(sccAssessmentModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Method).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + Expect(sccSpecificationModel).ToNot(BeNil()) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") + Expect(sccSpecificationModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccSpecificationModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccSpecificationModel.ComponentName).To(Equal(core.StringPtr("testString"))) + Expect(sccSpecificationModel.Assessments).To(Equal([]catalogmanagementv1.SccAssessment{*sccAssessmentModel})) + Expect(sccSpecificationModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + Expect(sccControlModel).ToNot(BeNil()) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") + Expect(sccControlModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Profile).To(Equal(sccProfileModel)) + Expect(sccControlModel.ParentName).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Specifications).To(Equal([]catalogmanagementv1.SccSpecification{*sccSpecificationModel})) + Expect(sccControlModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + Expect(evaluatedControlModel).ToNot(BeNil()) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") + Expect(evaluatedControlModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(evaluatedControlModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(evaluatedControlModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(evaluatedControlModel.Specifications).To(Equal([]catalogmanagementv1.SccSpecification{*sccSpecificationModel})) + Expect(evaluatedControlModel.FailureCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(evaluatedControlModel.PassCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(evaluatedControlModel.Parent).To(Equal(sccControlModel)) + Expect(evaluatedControlModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + Expect(evaluationModel).ToNot(BeNil()) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} + Expect(evaluationModel.ScanID).To(Equal(core.StringPtr("testString"))) + Expect(evaluationModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(evaluationModel.Profile).To(Equal(sccProfileModel)) + Expect(evaluationModel.Result).To(Equal(resultModel)) + Expect(evaluationModel.Controls).To(Equal([]catalogmanagementv1.EvaluatedControl{*evaluatedControlModel})) + + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + Expect(complianceModel).ToNot(BeNil()) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} + Expect(complianceModel.Authority).To(Equal(core.StringPtr("testString"))) + Expect(complianceModel.Claims).To(Equal(claimsModel)) + Expect(complianceModel.Evaluations).To(Equal([]catalogmanagementv1.Evaluation{*evaluationModel})) + + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + Expect(changeNoticesModel).ToNot(BeNil()) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} + Expect(changeNoticesModel.Breaking).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(changeNoticesModel.New).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(changeNoticesModel.Update).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + Expect(versionModel).ToNot(BeNil()) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel + Expect(versionModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Flavor).To(Equal(flavorModel)) + Expect(versionModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(versionModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(versionModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.KindID).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Tags).To(Equal([]string{"testString"})) + Expect(versionModel.RepoURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.SourceURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.TgzURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Configuration).To(Equal([]catalogmanagementv1.Configuration{*configurationModel})) + Expect(versionModel.Outputs).To(Equal([]catalogmanagementv1.Output{*outputModel})) + Expect(versionModel.IamPermissions).To(Equal([]catalogmanagementv1.IamPermission{*iamPermissionModel})) + Expect(versionModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(versionModel.Validation).To(Equal(validationModel)) + Expect(versionModel.RequiredResources).To(Equal([]catalogmanagementv1.Resource{*resourceModel})) + Expect(versionModel.SingleInstance).To(Equal(core.BoolPtr(true))) + Expect(versionModel.SchematicsEnvValues).To(Equal(schematicsEnvValuesModel)) + Expect(versionModel.Install).To(Equal(scriptModel)) + Expect(versionModel.PreInstall).To(Equal([]catalogmanagementv1.Script{*scriptModel})) + Expect(versionModel.Entitlement).To(Equal(versionEntitlementModel)) + Expect(versionModel.Licenses).To(Equal([]catalogmanagementv1.License{*licenseModel})) + Expect(versionModel.ImageManifestURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Deprecated).To(Equal(core.BoolPtr(true))) + Expect(versionModel.PackageVersion).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.State).To(Equal(stateModel)) + Expect(versionModel.VersionLocator).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.LongDescription).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(versionModel.WhitelistedAccounts).To(Equal([]string{"testString"})) + Expect(versionModel.ImagePullKeyName).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(versionModel.SolutionInfo).To(Equal(solutionInfoModel)) + Expect(versionModel.IsConsumable).To(Equal(core.BoolPtr(true))) + Expect(versionModel.ComplianceV3).To(Equal(complianceModel)) + Expect(versionModel.ChangeNotices).To(Equal(changeNoticesModel)) + Expect(versionModel.PlanIds).To(Equal([]string{"testString"})) + Expect(versionModel.Stack).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(versionModel.Scripts["foo"]).To(Equal(*scriptRefModel)) + + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + Expect(paginationTokenLinkModel).ToNot(BeNil()) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + Expect(paginationTokenLinkModel.Href).To(Equal(core.StringPtr("testString"))) + Expect(paginationTokenLinkModel.Start).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + Expect(kindAllVersionsModel).ToNot(BeNil()) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + Expect(kindAllVersionsModel.First).To(Equal(paginationTokenLinkModel)) + Expect(kindAllVersionsModel.Next).To(Equal(paginationTokenLinkModel)) + + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + Expect(kindModel).ToNot(BeNil()) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel + Expect(kindModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.FormatKind).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.FormatKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.InstallKind).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.InstallKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.TargetKind).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.TargetKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(kindModel.Tags).To(Equal([]string{"testString"})) + Expect(kindModel.AdditionalFeatures).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(kindModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(kindModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(kindModel.Versions).To(Equal([]catalogmanagementv1.Version{*versionModel})) + Expect(kindModel.AllVersions).To(Equal(kindAllVersionsModel)) + + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + Expect(publishObjectModel).ToNot(BeNil()) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + Expect(providerInfoModel).ToNot(BeNil()) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") + Expect(providerInfoModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(providerInfoModel.Name).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + Expect(repoInfoModel).ToNot(BeNil()) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") + Expect(repoInfoModel.Token).To(Equal(core.StringPtr("testString"))) + Expect(repoInfoModel.Type).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + Expect(imagePullKeyModel).ToNot(BeNil()) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") + Expect(imagePullKeyModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(imagePullKeyModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(imagePullKeyModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + Expect(supportWaitTimeModel).ToNot(BeNil()) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") + Expect(supportWaitTimeModel.Value).To(Equal(core.Int64Ptr(int64(38)))) + Expect(supportWaitTimeModel.Type).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + Expect(supportTimeModel).ToNot(BeNil()) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") + Expect(supportTimeModel.Day).To(Equal(core.Int64Ptr(int64(38)))) + Expect(supportTimeModel.StartTime).To(Equal(core.StringPtr("testString"))) + Expect(supportTimeModel.EndTime).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + Expect(supportAvailabilityModel).ToNot(BeNil()) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) + Expect(supportAvailabilityModel.Times).To(Equal([]catalogmanagementv1.SupportTime{*supportTimeModel})) + Expect(supportAvailabilityModel.Timezone).To(Equal(core.StringPtr("testString"))) + Expect(supportAvailabilityModel.AlwaysAvailable).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + Expect(supportDetailModel).ToNot(BeNil()) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel + Expect(supportDetailModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(supportDetailModel.Contact).To(Equal(core.StringPtr("testString"))) + Expect(supportDetailModel.ResponseWaitTime).To(Equal(supportWaitTimeModel)) + Expect(supportDetailModel.Availability).To(Equal(supportAvailabilityModel)) + + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + Expect(supportEscalationModel).ToNot(BeNil()) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") + Expect(supportEscalationModel.EscalationWaitTime).To(Equal(supportWaitTimeModel)) + Expect(supportEscalationModel.ResponseWaitTime).To(Equal(supportWaitTimeModel)) + Expect(supportEscalationModel.Contact).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + Expect(supportModel).ToNot(BeNil()) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") + Expect(supportModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(supportModel.Process).To(Equal(core.StringPtr("testString"))) + Expect(supportModel.ProcessI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(supportModel.Locations).To(Equal([]string{"testString"})) + Expect(supportModel.SupportDetails).To(Equal([]catalogmanagementv1.SupportDetail{*supportDetailModel})) + Expect(supportModel.SupportEscalation).To(Equal(supportEscalationModel)) + Expect(supportModel.SupportType).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + Expect(learnMoreLinksModel).ToNot(BeNil()) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") + Expect(learnMoreLinksModel.FirstParty).To(Equal(core.StringPtr("testString"))) + Expect(learnMoreLinksModel.ThirdParty).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + Expect(constraintModel).ToNot(BeNil()) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" + Expect(constraintModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(constraintModel.Rule).To(Equal("testString")) + + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + Expect(badgeModel).ToNot(BeNil()) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + Expect(badgeModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(badgeModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(badgeModel.Icon).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.Authority).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.Tag).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.LearnMoreLinks).To(Equal(learnMoreLinksModel)) + Expect(badgeModel.Constraints).To(Equal([]catalogmanagementv1.Constraint{*constraintModel})) + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + Expect(versionRangeModel).ToNot(BeNil()) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + Expect(versionRangeModel.Kinds).To(Equal([]string{"testString"})) + Expect(versionRangeModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(versionRangeModel.Flavors).To(Equal([]string{"testString"})) + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + Expect(planModel).ToNot(BeNil()) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + Expect(planModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(planModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(planModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(planModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(planModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(planModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(planModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(planModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(planModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(planModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(planModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(planModel.PricingTags).To(Equal([]string{"testString"})) + Expect(planModel.VersionRange).To(Equal(versionRangeModel)) + Expect(planModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(planModel.State).To(Equal(stateModel)) + Expect(planModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(planModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(planModel.PublishApproved).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the CreateOfferingOptions model + catalogIdentifier := "testString" + createOfferingOptionsModel := catalogManagementService.NewCreateOfferingOptions(catalogIdentifier) + createOfferingOptionsModel.SetCatalogIdentifier("testString") + createOfferingOptionsModel.SetURL("testString") + createOfferingOptionsModel.SetCRN("testString") + createOfferingOptionsModel.SetLabel("testString") + createOfferingOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + createOfferingOptionsModel.SetName("testString") + createOfferingOptionsModel.SetOfferingIconURL("testString") + createOfferingOptionsModel.SetOfferingDocsURL("testString") + createOfferingOptionsModel.SetOfferingSupportURL("testString") + createOfferingOptionsModel.SetTags([]string{"testString"}) + createOfferingOptionsModel.SetKeywords([]string{"testString"}) + createOfferingOptionsModel.SetRating(ratingModel) + createOfferingOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + createOfferingOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + createOfferingOptionsModel.SetShortDescription("testString") + createOfferingOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + createOfferingOptionsModel.SetLongDescription("testString") + createOfferingOptionsModel.SetLongDescriptionI18n(map[string]string{"key1": "testString"}) + createOfferingOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) + createOfferingOptionsModel.SetKinds([]catalogmanagementv1.Kind{*kindModel}) + createOfferingOptionsModel.SetPublish(publishObjectModel) + createOfferingOptionsModel.SetPcManaged(true) + createOfferingOptionsModel.SetPublishApproved(true) + createOfferingOptionsModel.SetShareWithAll(true) + createOfferingOptionsModel.SetShareWithIBM(true) + createOfferingOptionsModel.SetShareEnabled(true) + createOfferingOptionsModel.SetPublicOriginalCRN("testString") + createOfferingOptionsModel.SetPublishPublicCRN("testString") + createOfferingOptionsModel.SetPortalApprovalRecord("testString") + createOfferingOptionsModel.SetPortalUIURL("testString") + createOfferingOptionsModel.SetCatalogID("testString") + createOfferingOptionsModel.SetCatalogName("testString") + createOfferingOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + createOfferingOptionsModel.SetDisclaimer("testString") + createOfferingOptionsModel.SetHidden(true) + createOfferingOptionsModel.SetProvider("testString") + createOfferingOptionsModel.SetProviderInfo(providerInfoModel) + createOfferingOptionsModel.SetRepoInfo(repoInfoModel) + createOfferingOptionsModel.SetImagePullKeys([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel}) + createOfferingOptionsModel.SetSupport(supportModel) + createOfferingOptionsModel.SetMedia([]catalogmanagementv1.MediaItem{*mediaItemModel}) + createOfferingOptionsModel.SetDeprecatePending(deprecatePendingModel) + createOfferingOptionsModel.SetProductKind("testString") + createOfferingOptionsModel.SetBadges([]catalogmanagementv1.Badge{*badgeModel}) + createOfferingOptionsModel.SetPlans([]catalogmanagementv1.Plan{*planModel}) + createOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(createOfferingOptionsModel).ToNot(BeNil()) + Expect(createOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createOfferingOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.OfferingIconURL).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.OfferingDocsURL).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.OfferingSupportURL).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(createOfferingOptionsModel.Keywords).To(Equal([]string{"testString"})) + Expect(createOfferingOptionsModel.Rating).To(Equal(ratingModel)) + Expect(createOfferingOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(createOfferingOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(createOfferingOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createOfferingOptionsModel.LongDescription).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(createOfferingOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(createOfferingOptionsModel.Kinds).To(Equal([]catalogmanagementv1.Kind{*kindModel})) + Expect(createOfferingOptionsModel.Publish).To(Equal(publishObjectModel)) + Expect(createOfferingOptionsModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(createOfferingOptionsModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(createOfferingOptionsModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(createOfferingOptionsModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(createOfferingOptionsModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(createOfferingOptionsModel.PublicOriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.PublishPublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.PortalApprovalRecord).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.PortalUIURL).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(createOfferingOptionsModel.Disclaimer).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.Hidden).To(Equal(core.BoolPtr(true))) + Expect(createOfferingOptionsModel.Provider).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.ProviderInfo).To(Equal(providerInfoModel)) + Expect(createOfferingOptionsModel.RepoInfo).To(Equal(repoInfoModel)) + Expect(createOfferingOptionsModel.ImagePullKeys).To(Equal([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel})) + Expect(createOfferingOptionsModel.Support).To(Equal(supportModel)) + Expect(createOfferingOptionsModel.Media).To(Equal([]catalogmanagementv1.MediaItem{*mediaItemModel})) + Expect(createOfferingOptionsModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(createOfferingOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingOptionsModel.Badges).To(Equal([]catalogmanagementv1.Badge{*badgeModel})) + Expect(createOfferingOptionsModel.Plans).To(Equal([]catalogmanagementv1.Plan{*planModel})) + Expect(createOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteCatalogOptions successfully`, func() { + // Construct an instance of the DeleteCatalogOptions model + catalogIdentifier := "testString" + deleteCatalogOptionsModel := catalogManagementService.NewDeleteCatalogOptions(catalogIdentifier) + deleteCatalogOptionsModel.SetCatalogIdentifier("testString") + deleteCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteCatalogOptionsModel).ToNot(BeNil()) + Expect(deleteCatalogOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteObjectAccessListOptions successfully`, func() { + // Construct an instance of the DeleteObjectAccessListOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + accesses := []string{"testString"} + deleteObjectAccessListOptionsModel := catalogManagementService.NewDeleteObjectAccessListOptions(catalogIdentifier, objectIdentifier, accesses) + deleteObjectAccessListOptionsModel.SetCatalogIdentifier("testString") + deleteObjectAccessListOptionsModel.SetObjectIdentifier("testString") + deleteObjectAccessListOptionsModel.SetAccesses([]string{"testString"}) + deleteObjectAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteObjectAccessListOptionsModel).ToNot(BeNil()) + Expect(deleteObjectAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectAccessListOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(deleteObjectAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteObjectAccessOptions successfully`, func() { + // Construct an instance of the DeleteObjectAccessOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + accessIdentifier := "testString" + deleteObjectAccessOptionsModel := catalogManagementService.NewDeleteObjectAccessOptions(catalogIdentifier, objectIdentifier, accessIdentifier) + deleteObjectAccessOptionsModel.SetCatalogIdentifier("testString") + deleteObjectAccessOptionsModel.SetObjectIdentifier("testString") + deleteObjectAccessOptionsModel.SetAccessIdentifier("testString") + deleteObjectAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteObjectAccessOptionsModel).ToNot(BeNil()) + Expect(deleteObjectAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectAccessOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteObjectOptions successfully`, func() { + // Construct an instance of the DeleteObjectOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + deleteObjectOptionsModel := catalogManagementService.NewDeleteObjectOptions(catalogIdentifier, objectIdentifier) + deleteObjectOptionsModel.SetCatalogIdentifier("testString") + deleteObjectOptionsModel.SetObjectIdentifier("testString") + deleteObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteObjectOptionsModel).ToNot(BeNil()) + Expect(deleteObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteOfferingAccessListOptions successfully`, func() { + // Construct an instance of the DeleteOfferingAccessListOptions model + catalogIdentifier := "testString" + offeringID := "testString" + accesses := []string{"testString"} + deleteOfferingAccessListOptionsModel := catalogManagementService.NewDeleteOfferingAccessListOptions(catalogIdentifier, offeringID, accesses) + deleteOfferingAccessListOptionsModel.SetCatalogIdentifier("testString") + deleteOfferingAccessListOptionsModel.SetOfferingID("testString") + deleteOfferingAccessListOptionsModel.SetAccesses([]string{"testString"}) + deleteOfferingAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteOfferingAccessListOptionsModel).ToNot(BeNil()) + Expect(deleteOfferingAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingAccessListOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingAccessListOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(deleteOfferingAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteOfferingInstanceOptions successfully`, func() { + // Construct an instance of the DeleteOfferingInstanceOptions model + instanceIdentifier := "testString" + xAuthRefreshToken := "testString" + deleteOfferingInstanceOptionsModel := catalogManagementService.NewDeleteOfferingInstanceOptions(instanceIdentifier, xAuthRefreshToken) + deleteOfferingInstanceOptionsModel.SetInstanceIdentifier("testString") + deleteOfferingInstanceOptionsModel.SetXAuthRefreshToken("testString") + deleteOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteOfferingInstanceOptionsModel).ToNot(BeNil()) + Expect(deleteOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteOfferingOptions successfully`, func() { + // Construct an instance of the DeleteOfferingOptions model + catalogIdentifier := "testString" + offeringID := "testString" + deleteOfferingOptionsModel := catalogManagementService.NewDeleteOfferingOptions(catalogIdentifier, offeringID) + deleteOfferingOptionsModel.SetCatalogIdentifier("testString") + deleteOfferingOptionsModel.SetOfferingID("testString") + deleteOfferingOptionsModel.SetXApproverToken("testString") + deleteOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteOfferingOptionsModel).ToNot(BeNil()) + Expect(deleteOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingOptionsModel.XApproverToken).To(Equal(core.StringPtr("testString"))) + Expect(deleteOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteOperatorsOptions successfully`, func() { + // Construct an instance of the DeleteOperatorsOptions model + xAuthRefreshToken := "testString" + clusterID := "testString" + region := "testString" + versionLocatorID := "testString" + deleteOperatorsOptionsModel := catalogManagementService.NewDeleteOperatorsOptions(xAuthRefreshToken, clusterID, region, versionLocatorID) + deleteOperatorsOptionsModel.SetXAuthRefreshToken("testString") + deleteOperatorsOptionsModel.SetClusterID("testString") + deleteOperatorsOptionsModel.SetRegion("testString") + deleteOperatorsOptionsModel.SetVersionLocatorID("testString") + deleteOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteOperatorsOptionsModel).ToNot(BeNil()) + Expect(deleteOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(deleteOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(deleteOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(deleteOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) + Expect(deleteOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeletePlanOptions successfully`, func() { + // Construct an instance of the DeletePlanOptions model + planLocID := "testString" + deletePlanOptionsModel := catalogManagementService.NewDeletePlanOptions(planLocID) + deletePlanOptionsModel.SetPlanLocID("testString") + deletePlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deletePlanOptionsModel).ToNot(BeNil()) + Expect(deletePlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) + Expect(deletePlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteShareApprovalListOptions successfully`, func() { + // Construct an instance of the DeleteShareApprovalListOptions model + objectType := "offering" + accesses := []string{"testString"} + deleteShareApprovalListOptionsModel := catalogManagementService.NewDeleteShareApprovalListOptions(objectType, accesses) + deleteShareApprovalListOptionsModel.SetObjectType("offering") + deleteShareApprovalListOptionsModel.SetAccesses([]string{"testString"}) + deleteShareApprovalListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteShareApprovalListOptionsModel).ToNot(BeNil()) + Expect(deleteShareApprovalListOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) + Expect(deleteShareApprovalListOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(deleteShareApprovalListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeleteVersionOptions successfully`, func() { + // Construct an instance of the DeleteVersionOptions model + versionLocID := "testString" + deleteVersionOptionsModel := catalogManagementService.NewDeleteVersionOptions(versionLocID) + deleteVersionOptionsModel.SetVersionLocID("testString") + deleteVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deleteVersionOptionsModel).ToNot(BeNil()) + Expect(deleteVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(deleteVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeployOperatorsOptions successfully`, func() { + // Construct an instance of the DeployOperatorsOptions model + xAuthRefreshToken := "testString" + deployOperatorsOptionsModel := catalogManagementService.NewDeployOperatorsOptions(xAuthRefreshToken) + deployOperatorsOptionsModel.SetXAuthRefreshToken("testString") + deployOperatorsOptionsModel.SetClusterID("testString") + deployOperatorsOptionsModel.SetRegion("testString") + deployOperatorsOptionsModel.SetNamespaces([]string{"testString"}) + deployOperatorsOptionsModel.SetAllNamespaces(true) + deployOperatorsOptionsModel.SetVersionLocatorID("testString") + deployOperatorsOptionsModel.SetChannel("testString") + deployOperatorsOptionsModel.SetInstallPlan("testString") + deployOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deployOperatorsOptionsModel).ToNot(BeNil()) + Expect(deployOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(deployOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(deployOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(deployOperatorsOptionsModel.Namespaces).To(Equal([]string{"testString"})) + Expect(deployOperatorsOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(deployOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) + Expect(deployOperatorsOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(deployOperatorsOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(deployOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeprecateOfferingOptions successfully`, func() { + // Construct an instance of the DeprecateOfferingOptions model + catalogIdentifier := "testString" + offeringID := "testString" + setting := "true" + deprecateOfferingOptionsModel := catalogManagementService.NewDeprecateOfferingOptions(catalogIdentifier, offeringID, setting) + deprecateOfferingOptionsModel.SetCatalogIdentifier("testString") + deprecateOfferingOptionsModel.SetOfferingID("testString") + deprecateOfferingOptionsModel.SetSetting("true") + deprecateOfferingOptionsModel.SetDescription("testString") + deprecateOfferingOptionsModel.SetDaysUntilDeprecate(int64(38)) + deprecateOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deprecateOfferingOptionsModel).ToNot(BeNil()) + Expect(deprecateOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(deprecateOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(deprecateOfferingOptionsModel.Setting).To(Equal(core.StringPtr("true"))) + Expect(deprecateOfferingOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(deprecateOfferingOptionsModel.DaysUntilDeprecate).To(Equal(core.Int64Ptr(int64(38)))) + Expect(deprecateOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewDeprecateVersionOptions successfully`, func() { + // Construct an instance of the DeprecateVersionOptions model + versionLocID := "testString" + deprecateVersionOptionsModel := catalogManagementService.NewDeprecateVersionOptions(versionLocID) + deprecateVersionOptionsModel.SetVersionLocID("testString") + deprecateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(deprecateVersionOptionsModel).ToNot(BeNil()) + Expect(deprecateVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(deprecateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetCatalogAccountAuditOptions successfully`, func() { + // Construct an instance of the GetCatalogAccountAuditOptions model + auditlogIdentifier := "testString" + getCatalogAccountAuditOptionsModel := catalogManagementService.NewGetCatalogAccountAuditOptions(auditlogIdentifier) + getCatalogAccountAuditOptionsModel.SetAuditlogIdentifier("testString") + getCatalogAccountAuditOptionsModel.SetLookupnames(true) + getCatalogAccountAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getCatalogAccountAuditOptionsModel).ToNot(BeNil()) + Expect(getCatalogAccountAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getCatalogAccountAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(getCatalogAccountAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetCatalogAccountFiltersOptions successfully`, func() { + // Construct an instance of the GetCatalogAccountFiltersOptions model + getCatalogAccountFiltersOptionsModel := catalogManagementService.NewGetCatalogAccountFiltersOptions() + getCatalogAccountFiltersOptionsModel.SetCatalog("testString") + getCatalogAccountFiltersOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getCatalogAccountFiltersOptionsModel).ToNot(BeNil()) + Expect(getCatalogAccountFiltersOptionsModel.Catalog).To(Equal(core.StringPtr("testString"))) + Expect(getCatalogAccountFiltersOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetCatalogAccountOptions successfully`, func() { + // Construct an instance of the GetCatalogAccountOptions model + getCatalogAccountOptionsModel := catalogManagementService.NewGetCatalogAccountOptions() + getCatalogAccountOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getCatalogAccountOptionsModel).ToNot(BeNil()) + Expect(getCatalogAccountOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetCatalogAuditOptions successfully`, func() { + // Construct an instance of the GetCatalogAuditOptions model + catalogIdentifier := "testString" + auditlogIdentifier := "testString" + getCatalogAuditOptionsModel := catalogManagementService.NewGetCatalogAuditOptions(catalogIdentifier, auditlogIdentifier) + getCatalogAuditOptionsModel.SetCatalogIdentifier("testString") + getCatalogAuditOptionsModel.SetAuditlogIdentifier("testString") + getCatalogAuditOptionsModel.SetLookupnames(true) + getCatalogAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getCatalogAuditOptionsModel).ToNot(BeNil()) + Expect(getCatalogAuditOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getCatalogAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getCatalogAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(getCatalogAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetCatalogOptions successfully`, func() { + // Construct an instance of the GetCatalogOptions model + catalogIdentifier := "testString" + getCatalogOptionsModel := catalogManagementService.NewGetCatalogOptions(catalogIdentifier) + getCatalogOptionsModel.SetCatalogIdentifier("testString") + getCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getCatalogOptionsModel).ToNot(BeNil()) + Expect(getCatalogOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetClusterOptions successfully`, func() { + // Construct an instance of the GetClusterOptions model + clusterID := "testString" + region := "testString" + xAuthRefreshToken := "testString" + getClusterOptionsModel := catalogManagementService.NewGetClusterOptions(clusterID, region, xAuthRefreshToken) + getClusterOptionsModel.SetClusterID("testString") + getClusterOptionsModel.SetRegion("testString") + getClusterOptionsModel.SetXAuthRefreshToken("testString") + getClusterOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getClusterOptionsModel).ToNot(BeNil()) + Expect(getClusterOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(getClusterOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(getClusterOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(getClusterOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetConsumptionOfferingsOptions successfully`, func() { + // Construct an instance of the GetConsumptionOfferingsOptions model + getConsumptionOfferingsOptionsModel := catalogManagementService.NewGetConsumptionOfferingsOptions() + getConsumptionOfferingsOptionsModel.SetDigest(true) + getConsumptionOfferingsOptionsModel.SetCatalog("testString") + getConsumptionOfferingsOptionsModel.SetSelect("all") + getConsumptionOfferingsOptionsModel.SetIncludeHidden(true) + getConsumptionOfferingsOptionsModel.SetLimit(int64(10)) + getConsumptionOfferingsOptionsModel.SetOffset(int64(0)) + getConsumptionOfferingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getConsumptionOfferingsOptionsModel).ToNot(BeNil()) + Expect(getConsumptionOfferingsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) + Expect(getConsumptionOfferingsOptionsModel.Catalog).To(Equal(core.StringPtr("testString"))) + Expect(getConsumptionOfferingsOptionsModel.Select).To(Equal(core.StringPtr("all"))) + Expect(getConsumptionOfferingsOptionsModel.IncludeHidden).To(Equal(core.BoolPtr(true))) + Expect(getConsumptionOfferingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getConsumptionOfferingsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(getConsumptionOfferingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetEnterpriseAuditOptions successfully`, func() { + // Construct an instance of the GetEnterpriseAuditOptions model + enterpriseIdentifier := "testString" + auditlogIdentifier := "testString" + getEnterpriseAuditOptionsModel := catalogManagementService.NewGetEnterpriseAuditOptions(enterpriseIdentifier, auditlogIdentifier) + getEnterpriseAuditOptionsModel.SetEnterpriseIdentifier("testString") + getEnterpriseAuditOptionsModel.SetAuditlogIdentifier("testString") + getEnterpriseAuditOptionsModel.SetLookupnames(true) + getEnterpriseAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getEnterpriseAuditOptionsModel).ToNot(BeNil()) + Expect(getEnterpriseAuditOptionsModel.EnterpriseIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getEnterpriseAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getEnterpriseAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(getEnterpriseAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetIamPermissionsOptions successfully`, func() { + // Construct an instance of the GetIamPermissionsOptions model + versionLocID := "testString" + getIamPermissionsOptionsModel := catalogManagementService.NewGetIamPermissionsOptions(versionLocID) + getIamPermissionsOptionsModel.SetVersionLocID("testString") + getIamPermissionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getIamPermissionsOptionsModel).ToNot(BeNil()) + Expect(getIamPermissionsOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getIamPermissionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetNamespacesOptions successfully`, func() { + // Construct an instance of the GetNamespacesOptions model + clusterID := "testString" + region := "testString" + xAuthRefreshToken := "testString" + getNamespacesOptionsModel := catalogManagementService.NewGetNamespacesOptions(clusterID, region, xAuthRefreshToken) + getNamespacesOptionsModel.SetClusterID("testString") + getNamespacesOptionsModel.SetRegion("testString") + getNamespacesOptionsModel.SetXAuthRefreshToken("testString") + getNamespacesOptionsModel.SetLimit(int64(10)) + getNamespacesOptionsModel.SetOffset(int64(0)) + getNamespacesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getNamespacesOptionsModel).ToNot(BeNil()) + Expect(getNamespacesOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(getNamespacesOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(getNamespacesOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(getNamespacesOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getNamespacesOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(getNamespacesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetObjectAccessListDeprecatedOptions successfully`, func() { + // Construct an instance of the GetObjectAccessListDeprecatedOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + getObjectAccessListDeprecatedOptionsModel := catalogManagementService.NewGetObjectAccessListDeprecatedOptions(catalogIdentifier, objectIdentifier) + getObjectAccessListDeprecatedOptionsModel.SetCatalogIdentifier("testString") + getObjectAccessListDeprecatedOptionsModel.SetObjectIdentifier("testString") + getObjectAccessListDeprecatedOptionsModel.SetLimit(int64(10)) + getObjectAccessListDeprecatedOptionsModel.SetOffset(int64(0)) + getObjectAccessListDeprecatedOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getObjectAccessListDeprecatedOptionsModel).ToNot(BeNil()) + Expect(getObjectAccessListDeprecatedOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessListDeprecatedOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessListDeprecatedOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getObjectAccessListDeprecatedOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(getObjectAccessListDeprecatedOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetObjectAccessListOptions successfully`, func() { + // Construct an instance of the GetObjectAccessListOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + getObjectAccessListOptionsModel := catalogManagementService.NewGetObjectAccessListOptions(catalogIdentifier, objectIdentifier) + getObjectAccessListOptionsModel.SetCatalogIdentifier("testString") + getObjectAccessListOptionsModel.SetObjectIdentifier("testString") + getObjectAccessListOptionsModel.SetStart("testString") + getObjectAccessListOptionsModel.SetLimit(int64(10)) + getObjectAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getObjectAccessListOptionsModel).ToNot(BeNil()) + Expect(getObjectAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessListOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessListOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessListOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getObjectAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetObjectAccessOptions successfully`, func() { + // Construct an instance of the GetObjectAccessOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + accessIdentifier := "testString" + getObjectAccessOptionsModel := catalogManagementService.NewGetObjectAccessOptions(catalogIdentifier, objectIdentifier, accessIdentifier) + getObjectAccessOptionsModel.SetCatalogIdentifier("testString") + getObjectAccessOptionsModel.SetObjectIdentifier("testString") + getObjectAccessOptionsModel.SetAccessIdentifier("testString") + getObjectAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getObjectAccessOptionsModel).ToNot(BeNil()) + Expect(getObjectAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetObjectAuditOptions successfully`, func() { + // Construct an instance of the GetObjectAuditOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + auditlogIdentifier := "testString" + getObjectAuditOptionsModel := catalogManagementService.NewGetObjectAuditOptions(catalogIdentifier, objectIdentifier, auditlogIdentifier) + getObjectAuditOptionsModel.SetCatalogIdentifier("testString") + getObjectAuditOptionsModel.SetObjectIdentifier("testString") + getObjectAuditOptionsModel.SetAuditlogIdentifier("testString") + getObjectAuditOptionsModel.SetLookupnames(true) + getObjectAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getObjectAuditOptionsModel).ToNot(BeNil()) + Expect(getObjectAuditOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAuditOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(getObjectAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetObjectOptions successfully`, func() { + // Construct an instance of the GetObjectOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + getObjectOptionsModel := catalogManagementService.NewGetObjectOptions(catalogIdentifier, objectIdentifier) + getObjectOptionsModel.SetCatalogIdentifier("testString") + getObjectOptionsModel.SetObjectIdentifier("testString") + getObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getObjectOptionsModel).ToNot(BeNil()) + Expect(getObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingAboutOptions successfully`, func() { + // Construct an instance of the GetOfferingAboutOptions model + versionLocID := "testString" + getOfferingAboutOptionsModel := catalogManagementService.NewGetOfferingAboutOptions(versionLocID) + getOfferingAboutOptionsModel.SetVersionLocID("testString") + getOfferingAboutOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingAboutOptionsModel).ToNot(BeNil()) + Expect(getOfferingAboutOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAboutOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingAccessListOptions successfully`, func() { + // Construct an instance of the GetOfferingAccessListOptions model + catalogIdentifier := "testString" + offeringID := "testString" + getOfferingAccessListOptionsModel := catalogManagementService.NewGetOfferingAccessListOptions(catalogIdentifier, offeringID) + getOfferingAccessListOptionsModel.SetCatalogIdentifier("testString") + getOfferingAccessListOptionsModel.SetOfferingID("testString") + getOfferingAccessListOptionsModel.SetStart("testString") + getOfferingAccessListOptionsModel.SetLimit(int64(10)) + getOfferingAccessListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingAccessListOptionsModel).ToNot(BeNil()) + Expect(getOfferingAccessListOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAccessListOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAccessListOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAccessListOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getOfferingAccessListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingAccessOptions successfully`, func() { + // Construct an instance of the GetOfferingAccessOptions model + catalogIdentifier := "testString" + offeringID := "testString" + accessIdentifier := "testString" + getOfferingAccessOptionsModel := catalogManagementService.NewGetOfferingAccessOptions(catalogIdentifier, offeringID, accessIdentifier) + getOfferingAccessOptionsModel.SetCatalogIdentifier("testString") + getOfferingAccessOptionsModel.SetOfferingID("testString") + getOfferingAccessOptionsModel.SetAccessIdentifier("testString") + getOfferingAccessOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingAccessOptionsModel).ToNot(BeNil()) + Expect(getOfferingAccessOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAccessOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAccessOptionsModel.AccessIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAccessOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingAuditOptions successfully`, func() { + // Construct an instance of the GetOfferingAuditOptions model + catalogIdentifier := "testString" + offeringID := "testString" + auditlogIdentifier := "testString" + getOfferingAuditOptionsModel := catalogManagementService.NewGetOfferingAuditOptions(catalogIdentifier, offeringID, auditlogIdentifier) + getOfferingAuditOptionsModel.SetCatalogIdentifier("testString") + getOfferingAuditOptionsModel.SetOfferingID("testString") + getOfferingAuditOptionsModel.SetAuditlogIdentifier("testString") + getOfferingAuditOptionsModel.SetLookupnames(true) + getOfferingAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingAuditOptionsModel).ToNot(BeNil()) + Expect(getOfferingAuditOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAuditOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(getOfferingAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingChangeNoticesOptions successfully`, func() { + // Construct an instance of the GetOfferingChangeNoticesOptions model + catalogIdentifier := "testString" + offeringID := "testString" + kind := "testString" + getOfferingChangeNoticesOptionsModel := catalogManagementService.NewGetOfferingChangeNoticesOptions(catalogIdentifier, offeringID, kind) + getOfferingChangeNoticesOptionsModel.SetCatalogIdentifier("testString") + getOfferingChangeNoticesOptionsModel.SetOfferingID("testString") + getOfferingChangeNoticesOptionsModel.SetKind("testString") + getOfferingChangeNoticesOptionsModel.SetTarget("testString") + getOfferingChangeNoticesOptionsModel.SetVersion("testString") + getOfferingChangeNoticesOptionsModel.SetFlavor("testString") + getOfferingChangeNoticesOptionsModel.SetVersions("latest") + getOfferingChangeNoticesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingChangeNoticesOptionsModel).ToNot(BeNil()) + Expect(getOfferingChangeNoticesOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingChangeNoticesOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingChangeNoticesOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingChangeNoticesOptionsModel.Target).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingChangeNoticesOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingChangeNoticesOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingChangeNoticesOptionsModel.Versions).To(Equal(core.StringPtr("latest"))) + Expect(getOfferingChangeNoticesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingContainerImagesOptions successfully`, func() { + // Construct an instance of the GetOfferingContainerImagesOptions model + versionLocID := "testString" + getOfferingContainerImagesOptionsModel := catalogManagementService.NewGetOfferingContainerImagesOptions(versionLocID) + getOfferingContainerImagesOptionsModel.SetVersionLocID("testString") + getOfferingContainerImagesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingContainerImagesOptionsModel).ToNot(BeNil()) + Expect(getOfferingContainerImagesOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingContainerImagesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingInstanceAuditOptions successfully`, func() { + // Construct an instance of the GetOfferingInstanceAuditOptions model + instanceIdentifier := "testString" + auditlogIdentifier := "testString" + getOfferingInstanceAuditOptionsModel := catalogManagementService.NewGetOfferingInstanceAuditOptions(instanceIdentifier, auditlogIdentifier) + getOfferingInstanceAuditOptionsModel.SetInstanceIdentifier("testString") + getOfferingInstanceAuditOptionsModel.SetAuditlogIdentifier("testString") + getOfferingInstanceAuditOptionsModel.SetLookupnames(true) + getOfferingInstanceAuditOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingInstanceAuditOptionsModel).ToNot(BeNil()) + Expect(getOfferingInstanceAuditOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingInstanceAuditOptionsModel.AuditlogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingInstanceAuditOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(getOfferingInstanceAuditOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingInstanceOptions successfully`, func() { + // Construct an instance of the GetOfferingInstanceOptions model + instanceIdentifier := "testString" + getOfferingInstanceOptionsModel := catalogManagementService.NewGetOfferingInstanceOptions(instanceIdentifier) + getOfferingInstanceOptionsModel.SetInstanceIdentifier("testString") + getOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingInstanceOptionsModel).ToNot(BeNil()) + Expect(getOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingLicenseOptions successfully`, func() { + // Construct an instance of the GetOfferingLicenseOptions model + versionLocID := "testString" + licenseID := "testString" + getOfferingLicenseOptionsModel := catalogManagementService.NewGetOfferingLicenseOptions(versionLocID, licenseID) + getOfferingLicenseOptionsModel.SetVersionLocID("testString") + getOfferingLicenseOptionsModel.SetLicenseID("testString") + getOfferingLicenseOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingLicenseOptionsModel).ToNot(BeNil()) + Expect(getOfferingLicenseOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingLicenseOptionsModel.LicenseID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingLicenseOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingOptions successfully`, func() { + // Construct an instance of the GetOfferingOptions model + catalogIdentifier := "testString" + offeringID := "testString" + getOfferingOptionsModel := catalogManagementService.NewGetOfferingOptions(catalogIdentifier, offeringID) + getOfferingOptionsModel.SetCatalogIdentifier("testString") + getOfferingOptionsModel.SetOfferingID("testString") + getOfferingOptionsModel.SetType("testString") + getOfferingOptionsModel.SetDigest(true) + getOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingOptionsModel).ToNot(BeNil()) + Expect(getOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingOptionsModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingOptionsModel.Digest).To(Equal(core.BoolPtr(true))) + Expect(getOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingSourceArchiveOptions successfully`, func() { + // Construct an instance of the GetOfferingSourceArchiveOptions model + version := "testString" + getOfferingSourceArchiveOptionsModel := catalogManagementService.NewGetOfferingSourceArchiveOptions(version) + getOfferingSourceArchiveOptionsModel.SetVersion("testString") + getOfferingSourceArchiveOptionsModel.SetAccept("application/yaml") + getOfferingSourceArchiveOptionsModel.SetCatalogID("testString") + getOfferingSourceArchiveOptionsModel.SetName("testString") + getOfferingSourceArchiveOptionsModel.SetID("testString") + getOfferingSourceArchiveOptionsModel.SetKind("testString") + getOfferingSourceArchiveOptionsModel.SetChannel("testString") + getOfferingSourceArchiveOptionsModel.SetFlavor("testString") + getOfferingSourceArchiveOptionsModel.SetAsIs(true) + getOfferingSourceArchiveOptionsModel.SetInstallType("testString") + getOfferingSourceArchiveOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingSourceArchiveOptionsModel).ToNot(BeNil()) + Expect(getOfferingSourceArchiveOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.Accept).To(Equal(core.StringPtr("application/yaml"))) + Expect(getOfferingSourceArchiveOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.AsIs).To(Equal(core.BoolPtr(true))) + Expect(getOfferingSourceArchiveOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceArchiveOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingSourceOptions successfully`, func() { + // Construct an instance of the GetOfferingSourceOptions model + version := "testString" + getOfferingSourceOptionsModel := catalogManagementService.NewGetOfferingSourceOptions(version) + getOfferingSourceOptionsModel.SetVersion("testString") + getOfferingSourceOptionsModel.SetAccept("application/yaml") + getOfferingSourceOptionsModel.SetCatalogID("testString") + getOfferingSourceOptionsModel.SetName("testString") + getOfferingSourceOptionsModel.SetID("testString") + getOfferingSourceOptionsModel.SetKind("testString") + getOfferingSourceOptionsModel.SetChannel("testString") + getOfferingSourceOptionsModel.SetFlavor("testString") + getOfferingSourceOptionsModel.SetAsIs(true) + getOfferingSourceOptionsModel.SetInstallType("testString") + getOfferingSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingSourceOptionsModel).ToNot(BeNil()) + Expect(getOfferingSourceOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.Accept).To(Equal(core.StringPtr("application/yaml"))) + Expect(getOfferingSourceOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.AsIs).To(Equal(core.BoolPtr(true))) + Expect(getOfferingSourceOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingSourceURLOptions successfully`, func() { + // Construct an instance of the GetOfferingSourceURLOptions model + keyIdentifier := "testString" + getOfferingSourceURLOptionsModel := catalogManagementService.NewGetOfferingSourceURLOptions(keyIdentifier) + getOfferingSourceURLOptionsModel.SetKeyIdentifier("testString") + getOfferingSourceURLOptionsModel.SetAccept("application/yaml") + getOfferingSourceURLOptionsModel.SetCatalogID("testString") + getOfferingSourceURLOptionsModel.SetName("testString") + getOfferingSourceURLOptionsModel.SetID("testString") + getOfferingSourceURLOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingSourceURLOptionsModel).ToNot(BeNil()) + Expect(getOfferingSourceURLOptionsModel.KeyIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceURLOptionsModel.Accept).To(Equal(core.StringPtr("application/yaml"))) + Expect(getOfferingSourceURLOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceURLOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceURLOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingSourceURLOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingStatsOptions successfully`, func() { + // Construct an instance of the GetOfferingStatsOptions model + catalogIdentifier := "testString" + offeringID := "testString" + getOfferingStatsOptionsModel := catalogManagementService.NewGetOfferingStatsOptions(catalogIdentifier, offeringID) + getOfferingStatsOptionsModel.SetCatalogIdentifier("testString") + getOfferingStatsOptionsModel.SetOfferingID("testString") + getOfferingStatsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingStatsOptionsModel).ToNot(BeNil()) + Expect(getOfferingStatsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingStatsOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingStatsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingUpdatesOptions successfully`, func() { + // Construct an instance of the GetOfferingUpdatesOptions model + catalogIdentifier := "testString" + offeringID := "testString" + kind := "testString" + xAuthRefreshToken := "testString" + getOfferingUpdatesOptionsModel := catalogManagementService.NewGetOfferingUpdatesOptions(catalogIdentifier, offeringID, kind, xAuthRefreshToken) + getOfferingUpdatesOptionsModel.SetCatalogIdentifier("testString") + getOfferingUpdatesOptionsModel.SetOfferingID("testString") + getOfferingUpdatesOptionsModel.SetKind("testString") + getOfferingUpdatesOptionsModel.SetXAuthRefreshToken("testString") + getOfferingUpdatesOptionsModel.SetTarget("testString") + getOfferingUpdatesOptionsModel.SetVersion("testString") + getOfferingUpdatesOptionsModel.SetClusterID("testString") + getOfferingUpdatesOptionsModel.SetRegion("testString") + getOfferingUpdatesOptionsModel.SetResourceGroupID("testString") + getOfferingUpdatesOptionsModel.SetNamespace("testString") + getOfferingUpdatesOptionsModel.SetSha("testString") + getOfferingUpdatesOptionsModel.SetChannel("testString") + getOfferingUpdatesOptionsModel.SetNamespaces([]string{"testString"}) + getOfferingUpdatesOptionsModel.SetAllNamespaces(true) + getOfferingUpdatesOptionsModel.SetFlavor("testString") + getOfferingUpdatesOptionsModel.SetInstallType("testString") + getOfferingUpdatesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingUpdatesOptionsModel).ToNot(BeNil()) + Expect(getOfferingUpdatesOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Target).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Namespaces).To(Equal([]string{"testString"})) + Expect(getOfferingUpdatesOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(getOfferingUpdatesOptionsModel.Flavor).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingUpdatesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetOfferingWorkingCopyOptions successfully`, func() { + // Construct an instance of the GetOfferingWorkingCopyOptions model + versionLocID := "testString" + getOfferingWorkingCopyOptionsModel := catalogManagementService.NewGetOfferingWorkingCopyOptions(versionLocID) + getOfferingWorkingCopyOptionsModel.SetVersionLocID("testString") + getOfferingWorkingCopyOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getOfferingWorkingCopyOptionsModel).ToNot(BeNil()) + Expect(getOfferingWorkingCopyOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getOfferingWorkingCopyOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetPlanOptions successfully`, func() { + // Construct an instance of the GetPlanOptions model + planLocID := "testString" + getPlanOptionsModel := catalogManagementService.NewGetPlanOptions(planLocID) + getPlanOptionsModel.SetPlanLocID("testString") + getPlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getPlanOptionsModel).ToNot(BeNil()) + Expect(getPlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) + Expect(getPlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetPreinstallOptions successfully`, func() { + // Construct an instance of the GetPreinstallOptions model + versionLocID := "testString" + xAuthRefreshToken := "testString" + getPreinstallOptionsModel := catalogManagementService.NewGetPreinstallOptions(versionLocID, xAuthRefreshToken) + getPreinstallOptionsModel.SetVersionLocID("testString") + getPreinstallOptionsModel.SetXAuthRefreshToken("testString") + getPreinstallOptionsModel.SetClusterID("testString") + getPreinstallOptionsModel.SetRegion("testString") + getPreinstallOptionsModel.SetNamespace("testString") + getPreinstallOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getPreinstallOptionsModel).ToNot(BeNil()) + Expect(getPreinstallOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getPreinstallOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(getPreinstallOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(getPreinstallOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(getPreinstallOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) + Expect(getPreinstallOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetShareApprovalListAsSourceOptions successfully`, func() { + // Construct an instance of the GetShareApprovalListAsSourceOptions model + objectType := "offering" + approvalStateIdentifier := "approved" + getShareApprovalListAsSourceOptionsModel := catalogManagementService.NewGetShareApprovalListAsSourceOptions(objectType, approvalStateIdentifier) + getShareApprovalListAsSourceOptionsModel.SetObjectType("offering") + getShareApprovalListAsSourceOptionsModel.SetApprovalStateIdentifier("approved") + getShareApprovalListAsSourceOptionsModel.SetStart("testString") + getShareApprovalListAsSourceOptionsModel.SetLimit(int64(10)) + getShareApprovalListAsSourceOptionsModel.SetEnterpriseID("testString") + getShareApprovalListAsSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getShareApprovalListAsSourceOptionsModel).ToNot(BeNil()) + Expect(getShareApprovalListAsSourceOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) + Expect(getShareApprovalListAsSourceOptionsModel.ApprovalStateIdentifier).To(Equal(core.StringPtr("approved"))) + Expect(getShareApprovalListAsSourceOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(getShareApprovalListAsSourceOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getShareApprovalListAsSourceOptionsModel.EnterpriseID).To(Equal(core.StringPtr("testString"))) + Expect(getShareApprovalListAsSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetShareApprovalListOptions successfully`, func() { + // Construct an instance of the GetShareApprovalListOptions model + objectType := "offering" + getShareApprovalListOptionsModel := catalogManagementService.NewGetShareApprovalListOptions(objectType) + getShareApprovalListOptionsModel.SetObjectType("offering") + getShareApprovalListOptionsModel.SetStart("testString") + getShareApprovalListOptionsModel.SetLimit(int64(10)) + getShareApprovalListOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getShareApprovalListOptionsModel).ToNot(BeNil()) + Expect(getShareApprovalListOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) + Expect(getShareApprovalListOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(getShareApprovalListOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getShareApprovalListOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetValidationStatusOptions successfully`, func() { + // Construct an instance of the GetValidationStatusOptions model + versionLocID := "testString" + xAuthRefreshToken := "testString" + getValidationStatusOptionsModel := catalogManagementService.NewGetValidationStatusOptions(versionLocID, xAuthRefreshToken) + getValidationStatusOptionsModel.SetVersionLocID("testString") + getValidationStatusOptionsModel.SetXAuthRefreshToken("testString") + getValidationStatusOptionsModel.SetTargetContextName("testString") + getValidationStatusOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getValidationStatusOptionsModel).ToNot(BeNil()) + Expect(getValidationStatusOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getValidationStatusOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(getValidationStatusOptionsModel.TargetContextName).To(Equal(core.StringPtr("testString"))) + Expect(getValidationStatusOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetVersionDependenciesOptions successfully`, func() { + // Construct an instance of the GetVersionDependenciesOptions model + versionLocID := "testString" + getVersionDependenciesOptionsModel := catalogManagementService.NewGetVersionDependenciesOptions(versionLocID) + getVersionDependenciesOptionsModel.SetVersionLocID("testString") + getVersionDependenciesOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getVersionDependenciesOptionsModel).ToNot(BeNil()) + Expect(getVersionDependenciesOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getVersionDependenciesOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetVersionOptions successfully`, func() { + // Construct an instance of the GetVersionOptions model + versionLocID := "testString" + getVersionOptionsModel := catalogManagementService.NewGetVersionOptions(versionLocID) + getVersionOptionsModel.SetVersionLocID("testString") + getVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getVersionOptionsModel).ToNot(BeNil()) + Expect(getVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(getVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewGetVersionsOptions successfully`, func() { + // Construct an instance of the GetVersionsOptions model + catalogIdentifier := "testString" + offeringID := "testString" + kindID := "testString" + getVersionsOptionsModel := catalogManagementService.NewGetVersionsOptions(catalogIdentifier, offeringID, kindID) + getVersionsOptionsModel.SetCatalogIdentifier("testString") + getVersionsOptionsModel.SetOfferingID("testString") + getVersionsOptionsModel.SetKindID("testString") + getVersionsOptionsModel.SetDigest(true) + getVersionsOptionsModel.SetCatalog(true) + getVersionsOptionsModel.SetStart("testString") + getVersionsOptionsModel.SetLimit(int64(10)) + getVersionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(getVersionsOptionsModel).ToNot(BeNil()) + Expect(getVersionsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(getVersionsOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(getVersionsOptionsModel.KindID).To(Equal(core.StringPtr("testString"))) + Expect(getVersionsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) + Expect(getVersionsOptionsModel.Catalog).To(Equal(core.BoolPtr(true))) + Expect(getVersionsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(getVersionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(getVersionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewImportOfferingOptions successfully`, func() { + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + Expect(flavorModel).ToNot(BeNil()) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) + Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the ImportOfferingBodyMetadataOperatingSystem model + importOfferingBodyMetadataOperatingSystemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataOperatingSystem) + Expect(importOfferingBodyMetadataOperatingSystemModel).ToNot(BeNil()) + importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly = core.BoolPtr(true) + importOfferingBodyMetadataOperatingSystemModel.Vendor = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Name = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Href = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.DisplayName = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Family = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Version = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Architecture = core.StringPtr("testString") + Expect(importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly).To(Equal(core.BoolPtr(true))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Vendor).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Href).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.DisplayName).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Family).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Architecture).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ImportOfferingBodyMetadataFile model + importOfferingBodyMetadataFileModel := new(catalogmanagementv1.ImportOfferingBodyMetadataFile) + Expect(importOfferingBodyMetadataFileModel).ToNot(BeNil()) + importOfferingBodyMetadataFileModel.Size = core.Int64Ptr(int64(38)) + Expect(importOfferingBodyMetadataFileModel.Size).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the ImportOfferingBodyMetadataImagesItem model + importOfferingBodyMetadataImagesItemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataImagesItem) + Expect(importOfferingBodyMetadataImagesItemModel).ToNot(BeNil()) + importOfferingBodyMetadataImagesItemModel.ID = core.StringPtr("testString") + importOfferingBodyMetadataImagesItemModel.Name = core.StringPtr("testString") + importOfferingBodyMetadataImagesItemModel.Region = core.StringPtr("testString") + Expect(importOfferingBodyMetadataImagesItemModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataImagesItemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataImagesItemModel.Region).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ImportOfferingBodyMetadata model + importOfferingBodyMetadataModel := new(catalogmanagementv1.ImportOfferingBodyMetadata) + Expect(importOfferingBodyMetadataModel).ToNot(BeNil()) + importOfferingBodyMetadataModel.OperatingSystem = importOfferingBodyMetadataOperatingSystemModel + importOfferingBodyMetadataModel.File = importOfferingBodyMetadataFileModel + importOfferingBodyMetadataModel.MinimumProvisionedSize = core.Int64Ptr(int64(38)) + importOfferingBodyMetadataModel.Images = []catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel} + Expect(importOfferingBodyMetadataModel.OperatingSystem).To(Equal(importOfferingBodyMetadataOperatingSystemModel)) + Expect(importOfferingBodyMetadataModel.File).To(Equal(importOfferingBodyMetadataFileModel)) + Expect(importOfferingBodyMetadataModel.MinimumProvisionedSize).To(Equal(core.Int64Ptr(int64(38)))) + Expect(importOfferingBodyMetadataModel.Images).To(Equal([]catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel})) + + // Construct an instance of the ImportOfferingOptions model + catalogIdentifier := "testString" + importOfferingOptionsModel := catalogManagementService.NewImportOfferingOptions(catalogIdentifier) + importOfferingOptionsModel.SetCatalogIdentifier("testString") + importOfferingOptionsModel.SetTags([]string{"testString"}) + importOfferingOptionsModel.SetKeywords([]string{"testString"}) + importOfferingOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) + importOfferingOptionsModel.SetName("testString") + importOfferingOptionsModel.SetLabel("testString") + importOfferingOptionsModel.SetInstallKind("testString") + importOfferingOptionsModel.SetTargetKinds([]string{"testString"}) + importOfferingOptionsModel.SetFormatKind("testString") + importOfferingOptionsModel.SetProductKind("testString") + importOfferingOptionsModel.SetProductKindLabel("testString") + importOfferingOptionsModel.SetSha("testString") + importOfferingOptionsModel.SetVersion("testString") + importOfferingOptionsModel.SetFlavor(flavorModel) + importOfferingOptionsModel.SetMetadata(importOfferingBodyMetadataModel) + importOfferingOptionsModel.SetWorkingDirectory("testString") + importOfferingOptionsModel.SetInstallType("testString") + importOfferingOptionsModel.SetZipurl("testString") + importOfferingOptionsModel.SetOfferingID("testString") + importOfferingOptionsModel.SetTargetVersion("testString") + importOfferingOptionsModel.SetIncludeConfig(true) + importOfferingOptionsModel.SetIsVsi(true) + importOfferingOptionsModel.SetRepotype("testString") + importOfferingOptionsModel.SetXAuthToken("testString") + importOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(importOfferingOptionsModel).ToNot(BeNil()) + Expect(importOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(importOfferingOptionsModel.Keywords).To(Equal([]string{"testString"})) + Expect(importOfferingOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) + Expect(importOfferingOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.InstallKind).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.TargetKinds).To(Equal([]string{"testString"})) + Expect(importOfferingOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.ProductKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Flavor).To(Equal(flavorModel)) + Expect(importOfferingOptionsModel.Metadata).To(Equal(importOfferingBodyMetadataModel)) + Expect(importOfferingOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Zipurl).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.TargetVersion).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.IncludeConfig).To(Equal(core.BoolPtr(true))) + Expect(importOfferingOptionsModel.IsVsi).To(Equal(core.BoolPtr(true))) + Expect(importOfferingOptionsModel.Repotype).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.XAuthToken).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewImportOfferingVersionOptions successfully`, func() { + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + Expect(flavorModel).ToNot(BeNil()) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) + Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the ImportOfferingBodyMetadataOperatingSystem model + importOfferingBodyMetadataOperatingSystemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataOperatingSystem) + Expect(importOfferingBodyMetadataOperatingSystemModel).ToNot(BeNil()) + importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly = core.BoolPtr(true) + importOfferingBodyMetadataOperatingSystemModel.Vendor = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Name = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Href = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.DisplayName = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Family = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Version = core.StringPtr("testString") + importOfferingBodyMetadataOperatingSystemModel.Architecture = core.StringPtr("testString") + Expect(importOfferingBodyMetadataOperatingSystemModel.DedicatedHostOnly).To(Equal(core.BoolPtr(true))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Vendor).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Href).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.DisplayName).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Family).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataOperatingSystemModel.Architecture).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ImportOfferingBodyMetadataFile model + importOfferingBodyMetadataFileModel := new(catalogmanagementv1.ImportOfferingBodyMetadataFile) + Expect(importOfferingBodyMetadataFileModel).ToNot(BeNil()) + importOfferingBodyMetadataFileModel.Size = core.Int64Ptr(int64(38)) + Expect(importOfferingBodyMetadataFileModel.Size).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the ImportOfferingBodyMetadataImagesItem model + importOfferingBodyMetadataImagesItemModel := new(catalogmanagementv1.ImportOfferingBodyMetadataImagesItem) + Expect(importOfferingBodyMetadataImagesItemModel).ToNot(BeNil()) + importOfferingBodyMetadataImagesItemModel.ID = core.StringPtr("testString") + importOfferingBodyMetadataImagesItemModel.Name = core.StringPtr("testString") + importOfferingBodyMetadataImagesItemModel.Region = core.StringPtr("testString") + Expect(importOfferingBodyMetadataImagesItemModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataImagesItemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingBodyMetadataImagesItemModel.Region).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ImportOfferingBodyMetadata model + importOfferingBodyMetadataModel := new(catalogmanagementv1.ImportOfferingBodyMetadata) + Expect(importOfferingBodyMetadataModel).ToNot(BeNil()) + importOfferingBodyMetadataModel.OperatingSystem = importOfferingBodyMetadataOperatingSystemModel + importOfferingBodyMetadataModel.File = importOfferingBodyMetadataFileModel + importOfferingBodyMetadataModel.MinimumProvisionedSize = core.Int64Ptr(int64(38)) + importOfferingBodyMetadataModel.Images = []catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel} + Expect(importOfferingBodyMetadataModel.OperatingSystem).To(Equal(importOfferingBodyMetadataOperatingSystemModel)) + Expect(importOfferingBodyMetadataModel.File).To(Equal(importOfferingBodyMetadataFileModel)) + Expect(importOfferingBodyMetadataModel.MinimumProvisionedSize).To(Equal(core.Int64Ptr(int64(38)))) + Expect(importOfferingBodyMetadataModel.Images).To(Equal([]catalogmanagementv1.ImportOfferingBodyMetadataImagesItem{*importOfferingBodyMetadataImagesItemModel})) + + // Construct an instance of the ImportOfferingVersionOptions model + catalogIdentifier := "testString" + offeringID := "testString" + importOfferingVersionOptionsModel := catalogManagementService.NewImportOfferingVersionOptions(catalogIdentifier, offeringID) + importOfferingVersionOptionsModel.SetCatalogIdentifier("testString") + importOfferingVersionOptionsModel.SetOfferingID("testString") + importOfferingVersionOptionsModel.SetTags([]string{"testString"}) + importOfferingVersionOptionsModel.SetKeywords([]string{"testString"}) + importOfferingVersionOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) + importOfferingVersionOptionsModel.SetName("testString") + importOfferingVersionOptionsModel.SetLabel("testString") + importOfferingVersionOptionsModel.SetInstallKind("testString") + importOfferingVersionOptionsModel.SetTargetKinds([]string{"testString"}) + importOfferingVersionOptionsModel.SetFormatKind("testString") + importOfferingVersionOptionsModel.SetProductKind("testString") + importOfferingVersionOptionsModel.SetProductKindLabel("testString") + importOfferingVersionOptionsModel.SetSha("testString") + importOfferingVersionOptionsModel.SetVersion("testString") + importOfferingVersionOptionsModel.SetFlavor(flavorModel) + importOfferingVersionOptionsModel.SetMetadata(importOfferingBodyMetadataModel) + importOfferingVersionOptionsModel.SetWorkingDirectory("testString") + importOfferingVersionOptionsModel.SetInstallType("testString") + importOfferingVersionOptionsModel.SetZipurl("testString") + importOfferingVersionOptionsModel.SetTargetVersion("testString") + importOfferingVersionOptionsModel.SetIncludeConfig(true) + importOfferingVersionOptionsModel.SetIsVsi(true) + importOfferingVersionOptionsModel.SetRepotype("testString") + importOfferingVersionOptionsModel.SetXAuthToken("testString") + importOfferingVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(importOfferingVersionOptionsModel).ToNot(BeNil()) + Expect(importOfferingVersionOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(importOfferingVersionOptionsModel.Keywords).To(Equal([]string{"testString"})) + Expect(importOfferingVersionOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) + Expect(importOfferingVersionOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.InstallKind).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.TargetKinds).To(Equal([]string{"testString"})) + Expect(importOfferingVersionOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.ProductKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Flavor).To(Equal(flavorModel)) + Expect(importOfferingVersionOptionsModel.Metadata).To(Equal(importOfferingBodyMetadataModel)) + Expect(importOfferingVersionOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Zipurl).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.TargetVersion).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.IncludeConfig).To(Equal(core.BoolPtr(true))) + Expect(importOfferingVersionOptionsModel.IsVsi).To(Equal(core.BoolPtr(true))) + Expect(importOfferingVersionOptionsModel.Repotype).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.XAuthToken).To(Equal(core.StringPtr("testString"))) + Expect(importOfferingVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewInstallVersionOptions successfully`, func() { + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + Expect(deployRequestBodyOverrideValuesModel).ToNot(BeNil()) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + Expect(deployRequestBodyOverrideValuesModel.VsiInstanceName).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.VPCProfile).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.SubnetID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.VPCID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.SubnetZone).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.SSHKeyID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.VPCRegion).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.GetProperties()).ToNot(BeEmpty()) + Expect(deployRequestBodyOverrideValuesModel.GetProperty("foo")).To(Equal("testString")) + + deployRequestBodyOverrideValuesModel.SetProperties(nil) + Expect(deployRequestBodyOverrideValuesModel.GetProperties()).To(BeEmpty()) + + deployRequestBodyOverrideValuesModelExpectedMap := make(map[string]interface{}) + deployRequestBodyOverrideValuesModelExpectedMap["foo"] = "testString" + deployRequestBodyOverrideValuesModel.SetProperties(deployRequestBodyOverrideValuesModelExpectedMap) + deployRequestBodyOverrideValuesModelActualMap := deployRequestBodyOverrideValuesModel.GetProperties() + Expect(deployRequestBodyOverrideValuesModelActualMap).To(Equal(deployRequestBodyOverrideValuesModelExpectedMap)) + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + Expect(deployRequestBodyEnvironmentVariablesItemModel).ToNot(BeNil()) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Value).To(Equal("testString")) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Secure).To(Equal(core.BoolPtr(true))) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Hidden).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + Expect(deployRequestBodySchematicsModel).ToNot(BeNil()) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + Expect(deployRequestBodySchematicsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.Tags).To(Equal([]string{"testString"})) + Expect(deployRequestBodySchematicsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.TerraformVersion).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.Region).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the InstallVersionOptions model + versionLocID := "testString" + xAuthRefreshToken := "testString" + installVersionOptionsModel := catalogManagementService.NewInstallVersionOptions(versionLocID, xAuthRefreshToken) + installVersionOptionsModel.SetVersionLocID("testString") + installVersionOptionsModel.SetXAuthRefreshToken("testString") + installVersionOptionsModel.SetClusterID("testString") + installVersionOptionsModel.SetRegion("testString") + installVersionOptionsModel.SetNamespace("testString") + installVersionOptionsModel.SetNamespaces([]string{"testString"}) + installVersionOptionsModel.SetAllNamespaces(true) + installVersionOptionsModel.SetOverrideValues(deployRequestBodyOverrideValuesModel) + installVersionOptionsModel.SetDependencyConfigs([]string{"testString"}) + installVersionOptionsModel.SetEnvironmentVariables([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel}) + installVersionOptionsModel.SetEntitlementApikey("testString") + installVersionOptionsModel.SetSchematics(deployRequestBodySchematicsModel) + installVersionOptionsModel.SetScript("testString") + installVersionOptionsModel.SetScriptID("testString") + installVersionOptionsModel.SetVersionLocatorID("testString") + installVersionOptionsModel.SetVcenterID("testString") + installVersionOptionsModel.SetVcenterLocation("testString") + installVersionOptionsModel.SetVcenterUser("testString") + installVersionOptionsModel.SetVcenterPassword("testString") + installVersionOptionsModel.SetVcenterDatastore("testString") + installVersionOptionsModel.SetPlanID("testString") + installVersionOptionsModel.SetChannel("testString") + installVersionOptionsModel.SetInstallPlan("testString") + installVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(installVersionOptionsModel).ToNot(BeNil()) + Expect(installVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.Namespaces).To(Equal([]string{"testString"})) + Expect(installVersionOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(installVersionOptionsModel.OverrideValues).To(Equal(deployRequestBodyOverrideValuesModel)) + Expect(installVersionOptionsModel.DependencyConfigs).To(Equal([]string{"testString"})) + Expect(installVersionOptionsModel.EnvironmentVariables).To(Equal([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel})) + Expect(installVersionOptionsModel.EntitlementApikey).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.Schematics).To(Equal(deployRequestBodySchematicsModel)) + Expect(installVersionOptionsModel.Script).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.ScriptID).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.VcenterID).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.VcenterLocation).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.VcenterUser).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.VcenterPassword).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.VcenterDatastore).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(installVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewJSONPatchOperation successfully`, func() { + op := "add" + path := "testString" + _model, err := catalogManagementService.NewJSONPatchOperation(op, path) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) + It(`Invoke NewListCatalogAccountAuditsOptions successfully`, func() { + // Construct an instance of the ListCatalogAccountAuditsOptions model + listCatalogAccountAuditsOptionsModel := catalogManagementService.NewListCatalogAccountAuditsOptions() + listCatalogAccountAuditsOptionsModel.SetStart("testString") + listCatalogAccountAuditsOptionsModel.SetLimit(int64(10)) + listCatalogAccountAuditsOptionsModel.SetLookupnames(true) + listCatalogAccountAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listCatalogAccountAuditsOptionsModel).ToNot(BeNil()) + Expect(listCatalogAccountAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listCatalogAccountAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listCatalogAccountAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(listCatalogAccountAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListCatalogAuditsOptions successfully`, func() { + // Construct an instance of the ListCatalogAuditsOptions model + catalogIdentifier := "testString" + listCatalogAuditsOptionsModel := catalogManagementService.NewListCatalogAuditsOptions(catalogIdentifier) + listCatalogAuditsOptionsModel.SetCatalogIdentifier("testString") + listCatalogAuditsOptionsModel.SetStart("testString") + listCatalogAuditsOptionsModel.SetLimit(int64(10)) + listCatalogAuditsOptionsModel.SetLookupnames(true) + listCatalogAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listCatalogAuditsOptionsModel).ToNot(BeNil()) + Expect(listCatalogAuditsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listCatalogAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listCatalogAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listCatalogAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(listCatalogAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListCatalogsOptions successfully`, func() { + // Construct an instance of the ListCatalogsOptions model + listCatalogsOptionsModel := catalogManagementService.NewListCatalogsOptions() + listCatalogsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listCatalogsOptionsModel).ToNot(BeNil()) + Expect(listCatalogsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListEnterpriseAuditsOptions successfully`, func() { + // Construct an instance of the ListEnterpriseAuditsOptions model + enterpriseIdentifier := "testString" + listEnterpriseAuditsOptionsModel := catalogManagementService.NewListEnterpriseAuditsOptions(enterpriseIdentifier) + listEnterpriseAuditsOptionsModel.SetEnterpriseIdentifier("testString") + listEnterpriseAuditsOptionsModel.SetStart("testString") + listEnterpriseAuditsOptionsModel.SetLimit(int64(10)) + listEnterpriseAuditsOptionsModel.SetLookupnames(true) + listEnterpriseAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listEnterpriseAuditsOptionsModel).ToNot(BeNil()) + Expect(listEnterpriseAuditsOptionsModel.EnterpriseIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listEnterpriseAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listEnterpriseAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listEnterpriseAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(listEnterpriseAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListObjectAuditsOptions successfully`, func() { + // Construct an instance of the ListObjectAuditsOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + listObjectAuditsOptionsModel := catalogManagementService.NewListObjectAuditsOptions(catalogIdentifier, objectIdentifier) + listObjectAuditsOptionsModel.SetCatalogIdentifier("testString") + listObjectAuditsOptionsModel.SetObjectIdentifier("testString") + listObjectAuditsOptionsModel.SetStart("testString") + listObjectAuditsOptionsModel.SetLimit(int64(10)) + listObjectAuditsOptionsModel.SetLookupnames(true) + listObjectAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listObjectAuditsOptionsModel).ToNot(BeNil()) + Expect(listObjectAuditsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listObjectAuditsOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listObjectAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listObjectAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listObjectAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(listObjectAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListObjectsOptions successfully`, func() { + // Construct an instance of the ListObjectsOptions model + catalogIdentifier := "testString" + listObjectsOptionsModel := catalogManagementService.NewListObjectsOptions(catalogIdentifier) + listObjectsOptionsModel.SetCatalogIdentifier("testString") + listObjectsOptionsModel.SetLimit(int64(10)) + listObjectsOptionsModel.SetOffset(int64(0)) + listObjectsOptionsModel.SetName("testString") + listObjectsOptionsModel.SetSort("testString") + listObjectsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listObjectsOptionsModel).ToNot(BeNil()) + Expect(listObjectsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listObjectsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listObjectsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(listObjectsOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(listObjectsOptionsModel.Sort).To(Equal(core.StringPtr("testString"))) + Expect(listObjectsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListOfferingAuditsOptions successfully`, func() { + // Construct an instance of the ListOfferingAuditsOptions model + catalogIdentifier := "testString" + offeringID := "testString" + listOfferingAuditsOptionsModel := catalogManagementService.NewListOfferingAuditsOptions(catalogIdentifier, offeringID) + listOfferingAuditsOptionsModel.SetCatalogIdentifier("testString") + listOfferingAuditsOptionsModel.SetOfferingID("testString") + listOfferingAuditsOptionsModel.SetStart("testString") + listOfferingAuditsOptionsModel.SetLimit(int64(10)) + listOfferingAuditsOptionsModel.SetLookupnames(true) + listOfferingAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listOfferingAuditsOptionsModel).ToNot(BeNil()) + Expect(listOfferingAuditsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingAuditsOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listOfferingAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(listOfferingAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListOfferingInstanceAuditsOptions successfully`, func() { + // Construct an instance of the ListOfferingInstanceAuditsOptions model + instanceIdentifier := "testString" + listOfferingInstanceAuditsOptionsModel := catalogManagementService.NewListOfferingInstanceAuditsOptions(instanceIdentifier) + listOfferingInstanceAuditsOptionsModel.SetInstanceIdentifier("testString") + listOfferingInstanceAuditsOptionsModel.SetStart("testString") + listOfferingInstanceAuditsOptionsModel.SetLimit(int64(10)) + listOfferingInstanceAuditsOptionsModel.SetLookupnames(true) + listOfferingInstanceAuditsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listOfferingInstanceAuditsOptionsModel).ToNot(BeNil()) + Expect(listOfferingInstanceAuditsOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingInstanceAuditsOptionsModel.Start).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingInstanceAuditsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listOfferingInstanceAuditsOptionsModel.Lookupnames).To(Equal(core.BoolPtr(true))) + Expect(listOfferingInstanceAuditsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListOfferingsOptions successfully`, func() { + // Construct an instance of the ListOfferingsOptions model + catalogIdentifier := "testString" + listOfferingsOptionsModel := catalogManagementService.NewListOfferingsOptions(catalogIdentifier) + listOfferingsOptionsModel.SetCatalogIdentifier("testString") + listOfferingsOptionsModel.SetDigest(true) + listOfferingsOptionsModel.SetLimit(int64(10)) + listOfferingsOptionsModel.SetOffset(int64(0)) + listOfferingsOptionsModel.SetName("testString") + listOfferingsOptionsModel.SetSort("testString") + listOfferingsOptionsModel.SetIncludeHidden(true) + listOfferingsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listOfferingsOptionsModel).ToNot(BeNil()) + Expect(listOfferingsOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) + Expect(listOfferingsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(listOfferingsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(listOfferingsOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingsOptionsModel.Sort).To(Equal(core.StringPtr("testString"))) + Expect(listOfferingsOptionsModel.IncludeHidden).To(Equal(core.BoolPtr(true))) + Expect(listOfferingsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListOperatorsOptions successfully`, func() { + // Construct an instance of the ListOperatorsOptions model + xAuthRefreshToken := "testString" + clusterID := "testString" + region := "testString" + versionLocatorID := "testString" + listOperatorsOptionsModel := catalogManagementService.NewListOperatorsOptions(xAuthRefreshToken, clusterID, region, versionLocatorID) + listOperatorsOptionsModel.SetXAuthRefreshToken("testString") + listOperatorsOptionsModel.SetClusterID("testString") + listOperatorsOptionsModel.SetRegion("testString") + listOperatorsOptionsModel.SetVersionLocatorID("testString") + listOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listOperatorsOptionsModel).ToNot(BeNil()) + Expect(listOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(listOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(listOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(listOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) + Expect(listOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewListRegionsOptions successfully`, func() { + // Construct an instance of the ListRegionsOptions model + listRegionsOptionsModel := catalogManagementService.NewListRegionsOptions() + listRegionsOptionsModel.SetFilter("testString") + listRegionsOptionsModel.SetGetInactive(true) + listRegionsOptionsModel.SetLimit(int64(100)) + listRegionsOptionsModel.SetOffset(int64(0)) + listRegionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(listRegionsOptionsModel).ToNot(BeNil()) + Expect(listRegionsOptionsModel.Filter).To(Equal(core.StringPtr("testString"))) + Expect(listRegionsOptionsModel.GetInactive).To(Equal(core.BoolPtr(true))) + Expect(listRegionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(100)))) + Expect(listRegionsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(listRegionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewPaginationTokenLink successfully`, func() { + href := "testString" + _model, err := catalogManagementService.NewPaginationTokenLink(href) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) + It(`Invoke NewPatchUpdateVersionOptions successfully`, func() { + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + Expect(jsonPatchOperationModel).ToNot(BeNil()) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") + Expect(jsonPatchOperationModel.Op).To(Equal(core.StringPtr("add"))) + Expect(jsonPatchOperationModel.Path).To(Equal(core.StringPtr("testString"))) + Expect(jsonPatchOperationModel.Value).To(Equal("testString")) + Expect(jsonPatchOperationModel.From).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the PatchUpdateVersionOptions model + versionLocID := "testString" + ifMatch := "testString" + patchUpdateVersionOptionsModel := catalogManagementService.NewPatchUpdateVersionOptions(versionLocID, ifMatch) + patchUpdateVersionOptionsModel.SetVersionLocID("testString") + patchUpdateVersionOptionsModel.SetIfMatch("testString") + patchUpdateVersionOptionsModel.SetUpdates([]catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel}) + patchUpdateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(patchUpdateVersionOptionsModel).ToNot(BeNil()) + Expect(patchUpdateVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(patchUpdateVersionOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) + Expect(patchUpdateVersionOptionsModel.Updates).To(Equal([]catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel})) + Expect(patchUpdateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewPreinstallVersionOptions successfully`, func() { + // Construct an instance of the DeployRequestBodyOverrideValues model + deployRequestBodyOverrideValuesModel := new(catalogmanagementv1.DeployRequestBodyOverrideValues) + Expect(deployRequestBodyOverrideValuesModel).ToNot(BeNil()) + deployRequestBodyOverrideValuesModel.VsiInstanceName = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCProfile = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SubnetZone = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SSHKeyID = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.VPCRegion = core.StringPtr("testString") + deployRequestBodyOverrideValuesModel.SetProperty("foo", "testString") + Expect(deployRequestBodyOverrideValuesModel.VsiInstanceName).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.VPCProfile).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.SubnetID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.VPCID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.SubnetZone).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.SSHKeyID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.VPCRegion).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyOverrideValuesModel.GetProperties()).ToNot(BeEmpty()) + Expect(deployRequestBodyOverrideValuesModel.GetProperty("foo")).To(Equal("testString")) + + deployRequestBodyOverrideValuesModel.SetProperties(nil) + Expect(deployRequestBodyOverrideValuesModel.GetProperties()).To(BeEmpty()) + + deployRequestBodyOverrideValuesModelExpectedMap := make(map[string]interface{}) + deployRequestBodyOverrideValuesModelExpectedMap["foo"] = "testString" + deployRequestBodyOverrideValuesModel.SetProperties(deployRequestBodyOverrideValuesModelExpectedMap) + deployRequestBodyOverrideValuesModelActualMap := deployRequestBodyOverrideValuesModel.GetProperties() + Expect(deployRequestBodyOverrideValuesModelActualMap).To(Equal(deployRequestBodyOverrideValuesModelExpectedMap)) + + // Construct an instance of the DeployRequestBodyEnvironmentVariablesItem model + deployRequestBodyEnvironmentVariablesItemModel := new(catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem) + Expect(deployRequestBodyEnvironmentVariablesItemModel).ToNot(BeNil()) + deployRequestBodyEnvironmentVariablesItemModel.Name = core.StringPtr("testString") + deployRequestBodyEnvironmentVariablesItemModel.Value = "testString" + deployRequestBodyEnvironmentVariablesItemModel.Secure = core.BoolPtr(true) + deployRequestBodyEnvironmentVariablesItemModel.Hidden = core.BoolPtr(true) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Value).To(Equal("testString")) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Secure).To(Equal(core.BoolPtr(true))) + Expect(deployRequestBodyEnvironmentVariablesItemModel.Hidden).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the DeployRequestBodySchematics model + deployRequestBodySchematicsModel := new(catalogmanagementv1.DeployRequestBodySchematics) + Expect(deployRequestBodySchematicsModel).ToNot(BeNil()) + deployRequestBodySchematicsModel.Name = core.StringPtr("testString") + deployRequestBodySchematicsModel.Description = core.StringPtr("testString") + deployRequestBodySchematicsModel.Tags = []string{"testString"} + deployRequestBodySchematicsModel.ResourceGroupID = core.StringPtr("testString") + deployRequestBodySchematicsModel.TerraformVersion = core.StringPtr("testString") + deployRequestBodySchematicsModel.Region = core.StringPtr("testString") + Expect(deployRequestBodySchematicsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.Tags).To(Equal([]string{"testString"})) + Expect(deployRequestBodySchematicsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.TerraformVersion).To(Equal(core.StringPtr("testString"))) + Expect(deployRequestBodySchematicsModel.Region).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the PreinstallVersionOptions model + versionLocID := "testString" + xAuthRefreshToken := "testString" + preinstallVersionOptionsModel := catalogManagementService.NewPreinstallVersionOptions(versionLocID, xAuthRefreshToken) + preinstallVersionOptionsModel.SetVersionLocID("testString") + preinstallVersionOptionsModel.SetXAuthRefreshToken("testString") + preinstallVersionOptionsModel.SetClusterID("testString") + preinstallVersionOptionsModel.SetRegion("testString") + preinstallVersionOptionsModel.SetNamespace("testString") + preinstallVersionOptionsModel.SetNamespaces([]string{"testString"}) + preinstallVersionOptionsModel.SetAllNamespaces(true) + preinstallVersionOptionsModel.SetOverrideValues(deployRequestBodyOverrideValuesModel) + preinstallVersionOptionsModel.SetDependencyConfigs([]string{"testString"}) + preinstallVersionOptionsModel.SetEnvironmentVariables([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel}) + preinstallVersionOptionsModel.SetEntitlementApikey("testString") + preinstallVersionOptionsModel.SetSchematics(deployRequestBodySchematicsModel) + preinstallVersionOptionsModel.SetScript("testString") + preinstallVersionOptionsModel.SetScriptID("testString") + preinstallVersionOptionsModel.SetVersionLocatorID("testString") + preinstallVersionOptionsModel.SetVcenterID("testString") + preinstallVersionOptionsModel.SetVcenterLocation("testString") + preinstallVersionOptionsModel.SetVcenterUser("testString") + preinstallVersionOptionsModel.SetVcenterPassword("testString") + preinstallVersionOptionsModel.SetVcenterDatastore("testString") + preinstallVersionOptionsModel.SetPlanID("testString") + preinstallVersionOptionsModel.SetChannel("testString") + preinstallVersionOptionsModel.SetInstallPlan("testString") + preinstallVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(preinstallVersionOptionsModel).ToNot(BeNil()) + Expect(preinstallVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.Namespace).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.Namespaces).To(Equal([]string{"testString"})) + Expect(preinstallVersionOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(preinstallVersionOptionsModel.OverrideValues).To(Equal(deployRequestBodyOverrideValuesModel)) + Expect(preinstallVersionOptionsModel.DependencyConfigs).To(Equal([]string{"testString"})) + Expect(preinstallVersionOptionsModel.EnvironmentVariables).To(Equal([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel})) + Expect(preinstallVersionOptionsModel.EntitlementApikey).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.Schematics).To(Equal(deployRequestBodySchematicsModel)) + Expect(preinstallVersionOptionsModel.Script).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.ScriptID).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.VcenterID).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.VcenterLocation).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.VcenterUser).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.VcenterPassword).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.VcenterDatastore).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(preinstallVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewPrereleaseVersionOptions successfully`, func() { + // Construct an instance of the PrereleaseVersionOptions model + versionLocID := "testString" + prereleaseVersionOptionsModel := catalogManagementService.NewPrereleaseVersionOptions(versionLocID) + prereleaseVersionOptionsModel.SetVersionLocID("testString") + prereleaseVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(prereleaseVersionOptionsModel).ToNot(BeNil()) + Expect(prereleaseVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(prereleaseVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewPreviewRegionsOptions successfully`, func() { + // Construct an instance of the PreviewRegionsOptions model + previewRegionsOptionsModel := catalogManagementService.NewPreviewRegionsOptions() + previewRegionsOptionsModel.SetFilter("testString") + previewRegionsOptionsModel.SetGetInactive(true) + previewRegionsOptionsModel.SetLimit(int64(100)) + previewRegionsOptionsModel.SetOffset(int64(0)) + previewRegionsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(previewRegionsOptionsModel).ToNot(BeNil()) + Expect(previewRegionsOptionsModel.Filter).To(Equal(core.StringPtr("testString"))) + Expect(previewRegionsOptionsModel.GetInactive).To(Equal(core.BoolPtr(true))) + Expect(previewRegionsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(100)))) + Expect(previewRegionsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(previewRegionsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewPutOfferingInstanceOptions successfully`, func() { + // Construct an instance of the OfferingInstanceLastOperation model + offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) + Expect(offeringInstanceLastOperationModel).ToNot(BeNil()) + offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") + offeringInstanceLastOperationModel.State = core.StringPtr("testString") + offeringInstanceLastOperationModel.Message = core.StringPtr("testString") + offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") + offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + offeringInstanceLastOperationModel.Code = core.StringPtr("testString") + Expect(offeringInstanceLastOperationModel.Operation).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.State).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.Message).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.TransactionID).To(Equal(core.StringPtr("testString"))) + Expect(offeringInstanceLastOperationModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(offeringInstanceLastOperationModel.Code).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the PutOfferingInstanceOptions model + instanceIdentifier := "testString" + xAuthRefreshToken := "testString" + putOfferingInstanceOptionsModel := catalogManagementService.NewPutOfferingInstanceOptions(instanceIdentifier, xAuthRefreshToken) + putOfferingInstanceOptionsModel.SetInstanceIdentifier("testString") + putOfferingInstanceOptionsModel.SetXAuthRefreshToken("testString") + putOfferingInstanceOptionsModel.SetID("testString") + putOfferingInstanceOptionsModel.SetRev("testString") + putOfferingInstanceOptionsModel.SetURL("testString") + putOfferingInstanceOptionsModel.SetCRN("testString") + putOfferingInstanceOptionsModel.SetLabel("testString") + putOfferingInstanceOptionsModel.SetCatalogID("testString") + putOfferingInstanceOptionsModel.SetOfferingID("testString") + putOfferingInstanceOptionsModel.SetKindFormat("testString") + putOfferingInstanceOptionsModel.SetKindFormatLabel("testString") + putOfferingInstanceOptionsModel.SetVersion("testString") + putOfferingInstanceOptionsModel.SetVersionID("testString") + putOfferingInstanceOptionsModel.SetClusterID("testString") + putOfferingInstanceOptionsModel.SetClusterRegion("testString") + putOfferingInstanceOptionsModel.SetClusterNamespaces([]string{"testString"}) + putOfferingInstanceOptionsModel.SetClusterAllNamespaces(true) + putOfferingInstanceOptionsModel.SetSchematicsWorkspaceID("testString") + putOfferingInstanceOptionsModel.SetInstallPlan("testString") + putOfferingInstanceOptionsModel.SetChannel("testString") + putOfferingInstanceOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + putOfferingInstanceOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + putOfferingInstanceOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + putOfferingInstanceOptionsModel.SetResourceGroupID("testString") + putOfferingInstanceOptionsModel.SetLocation("testString") + putOfferingInstanceOptionsModel.SetDisabled(true) + putOfferingInstanceOptionsModel.SetAccount("testString") + putOfferingInstanceOptionsModel.SetLastOperation(offeringInstanceLastOperationModel) + putOfferingInstanceOptionsModel.SetKindTarget("testString") + putOfferingInstanceOptionsModel.SetKindTargetLabel("testString") + putOfferingInstanceOptionsModel.SetSha("testString") + putOfferingInstanceOptionsModel.SetPlanID("testString") + putOfferingInstanceOptionsModel.SetParentCRN("testString") + putOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(putOfferingInstanceOptionsModel).ToNot(BeNil()) + Expect(putOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.KindFormat).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.KindFormatLabel).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.VersionID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.ClusterRegion).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.ClusterNamespaces).To(Equal([]string{"testString"})) + Expect(putOfferingInstanceOptionsModel.ClusterAllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(putOfferingInstanceOptionsModel.SchematicsWorkspaceID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(putOfferingInstanceOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(putOfferingInstanceOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(putOfferingInstanceOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Location).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) + Expect(putOfferingInstanceOptionsModel.Account).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.LastOperation).To(Equal(offeringInstanceLastOperationModel)) + Expect(putOfferingInstanceOptionsModel.KindTarget).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.KindTargetLabel).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.ParentCRN).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewReloadOfferingOptions successfully`, func() { + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + Expect(flavorModel).ToNot(BeNil()) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) + Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the ReloadOfferingOptions model + catalogIdentifier := "testString" + offeringID := "testString" + targetVersion := "testString" + reloadOfferingOptionsModel := catalogManagementService.NewReloadOfferingOptions(catalogIdentifier, offeringID, targetVersion) + reloadOfferingOptionsModel.SetCatalogIdentifier("testString") + reloadOfferingOptionsModel.SetOfferingID("testString") + reloadOfferingOptionsModel.SetTargetVersion("testString") + reloadOfferingOptionsModel.SetTags([]string{"testString"}) + reloadOfferingOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) + reloadOfferingOptionsModel.SetTargetKinds([]string{"testString"}) + reloadOfferingOptionsModel.SetFormatKind("testString") + reloadOfferingOptionsModel.SetFlavor(flavorModel) + reloadOfferingOptionsModel.SetWorkingDirectory("testString") + reloadOfferingOptionsModel.SetInstallType("testString") + reloadOfferingOptionsModel.SetZipurl("testString") + reloadOfferingOptionsModel.SetRepoType("testString") + reloadOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(reloadOfferingOptionsModel).ToNot(BeNil()) + Expect(reloadOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.TargetVersion).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(reloadOfferingOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) + Expect(reloadOfferingOptionsModel.TargetKinds).To(Equal([]string{"testString"})) + Expect(reloadOfferingOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.Flavor).To(Equal(flavorModel)) + Expect(reloadOfferingOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.InstallType).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.Zipurl).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.RepoType).To(Equal(core.StringPtr("testString"))) + Expect(reloadOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewReplaceCatalogOptions successfully`, func() { + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + Expect(featureModel).ToNot(BeNil()) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} + Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + + // Construct an instance of the FilterTerms model + filterTermsModel := new(catalogmanagementv1.FilterTerms) + Expect(filterTermsModel).ToNot(BeNil()) + filterTermsModel.FilterTerms = []string{"testString"} + Expect(filterTermsModel.FilterTerms).To(Equal([]string{"testString"})) + + // Construct an instance of the CategoryFilter model + categoryFilterModel := new(catalogmanagementv1.CategoryFilter) + Expect(categoryFilterModel).ToNot(BeNil()) + categoryFilterModel.Include = core.BoolPtr(true) + categoryFilterModel.Filter = filterTermsModel + Expect(categoryFilterModel.Include).To(Equal(core.BoolPtr(true))) + Expect(categoryFilterModel.Filter).To(Equal(filterTermsModel)) + + // Construct an instance of the IDFilter model + idFilterModel := new(catalogmanagementv1.IDFilter) + Expect(idFilterModel).ToNot(BeNil()) + idFilterModel.Include = filterTermsModel + idFilterModel.Exclude = filterTermsModel + Expect(idFilterModel.Include).To(Equal(filterTermsModel)) + Expect(idFilterModel.Exclude).To(Equal(filterTermsModel)) + + // Construct an instance of the Filters model + filtersModel := new(catalogmanagementv1.Filters) + Expect(filtersModel).ToNot(BeNil()) + filtersModel.IncludeAll = core.BoolPtr(true) + filtersModel.CategoryFilters = map[string]catalogmanagementv1.CategoryFilter{"key1": *categoryFilterModel} + filtersModel.IDFilters = idFilterModel + filtersModel.CategoryFilters["foo"] = *categoryFilterModel + Expect(filtersModel.IncludeAll).To(Equal(core.BoolPtr(true))) + Expect(filtersModel.IDFilters).To(Equal(idFilterModel)) + Expect(filtersModel.CategoryFilters["foo"]).To(Equal(*categoryFilterModel)) + + // Construct an instance of the TrustedProfileInfo model + trustedProfileInfoModel := new(catalogmanagementv1.TrustedProfileInfo) + Expect(trustedProfileInfoModel).ToNot(BeNil()) + trustedProfileInfoModel.TrustedProfileID = core.StringPtr("testString") + trustedProfileInfoModel.CatalogCRN = core.StringPtr("testString") + trustedProfileInfoModel.CatalogName = core.StringPtr("testString") + trustedProfileInfoModel.TargetServiceID = core.StringPtr("testString") + Expect(trustedProfileInfoModel.TrustedProfileID).To(Equal(core.StringPtr("testString"))) + Expect(trustedProfileInfoModel.CatalogCRN).To(Equal(core.StringPtr("testString"))) + Expect(trustedProfileInfoModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(trustedProfileInfoModel.TargetServiceID).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the TargetAccountContext model + targetAccountContextModel := new(catalogmanagementv1.TargetAccountContext) + Expect(targetAccountContextModel).ToNot(BeNil()) + targetAccountContextModel.APIKey = core.StringPtr("testString") + targetAccountContextModel.TrustedProfile = trustedProfileInfoModel + targetAccountContextModel.Name = core.StringPtr("testString") + targetAccountContextModel.Label = core.StringPtr("testString") + targetAccountContextModel.ProjectID = core.StringPtr("testString") + Expect(targetAccountContextModel.APIKey).To(Equal(core.StringPtr("testString"))) + Expect(targetAccountContextModel.TrustedProfile).To(Equal(trustedProfileInfoModel)) + Expect(targetAccountContextModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(targetAccountContextModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(targetAccountContextModel.ProjectID).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ReplaceCatalogOptions model + catalogIdentifier := "testString" + replaceCatalogOptionsModel := catalogManagementService.NewReplaceCatalogOptions(catalogIdentifier) + replaceCatalogOptionsModel.SetCatalogIdentifier("testString") + replaceCatalogOptionsModel.SetID("testString") + replaceCatalogOptionsModel.SetRev("testString") + replaceCatalogOptionsModel.SetLabel("testString") + replaceCatalogOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + replaceCatalogOptionsModel.SetShortDescription("testString") + replaceCatalogOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + replaceCatalogOptionsModel.SetCatalogIconURL("testString") + replaceCatalogOptionsModel.SetCatalogBannerURL("testString") + replaceCatalogOptionsModel.SetTags([]string{"testString"}) + replaceCatalogOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) + replaceCatalogOptionsModel.SetDisabled(true) + replaceCatalogOptionsModel.SetResourceGroupID("testString") + replaceCatalogOptionsModel.SetOwningAccount("testString") + replaceCatalogOptionsModel.SetCatalogFilters(filtersModel) + replaceCatalogOptionsModel.SetKind("testString") + replaceCatalogOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + replaceCatalogOptionsModel.SetTargetAccountContexts([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel}) + replaceCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(replaceCatalogOptionsModel).ToNot(BeNil()) + Expect(replaceCatalogOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceCatalogOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceCatalogOptionsModel.CatalogIconURL).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.CatalogBannerURL).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(replaceCatalogOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(replaceCatalogOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) + Expect(replaceCatalogOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.OwningAccount).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.CatalogFilters).To(Equal(filtersModel)) + Expect(replaceCatalogOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(replaceCatalogOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(replaceCatalogOptionsModel.TargetAccountContexts).To(Equal([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel})) + Expect(replaceCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewReplaceObjectOptions successfully`, func() { + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + Expect(publishObjectModel).ToNot(BeNil()) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + Expect(stateModel).ToNot(BeNil()) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ReplaceObjectOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + replaceObjectOptionsModel := catalogManagementService.NewReplaceObjectOptions(catalogIdentifier, objectIdentifier) + replaceObjectOptionsModel.SetCatalogIdentifier("testString") + replaceObjectOptionsModel.SetObjectIdentifier("testString") + replaceObjectOptionsModel.SetID("testString") + replaceObjectOptionsModel.SetRev("testString") + replaceObjectOptionsModel.SetName("testString") + replaceObjectOptionsModel.SetCRN("testString") + replaceObjectOptionsModel.SetURL("testString") + replaceObjectOptionsModel.SetParentID("testString") + replaceObjectOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + replaceObjectOptionsModel.SetLabel("testString") + replaceObjectOptionsModel.SetTags([]string{"testString"}) + replaceObjectOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + replaceObjectOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + replaceObjectOptionsModel.SetShortDescription("testString") + replaceObjectOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + replaceObjectOptionsModel.SetKind("testString") + replaceObjectOptionsModel.SetPublish(publishObjectModel) + replaceObjectOptionsModel.SetState(stateModel) + replaceObjectOptionsModel.SetCatalogID("testString") + replaceObjectOptionsModel.SetCatalogName("testString") + replaceObjectOptionsModel.SetData(map[string]interface{}{"anyKey": "anyValue"}) + replaceObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(replaceObjectOptionsModel).ToNot(BeNil()) + Expect(replaceObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.ParentID).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceObjectOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(replaceObjectOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(replaceObjectOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(replaceObjectOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceObjectOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.Publish).To(Equal(publishObjectModel)) + Expect(replaceObjectOptionsModel.State).To(Equal(stateModel)) + Expect(replaceObjectOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(replaceObjectOptionsModel.Data).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(replaceObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewReplaceOfferingOptions successfully`, func() { + // Construct an instance of the Rating model + ratingModel := new(catalogmanagementv1.Rating) + Expect(ratingModel).ToNot(BeNil()) + ratingModel.OneStarCount = core.Int64Ptr(int64(38)) + ratingModel.TwoStarCount = core.Int64Ptr(int64(38)) + ratingModel.ThreeStarCount = core.Int64Ptr(int64(38)) + ratingModel.FourStarCount = core.Int64Ptr(int64(38)) + Expect(ratingModel.OneStarCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(ratingModel.TwoStarCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(ratingModel.ThreeStarCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(ratingModel.FourStarCount).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the Feature model + featureModel := new(catalogmanagementv1.Feature) + Expect(featureModel).ToNot(BeNil()) + featureModel.Title = core.StringPtr("testString") + featureModel.TitleI18n = map[string]string{"key1": "testString"} + featureModel.Description = core.StringPtr("testString") + featureModel.DescriptionI18n = map[string]string{"key1": "testString"} + Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + + // Construct an instance of the Flavor model + flavorModel := new(catalogmanagementv1.Flavor) + Expect(flavorModel).ToNot(BeNil()) + flavorModel.Name = core.StringPtr("testString") + flavorModel.Label = core.StringPtr("testString") + flavorModel.LabelI18n = map[string]string{"key1": "testString"} + flavorModel.Index = core.Int64Ptr(int64(38)) + Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) + + // Construct an instance of the RenderTypeAssociationsParametersItem model + renderTypeAssociationsParametersItemModel := new(catalogmanagementv1.RenderTypeAssociationsParametersItem) + Expect(renderTypeAssociationsParametersItemModel).ToNot(BeNil()) + renderTypeAssociationsParametersItemModel.Name = core.StringPtr("testString") + renderTypeAssociationsParametersItemModel.OptionsRefresh = core.BoolPtr(true) + Expect(renderTypeAssociationsParametersItemModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeAssociationsParametersItemModel.OptionsRefresh).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the RenderTypeAssociations model + renderTypeAssociationsModel := new(catalogmanagementv1.RenderTypeAssociations) + Expect(renderTypeAssociationsModel).ToNot(BeNil()) + renderTypeAssociationsModel.Parameters = []catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel} + Expect(renderTypeAssociationsModel.Parameters).To(Equal([]catalogmanagementv1.RenderTypeAssociationsParametersItem{*renderTypeAssociationsParametersItemModel})) + + // Construct an instance of the RenderType model + renderTypeModel := new(catalogmanagementv1.RenderType) + Expect(renderTypeModel).ToNot(BeNil()) + renderTypeModel.Type = core.StringPtr("testString") + renderTypeModel.Grouping = core.StringPtr("testString") + renderTypeModel.OriginalGrouping = core.StringPtr("testString") + renderTypeModel.GroupingIndex = core.Int64Ptr(int64(38)) + renderTypeModel.ConfigConstraints = map[string]interface{}{"anyKey": "anyValue"} + renderTypeModel.Associations = renderTypeAssociationsModel + Expect(renderTypeModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeModel.Grouping).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeModel.OriginalGrouping).To(Equal(core.StringPtr("testString"))) + Expect(renderTypeModel.GroupingIndex).To(Equal(core.Int64Ptr(int64(38)))) + Expect(renderTypeModel.ConfigConstraints).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(renderTypeModel.Associations).To(Equal(renderTypeAssociationsModel)) + + // Construct an instance of the Configuration model + configurationModel := new(catalogmanagementv1.Configuration) + Expect(configurationModel).ToNot(BeNil()) + configurationModel.Key = core.StringPtr("testString") + configurationModel.Type = core.StringPtr("testString") + configurationModel.DefaultValue = "testString" + configurationModel.DisplayName = core.StringPtr("testString") + configurationModel.ValueConstraint = core.StringPtr("testString") + configurationModel.Description = core.StringPtr("testString") + configurationModel.Required = core.BoolPtr(true) + configurationModel.Options = []interface{}{"testString"} + configurationModel.Hidden = core.BoolPtr(true) + configurationModel.CustomConfig = renderTypeModel + configurationModel.TypeMetadata = core.StringPtr("testString") + Expect(configurationModel.Key).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.DefaultValue).To(Equal("testString")) + Expect(configurationModel.DisplayName).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.ValueConstraint).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(configurationModel.Required).To(Equal(core.BoolPtr(true))) + Expect(configurationModel.Options).To(Equal([]interface{}{"testString"})) + Expect(configurationModel.Hidden).To(Equal(core.BoolPtr(true))) + Expect(configurationModel.CustomConfig).To(Equal(renderTypeModel)) + Expect(configurationModel.TypeMetadata).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Output model + outputModel := new(catalogmanagementv1.Output) + Expect(outputModel).ToNot(BeNil()) + outputModel.Key = core.StringPtr("testString") + outputModel.Description = core.StringPtr("testString") + Expect(outputModel.Key).To(Equal(core.StringPtr("testString"))) + Expect(outputModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the IamResource model + iamResourceModel := new(catalogmanagementv1.IamResource) + Expect(iamResourceModel).ToNot(BeNil()) + iamResourceModel.Name = core.StringPtr("testString") + iamResourceModel.Description = core.StringPtr("testString") + iamResourceModel.RoleCrns = []string{"testString"} + Expect(iamResourceModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(iamResourceModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(iamResourceModel.RoleCrns).To(Equal([]string{"testString"})) + + // Construct an instance of the IamPermission model + iamPermissionModel := new(catalogmanagementv1.IamPermission) + Expect(iamPermissionModel).ToNot(BeNil()) + iamPermissionModel.ServiceName = core.StringPtr("testString") + iamPermissionModel.RoleCrns = []string{"testString"} + iamPermissionModel.Resources = []catalogmanagementv1.IamResource{*iamResourceModel} + Expect(iamPermissionModel.ServiceName).To(Equal(core.StringPtr("testString"))) + Expect(iamPermissionModel.RoleCrns).To(Equal([]string{"testString"})) + Expect(iamPermissionModel.Resources).To(Equal([]catalogmanagementv1.IamResource{*iamResourceModel})) + + // Construct an instance of the Validation model + validationModel := new(catalogmanagementv1.Validation) + Expect(validationModel).ToNot(BeNil()) + validationModel.Validated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.Requested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + validationModel.State = core.StringPtr("testString") + validationModel.LastOperation = core.StringPtr("testString") + validationModel.Target = map[string]interface{}{"anyKey": "anyValue"} + validationModel.Message = core.StringPtr("testString") + Expect(validationModel.Validated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(validationModel.Requested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(validationModel.State).To(Equal(core.StringPtr("testString"))) + Expect(validationModel.LastOperation).To(Equal(core.StringPtr("testString"))) + Expect(validationModel.Target).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(validationModel.Message).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Resource model + resourceModel := new(catalogmanagementv1.Resource) + Expect(resourceModel).ToNot(BeNil()) + resourceModel.Type = core.StringPtr("mem") + resourceModel.Value = "testString" + Expect(resourceModel.Type).To(Equal(core.StringPtr("mem"))) + Expect(resourceModel.Value).To(Equal("testString")) + + // Construct an instance of the SchematicsEnvValues model + schematicsEnvValuesModel := new(catalogmanagementv1.SchematicsEnvValues) + Expect(schematicsEnvValuesModel).ToNot(BeNil()) + schematicsEnvValuesModel.Value = core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]") + schematicsEnvValuesModel.SmRef = core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}") + Expect(schematicsEnvValuesModel.Value).To(Equal(core.StringPtr("[{\"name\": \"TF_LOG\",\"value\": \"TRACE\",\"secure\": false,\"hidden\": false}]"))) + Expect(schematicsEnvValuesModel.SmRef).To(Equal(core.StringPtr("cmsm_v1:{\"name\": \"envVarSecret\",\"id\":\"1234567890\",\"service_id\":\"crn:v1:bluemix:public:secrets-manager:eu-gb:a/1234567890:1234567890::\",\"service_name\":\"My SM Instance\",\"group_id\":\"1234567890\",\"group_name\":\"My SM Group\",\"resource_group_id\":\"1234567890\",\"region\":\"eu-gb\",\"type\":\"arbitrary\"}"))) + + // Construct an instance of the Script model + scriptModel := new(catalogmanagementv1.Script) + Expect(scriptModel).ToNot(BeNil()) + scriptModel.Instructions = core.StringPtr("testString") + scriptModel.InstructionsI18n = map[string]string{"key1": "testString"} + scriptModel.Script = core.StringPtr("testString") + scriptModel.ScriptPermission = core.StringPtr("testString") + scriptModel.DeleteScript = core.StringPtr("testString") + scriptModel.Scope = core.StringPtr("testString") + Expect(scriptModel.Instructions).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.InstructionsI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(scriptModel.Script).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.ScriptPermission).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.DeleteScript).To(Equal(core.StringPtr("testString"))) + Expect(scriptModel.Scope).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ScriptRef model + scriptRefModel := new(catalogmanagementv1.ScriptRef) + Expect(scriptRefModel).ToNot(BeNil()) + scriptRefModel.ShortDescription = core.StringPtr("testString") + scriptRefModel.Type = core.StringPtr("ansible") + scriptRefModel.Path = core.StringPtr("scripts/validate-post-ansible-playbook.yaml") + scriptRefModel.Stage = core.StringPtr("pre") + scriptRefModel.Action = core.StringPtr("validate") + Expect(scriptRefModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(scriptRefModel.Type).To(Equal(core.StringPtr("ansible"))) + Expect(scriptRefModel.Path).To(Equal(core.StringPtr("scripts/validate-post-ansible-playbook.yaml"))) + Expect(scriptRefModel.Stage).To(Equal(core.StringPtr("pre"))) + Expect(scriptRefModel.Action).To(Equal(core.StringPtr("validate"))) + + // Construct an instance of the VersionEntitlement model + versionEntitlementModel := new(catalogmanagementv1.VersionEntitlement) + Expect(versionEntitlementModel).ToNot(BeNil()) + versionEntitlementModel.ProviderName = core.StringPtr("testString") + versionEntitlementModel.ProviderID = core.StringPtr("testString") + versionEntitlementModel.ProductID = core.StringPtr("testString") + versionEntitlementModel.PartNumbers = []string{"testString"} + versionEntitlementModel.ImageRepoName = core.StringPtr("testString") + Expect(versionEntitlementModel.ProviderName).To(Equal(core.StringPtr("testString"))) + Expect(versionEntitlementModel.ProviderID).To(Equal(core.StringPtr("testString"))) + Expect(versionEntitlementModel.ProductID).To(Equal(core.StringPtr("testString"))) + Expect(versionEntitlementModel.PartNumbers).To(Equal([]string{"testString"})) + Expect(versionEntitlementModel.ImageRepoName).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the License model + licenseModel := new(catalogmanagementv1.License) + Expect(licenseModel).ToNot(BeNil()) + licenseModel.ID = core.StringPtr("testString") + licenseModel.Name = core.StringPtr("testString") + licenseModel.Type = core.StringPtr("testString") + licenseModel.URL = core.StringPtr("testString") + licenseModel.Description = core.StringPtr("testString") + Expect(licenseModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(licenseModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the State model + stateModel := new(catalogmanagementv1.State) + Expect(stateModel).ToNot(BeNil()) + stateModel.Current = core.StringPtr("testString") + stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Pending = core.StringPtr("testString") + stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") + stateModel.Previous = core.StringPtr("testString") + Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) + Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the DeprecatePending model + deprecatePendingModel := new(catalogmanagementv1.DeprecatePending) + Expect(deprecatePendingModel).ToNot(BeNil()) + deprecatePendingModel.DeprecateDate = CreateMockDateTime("2019-01-01T12:00:00.000Z") + deprecatePendingModel.DeprecateState = core.StringPtr("testString") + deprecatePendingModel.Description = core.StringPtr("testString") + Expect(deprecatePendingModel.DeprecateDate).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(deprecatePendingModel.DeprecateState).To(Equal(core.StringPtr("testString"))) + Expect(deprecatePendingModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the URLProxy model + urlProxyModel := new(catalogmanagementv1.URLProxy) + Expect(urlProxyModel).ToNot(BeNil()) + urlProxyModel.URL = core.StringPtr("testString") + urlProxyModel.Sha = core.StringPtr("testString") + Expect(urlProxyModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(urlProxyModel.Sha).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the MediaItem model + mediaItemModel := new(catalogmanagementv1.MediaItem) + Expect(mediaItemModel).ToNot(BeNil()) + mediaItemModel.URL = core.StringPtr("testString") + mediaItemModel.APIURL = core.StringPtr("testString") + mediaItemModel.URLProxy = urlProxyModel + mediaItemModel.Caption = core.StringPtr("testString") + mediaItemModel.CaptionI18n = map[string]string{"key1": "testString"} + mediaItemModel.Type = core.StringPtr("testString") + mediaItemModel.ThumbnailURL = core.StringPtr("testString") + Expect(mediaItemModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.APIURL).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.URLProxy).To(Equal(urlProxyModel)) + Expect(mediaItemModel.Caption).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.CaptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(mediaItemModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(mediaItemModel.ThumbnailURL).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ArchitectureDiagram model + architectureDiagramModel := new(catalogmanagementv1.ArchitectureDiagram) + Expect(architectureDiagramModel).ToNot(BeNil()) + architectureDiagramModel.Diagram = mediaItemModel + architectureDiagramModel.Description = core.StringPtr("testString") + architectureDiagramModel.DescriptionI18n = map[string]string{"key1": "testString"} + Expect(architectureDiagramModel.Diagram).To(Equal(mediaItemModel)) + Expect(architectureDiagramModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(architectureDiagramModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + + // Construct an instance of the CostComponent model + costComponentModel := new(catalogmanagementv1.CostComponent) + Expect(costComponentModel).ToNot(BeNil()) + costComponentModel.Name = core.StringPtr("testString") + costComponentModel.Unit = core.StringPtr("testString") + costComponentModel.HourlyQuantity = core.StringPtr("testString") + costComponentModel.MonthlyQuantity = core.StringPtr("testString") + costComponentModel.Price = core.StringPtr("testString") + costComponentModel.HourlyCost = core.StringPtr("testString") + costComponentModel.MonthlyCost = core.StringPtr("testString") + Expect(costComponentModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.Unit).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.HourlyQuantity).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.MonthlyQuantity).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.Price).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.HourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costComponentModel.MonthlyCost).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the CostResource model + costResourceModel := new(catalogmanagementv1.CostResource) + Expect(costResourceModel).ToNot(BeNil()) + costResourceModel.Name = core.StringPtr("testString") + costResourceModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + costResourceModel.HourlyCost = core.StringPtr("testString") + costResourceModel.MonthlyCost = core.StringPtr("testString") + costResourceModel.CostComponents = []catalogmanagementv1.CostComponent{*costComponentModel} + Expect(costResourceModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(costResourceModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(costResourceModel.HourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costResourceModel.MonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costResourceModel.CostComponents).To(Equal([]catalogmanagementv1.CostComponent{*costComponentModel})) + + // Construct an instance of the CostBreakdown model + costBreakdownModel := new(catalogmanagementv1.CostBreakdown) + Expect(costBreakdownModel).ToNot(BeNil()) + costBreakdownModel.TotalHourlyCost = core.StringPtr("testString") + costBreakdownModel.TotalMonthlyCost = core.StringPtr("testString") + costBreakdownModel.Resources = []catalogmanagementv1.CostResource{*costResourceModel} + Expect(costBreakdownModel.TotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costBreakdownModel.TotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costBreakdownModel.Resources).To(Equal([]catalogmanagementv1.CostResource{*costResourceModel})) + + // Construct an instance of the CostSummary model + costSummaryModel := new(catalogmanagementv1.CostSummary) + Expect(costSummaryModel).ToNot(BeNil()) + costSummaryModel.TotalDetectedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalSupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUnsupportedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalUsageBasedResources = core.Int64Ptr(int64(38)) + costSummaryModel.TotalNoPriceResources = core.Int64Ptr(int64(38)) + costSummaryModel.UnsupportedResourceCounts = map[string]int64{"key1": int64(38)} + costSummaryModel.NoPriceResourceCounts = map[string]int64{"key1": int64(38)} + Expect(costSummaryModel.TotalDetectedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalSupportedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalUnsupportedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalUsageBasedResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.TotalNoPriceResources).To(Equal(core.Int64Ptr(int64(38)))) + Expect(costSummaryModel.UnsupportedResourceCounts).To(Equal(map[string]int64{"key1": int64(38)})) + Expect(costSummaryModel.NoPriceResourceCounts).To(Equal(map[string]int64{"key1": int64(38)})) + + // Construct an instance of the Project model + projectModel := new(catalogmanagementv1.Project) + Expect(projectModel).ToNot(BeNil()) + projectModel.Name = core.StringPtr("testString") + projectModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + projectModel.PastBreakdown = costBreakdownModel + projectModel.Breakdown = costBreakdownModel + projectModel.Diff = costBreakdownModel + projectModel.Summary = costSummaryModel + Expect(projectModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(projectModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(projectModel.PastBreakdown).To(Equal(costBreakdownModel)) + Expect(projectModel.Breakdown).To(Equal(costBreakdownModel)) + Expect(projectModel.Diff).To(Equal(costBreakdownModel)) + Expect(projectModel.Summary).To(Equal(costSummaryModel)) + + // Construct an instance of the CostEstimate model + costEstimateModel := new(catalogmanagementv1.CostEstimate) + Expect(costEstimateModel).ToNot(BeNil()) + costEstimateModel.Version = core.StringPtr("testString") + costEstimateModel.Currency = core.StringPtr("testString") + costEstimateModel.Projects = []catalogmanagementv1.Project{*projectModel} + costEstimateModel.Summary = costSummaryModel + costEstimateModel.TotalHourlyCost = core.StringPtr("testString") + costEstimateModel.TotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.PastTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalHourlyCost = core.StringPtr("testString") + costEstimateModel.DiffTotalMonthlyCost = core.StringPtr("testString") + costEstimateModel.TimeGenerated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + Expect(costEstimateModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.Currency).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.Projects).To(Equal([]catalogmanagementv1.Project{*projectModel})) + Expect(costEstimateModel.Summary).To(Equal(costSummaryModel)) + Expect(costEstimateModel.TotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.TotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.PastTotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.PastTotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.DiffTotalHourlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.DiffTotalMonthlyCost).To(Equal(core.StringPtr("testString"))) + Expect(costEstimateModel.TimeGenerated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + + // Construct an instance of the OfferingReference model + offeringReferenceModel := new(catalogmanagementv1.OfferingReference) + Expect(offeringReferenceModel).ToNot(BeNil()) + offeringReferenceModel.CatalogID = core.StringPtr("testString") + offeringReferenceModel.ID = core.StringPtr("testString") + offeringReferenceModel.Name = core.StringPtr("testString") + offeringReferenceModel.Kind = core.StringPtr("testString") + offeringReferenceModel.Version = core.StringPtr("testString") + offeringReferenceModel.Flavors = []string{"testString"} + Expect(offeringReferenceModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Kind).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(offeringReferenceModel.Flavors).To(Equal([]string{"testString"})) + + // Construct an instance of the SolutionInfo model + solutionInfoModel := new(catalogmanagementv1.SolutionInfo) + Expect(solutionInfoModel).ToNot(BeNil()) + solutionInfoModel.ArchitectureDiagrams = []catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel} + solutionInfoModel.Features = []catalogmanagementv1.Feature{*featureModel} + solutionInfoModel.CostEstimate = costEstimateModel + solutionInfoModel.Dependencies = []catalogmanagementv1.OfferingReference{*offeringReferenceModel} + solutionInfoModel.InstallType = core.StringPtr("testString") + Expect(solutionInfoModel.ArchitectureDiagrams).To(Equal([]catalogmanagementv1.ArchitectureDiagram{*architectureDiagramModel})) + Expect(solutionInfoModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(solutionInfoModel.CostEstimate).To(Equal(costEstimateModel)) + Expect(solutionInfoModel.Dependencies).To(Equal([]catalogmanagementv1.OfferingReference{*offeringReferenceModel})) + Expect(solutionInfoModel.InstallType).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SccProfile model + sccProfileModel := new(catalogmanagementv1.SccProfile) + Expect(sccProfileModel).ToNot(BeNil()) + sccProfileModel.ID = core.StringPtr("testString") + sccProfileModel.Name = core.StringPtr("testString") + sccProfileModel.Version = core.StringPtr("testString") + sccProfileModel.Description = core.StringPtr("testString") + sccProfileModel.Type = core.StringPtr("testString") + sccProfileModel.UIHref = core.StringPtr("testString") + Expect(sccProfileModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(sccProfileModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ClaimedControl model + claimedControlModel := new(catalogmanagementv1.ClaimedControl) + Expect(claimedControlModel).ToNot(BeNil()) + claimedControlModel.Profile = sccProfileModel + claimedControlModel.Names = []string{"testString"} + Expect(claimedControlModel.Profile).To(Equal(sccProfileModel)) + Expect(claimedControlModel.Names).To(Equal([]string{"testString"})) + + // Construct an instance of the Claims model + claimsModel := new(catalogmanagementv1.Claims) + Expect(claimsModel).ToNot(BeNil()) + claimsModel.Profiles = []catalogmanagementv1.SccProfile{*sccProfileModel} + claimsModel.Controls = []catalogmanagementv1.ClaimedControl{*claimedControlModel} + Expect(claimsModel.Profiles).To(Equal([]catalogmanagementv1.SccProfile{*sccProfileModel})) + Expect(claimsModel.Controls).To(Equal([]catalogmanagementv1.ClaimedControl{*claimedControlModel})) + + // Construct an instance of the Result model + resultModel := new(catalogmanagementv1.Result) + Expect(resultModel).ToNot(BeNil()) + resultModel.FailureCount = core.Int64Ptr(int64(38)) + resultModel.ScanTime = CreateMockDateTime("2019-01-01T12:00:00.000Z") + resultModel.ErrorMessage = core.StringPtr("testString") + resultModel.CompleteScan = core.BoolPtr(true) + resultModel.UnscannedResources = []string{"testString"} + Expect(resultModel.FailureCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(resultModel.ScanTime).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(resultModel.ErrorMessage).To(Equal(core.StringPtr("testString"))) + Expect(resultModel.CompleteScan).To(Equal(core.BoolPtr(true))) + Expect(resultModel.UnscannedResources).To(Equal([]string{"testString"})) + + // Construct an instance of the SccAssessment model + sccAssessmentModel := new(catalogmanagementv1.SccAssessment) + Expect(sccAssessmentModel).ToNot(BeNil()) + sccAssessmentModel.ID = core.StringPtr("testString") + sccAssessmentModel.Description = core.StringPtr("testString") + sccAssessmentModel.Version = core.StringPtr("testString") + sccAssessmentModel.Type = core.StringPtr("testString") + sccAssessmentModel.Method = core.StringPtr("testString") + sccAssessmentModel.UIHref = core.StringPtr("testString") + Expect(sccAssessmentModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.Method).To(Equal(core.StringPtr("testString"))) + Expect(sccAssessmentModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SccSpecification model + sccSpecificationModel := new(catalogmanagementv1.SccSpecification) + Expect(sccSpecificationModel).ToNot(BeNil()) + sccSpecificationModel.ID = core.StringPtr("testString") + sccSpecificationModel.Description = core.StringPtr("testString") + sccSpecificationModel.ComponentName = core.StringPtr("testString") + sccSpecificationModel.Assessments = []catalogmanagementv1.SccAssessment{*sccAssessmentModel} + sccSpecificationModel.UIHref = core.StringPtr("testString") + Expect(sccSpecificationModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccSpecificationModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccSpecificationModel.ComponentName).To(Equal(core.StringPtr("testString"))) + Expect(sccSpecificationModel.Assessments).To(Equal([]catalogmanagementv1.SccAssessment{*sccAssessmentModel})) + Expect(sccSpecificationModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SccControl model + sccControlModel := new(catalogmanagementv1.SccControl) + Expect(sccControlModel).ToNot(BeNil()) + sccControlModel.ID = core.StringPtr("testString") + sccControlModel.Name = core.StringPtr("testString") + sccControlModel.Version = core.StringPtr("testString") + sccControlModel.Description = core.StringPtr("testString") + sccControlModel.Profile = sccProfileModel + sccControlModel.ParentName = core.StringPtr("testString") + sccControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + sccControlModel.UIHref = core.StringPtr("testString") + Expect(sccControlModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Profile).To(Equal(sccProfileModel)) + Expect(sccControlModel.ParentName).To(Equal(core.StringPtr("testString"))) + Expect(sccControlModel.Specifications).To(Equal([]catalogmanagementv1.SccSpecification{*sccSpecificationModel})) + Expect(sccControlModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the EvaluatedControl model + evaluatedControlModel := new(catalogmanagementv1.EvaluatedControl) + Expect(evaluatedControlModel).ToNot(BeNil()) + evaluatedControlModel.ID = core.StringPtr("testString") + evaluatedControlModel.Name = core.StringPtr("testString") + evaluatedControlModel.Description = core.StringPtr("testString") + evaluatedControlModel.Specifications = []catalogmanagementv1.SccSpecification{*sccSpecificationModel} + evaluatedControlModel.FailureCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.PassCount = core.Int64Ptr(int64(38)) + evaluatedControlModel.Parent = sccControlModel + evaluatedControlModel.UIHref = core.StringPtr("testString") + Expect(evaluatedControlModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(evaluatedControlModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(evaluatedControlModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(evaluatedControlModel.Specifications).To(Equal([]catalogmanagementv1.SccSpecification{*sccSpecificationModel})) + Expect(evaluatedControlModel.FailureCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(evaluatedControlModel.PassCount).To(Equal(core.Int64Ptr(int64(38)))) + Expect(evaluatedControlModel.Parent).To(Equal(sccControlModel)) + Expect(evaluatedControlModel.UIHref).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Evaluation model + evaluationModel := new(catalogmanagementv1.Evaluation) + Expect(evaluationModel).ToNot(BeNil()) + evaluationModel.ScanID = core.StringPtr("testString") + evaluationModel.AccountID = core.StringPtr("testString") + evaluationModel.Profile = sccProfileModel + evaluationModel.Result = resultModel + evaluationModel.Controls = []catalogmanagementv1.EvaluatedControl{*evaluatedControlModel} + Expect(evaluationModel.ScanID).To(Equal(core.StringPtr("testString"))) + Expect(evaluationModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(evaluationModel.Profile).To(Equal(sccProfileModel)) + Expect(evaluationModel.Result).To(Equal(resultModel)) + Expect(evaluationModel.Controls).To(Equal([]catalogmanagementv1.EvaluatedControl{*evaluatedControlModel})) + + // Construct an instance of the Compliance model + complianceModel := new(catalogmanagementv1.Compliance) + Expect(complianceModel).ToNot(BeNil()) + complianceModel.Authority = core.StringPtr("testString") + complianceModel.Claims = claimsModel + complianceModel.Evaluations = []catalogmanagementv1.Evaluation{*evaluationModel} + Expect(complianceModel.Authority).To(Equal(core.StringPtr("testString"))) + Expect(complianceModel.Claims).To(Equal(claimsModel)) + Expect(complianceModel.Evaluations).To(Equal([]catalogmanagementv1.Evaluation{*evaluationModel})) + + // Construct an instance of the ChangeNotices model + changeNoticesModel := new(catalogmanagementv1.ChangeNotices) + Expect(changeNoticesModel).ToNot(BeNil()) + changeNoticesModel.Breaking = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.New = []catalogmanagementv1.Feature{*featureModel} + changeNoticesModel.Update = []catalogmanagementv1.Feature{*featureModel} + Expect(changeNoticesModel.Breaking).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(changeNoticesModel.New).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(changeNoticesModel.Update).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + + // Construct an instance of the Version model + versionModel := new(catalogmanagementv1.Version) + Expect(versionModel).ToNot(BeNil()) + versionModel.CRN = core.StringPtr("testString") + versionModel.Version = core.StringPtr("testString") + versionModel.Flavor = flavorModel + versionModel.Sha = core.StringPtr("testString") + versionModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + versionModel.OfferingID = core.StringPtr("testString") + versionModel.CatalogID = core.StringPtr("testString") + versionModel.KindID = core.StringPtr("testString") + versionModel.Tags = []string{"testString"} + versionModel.RepoURL = core.StringPtr("testString") + versionModel.SourceURL = core.StringPtr("testString") + versionModel.TgzURL = core.StringPtr("testString") + versionModel.Configuration = []catalogmanagementv1.Configuration{*configurationModel} + versionModel.Outputs = []catalogmanagementv1.Output{*outputModel} + versionModel.IamPermissions = []catalogmanagementv1.IamPermission{*iamPermissionModel} + versionModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Validation = validationModel + versionModel.RequiredResources = []catalogmanagementv1.Resource{*resourceModel} + versionModel.SingleInstance = core.BoolPtr(true) + versionModel.SchematicsEnvValues = schematicsEnvValuesModel + versionModel.Install = scriptModel + versionModel.PreInstall = []catalogmanagementv1.Script{*scriptModel} + versionModel.Scripts = map[string]catalogmanagementv1.ScriptRef{"key1": *scriptRefModel} + versionModel.Entitlement = versionEntitlementModel + versionModel.Licenses = []catalogmanagementv1.License{*licenseModel} + versionModel.ImageManifestURL = core.StringPtr("testString") + versionModel.Deprecated = core.BoolPtr(true) + versionModel.PackageVersion = core.StringPtr("testString") + versionModel.State = stateModel + versionModel.VersionLocator = core.StringPtr("testString") + versionModel.LongDescription = core.StringPtr("testString") + versionModel.LongDescriptionI18n = map[string]string{"key1": "testString"} + versionModel.WhitelistedAccounts = []string{"testString"} + versionModel.ImagePullKeyName = core.StringPtr("testString") + versionModel.DeprecatePending = deprecatePendingModel + versionModel.SolutionInfo = solutionInfoModel + versionModel.IsConsumable = core.BoolPtr(true) + versionModel.ComplianceV3 = complianceModel + versionModel.ChangeNotices = changeNoticesModel + versionModel.PlanIds = []string{"testString"} + versionModel.Stack = map[string]interface{}{"anyKey": "anyValue"} + versionModel.Scripts["foo"] = *scriptRefModel + Expect(versionModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Flavor).To(Equal(flavorModel)) + Expect(versionModel.Sha).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(versionModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(versionModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.KindID).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Tags).To(Equal([]string{"testString"})) + Expect(versionModel.RepoURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.SourceURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.TgzURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Configuration).To(Equal([]catalogmanagementv1.Configuration{*configurationModel})) + Expect(versionModel.Outputs).To(Equal([]catalogmanagementv1.Output{*outputModel})) + Expect(versionModel.IamPermissions).To(Equal([]catalogmanagementv1.IamPermission{*iamPermissionModel})) + Expect(versionModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(versionModel.Validation).To(Equal(validationModel)) + Expect(versionModel.RequiredResources).To(Equal([]catalogmanagementv1.Resource{*resourceModel})) + Expect(versionModel.SingleInstance).To(Equal(core.BoolPtr(true))) + Expect(versionModel.SchematicsEnvValues).To(Equal(schematicsEnvValuesModel)) + Expect(versionModel.Install).To(Equal(scriptModel)) + Expect(versionModel.PreInstall).To(Equal([]catalogmanagementv1.Script{*scriptModel})) + Expect(versionModel.Entitlement).To(Equal(versionEntitlementModel)) + Expect(versionModel.Licenses).To(Equal([]catalogmanagementv1.License{*licenseModel})) + Expect(versionModel.ImageManifestURL).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.Deprecated).To(Equal(core.BoolPtr(true))) + Expect(versionModel.PackageVersion).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.State).To(Equal(stateModel)) + Expect(versionModel.VersionLocator).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.LongDescription).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(versionModel.WhitelistedAccounts).To(Equal([]string{"testString"})) + Expect(versionModel.ImagePullKeyName).To(Equal(core.StringPtr("testString"))) + Expect(versionModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(versionModel.SolutionInfo).To(Equal(solutionInfoModel)) + Expect(versionModel.IsConsumable).To(Equal(core.BoolPtr(true))) + Expect(versionModel.ComplianceV3).To(Equal(complianceModel)) + Expect(versionModel.ChangeNotices).To(Equal(changeNoticesModel)) + Expect(versionModel.PlanIds).To(Equal([]string{"testString"})) + Expect(versionModel.Stack).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(versionModel.Scripts["foo"]).To(Equal(*scriptRefModel)) + + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + Expect(paginationTokenLinkModel).ToNot(BeNil()) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + Expect(paginationTokenLinkModel.Href).To(Equal(core.StringPtr("testString"))) + Expect(paginationTokenLinkModel.Start).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + Expect(kindAllVersionsModel).ToNot(BeNil()) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + Expect(kindAllVersionsModel.First).To(Equal(paginationTokenLinkModel)) + Expect(kindAllVersionsModel.Next).To(Equal(paginationTokenLinkModel)) + + // Construct an instance of the Kind model + kindModel := new(catalogmanagementv1.Kind) + Expect(kindModel).ToNot(BeNil()) + kindModel.ID = core.StringPtr("testString") + kindModel.FormatKind = core.StringPtr("testString") + kindModel.FormatKindLabel = core.StringPtr("testString") + kindModel.InstallKind = core.StringPtr("testString") + kindModel.InstallKindLabel = core.StringPtr("testString") + kindModel.TargetKind = core.StringPtr("testString") + kindModel.TargetKindLabel = core.StringPtr("testString") + kindModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + kindModel.Tags = []string{"testString"} + kindModel.AdditionalFeatures = []catalogmanagementv1.Feature{*featureModel} + kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel + Expect(kindModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.FormatKind).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.FormatKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.InstallKind).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.InstallKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.TargetKind).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.TargetKindLabel).To(Equal(core.StringPtr("testString"))) + Expect(kindModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(kindModel.Tags).To(Equal([]string{"testString"})) + Expect(kindModel.AdditionalFeatures).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(kindModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(kindModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(kindModel.Versions).To(Equal([]catalogmanagementv1.Version{*versionModel})) + Expect(kindModel.AllVersions).To(Equal(kindAllVersionsModel)) + + // Construct an instance of the PublishObject model + publishObjectModel := new(catalogmanagementv1.PublishObject) + Expect(publishObjectModel).ToNot(BeNil()) + publishObjectModel.PcManaged = core.BoolPtr(true) + publishObjectModel.ApprovalType = core.StringPtr("testString") + publishObjectModel.PublishApproved = core.BoolPtr(true) + publishObjectModel.ShareWithAll = core.BoolPtr(true) + publishObjectModel.ShareWithIBM = core.BoolPtr(true) + publishObjectModel.ShareEnabled = core.BoolPtr(true) + publishObjectModel.OriginalCRN = core.StringPtr("testString") + publishObjectModel.PublicCRN = core.StringPtr("testString") + publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} + publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) + publishObjectModel.IBMApproved = core.BoolPtr(true) + publishObjectModel.PublicApproved = core.BoolPtr(true) + Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) + Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ProviderInfo model + providerInfoModel := new(catalogmanagementv1.ProviderInfo) + Expect(providerInfoModel).ToNot(BeNil()) + providerInfoModel.ID = core.StringPtr("testString") + providerInfoModel.Name = core.StringPtr("testString") + Expect(providerInfoModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(providerInfoModel.Name).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the RepoInfo model + repoInfoModel := new(catalogmanagementv1.RepoInfo) + Expect(repoInfoModel).ToNot(BeNil()) + repoInfoModel.Token = core.StringPtr("testString") + repoInfoModel.Type = core.StringPtr("testString") + Expect(repoInfoModel.Token).To(Equal(core.StringPtr("testString"))) + Expect(repoInfoModel.Type).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the ImagePullKey model + imagePullKeyModel := new(catalogmanagementv1.ImagePullKey) + Expect(imagePullKeyModel).ToNot(BeNil()) + imagePullKeyModel.Name = core.StringPtr("testString") + imagePullKeyModel.Value = core.StringPtr("testString") + imagePullKeyModel.Description = core.StringPtr("testString") + Expect(imagePullKeyModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(imagePullKeyModel.Value).To(Equal(core.StringPtr("testString"))) + Expect(imagePullKeyModel.Description).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SupportWaitTime model + supportWaitTimeModel := new(catalogmanagementv1.SupportWaitTime) + Expect(supportWaitTimeModel).ToNot(BeNil()) + supportWaitTimeModel.Value = core.Int64Ptr(int64(38)) + supportWaitTimeModel.Type = core.StringPtr("testString") + Expect(supportWaitTimeModel.Value).To(Equal(core.Int64Ptr(int64(38)))) + Expect(supportWaitTimeModel.Type).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SupportTime model + supportTimeModel := new(catalogmanagementv1.SupportTime) + Expect(supportTimeModel).ToNot(BeNil()) + supportTimeModel.Day = core.Int64Ptr(int64(38)) + supportTimeModel.StartTime = core.StringPtr("testString") + supportTimeModel.EndTime = core.StringPtr("testString") + Expect(supportTimeModel.Day).To(Equal(core.Int64Ptr(int64(38)))) + Expect(supportTimeModel.StartTime).To(Equal(core.StringPtr("testString"))) + Expect(supportTimeModel.EndTime).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the SupportAvailability model + supportAvailabilityModel := new(catalogmanagementv1.SupportAvailability) + Expect(supportAvailabilityModel).ToNot(BeNil()) + supportAvailabilityModel.Times = []catalogmanagementv1.SupportTime{*supportTimeModel} + supportAvailabilityModel.Timezone = core.StringPtr("testString") + supportAvailabilityModel.AlwaysAvailable = core.BoolPtr(true) + Expect(supportAvailabilityModel.Times).To(Equal([]catalogmanagementv1.SupportTime{*supportTimeModel})) + Expect(supportAvailabilityModel.Timezone).To(Equal(core.StringPtr("testString"))) + Expect(supportAvailabilityModel.AlwaysAvailable).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the SupportDetail model + supportDetailModel := new(catalogmanagementv1.SupportDetail) + Expect(supportDetailModel).ToNot(BeNil()) + supportDetailModel.Type = core.StringPtr("testString") + supportDetailModel.Contact = core.StringPtr("testString") + supportDetailModel.ResponseWaitTime = supportWaitTimeModel + supportDetailModel.Availability = supportAvailabilityModel + Expect(supportDetailModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(supportDetailModel.Contact).To(Equal(core.StringPtr("testString"))) + Expect(supportDetailModel.ResponseWaitTime).To(Equal(supportWaitTimeModel)) + Expect(supportDetailModel.Availability).To(Equal(supportAvailabilityModel)) + + // Construct an instance of the SupportEscalation model + supportEscalationModel := new(catalogmanagementv1.SupportEscalation) + Expect(supportEscalationModel).ToNot(BeNil()) + supportEscalationModel.EscalationWaitTime = supportWaitTimeModel + supportEscalationModel.ResponseWaitTime = supportWaitTimeModel + supportEscalationModel.Contact = core.StringPtr("testString") + Expect(supportEscalationModel.EscalationWaitTime).To(Equal(supportWaitTimeModel)) + Expect(supportEscalationModel.ResponseWaitTime).To(Equal(supportWaitTimeModel)) + Expect(supportEscalationModel.Contact).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Support model + supportModel := new(catalogmanagementv1.Support) + Expect(supportModel).ToNot(BeNil()) + supportModel.URL = core.StringPtr("testString") + supportModel.Process = core.StringPtr("testString") + supportModel.ProcessI18n = map[string]string{"key1": "testString"} + supportModel.Locations = []string{"testString"} + supportModel.SupportDetails = []catalogmanagementv1.SupportDetail{*supportDetailModel} + supportModel.SupportEscalation = supportEscalationModel + supportModel.SupportType = core.StringPtr("testString") + Expect(supportModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(supportModel.Process).To(Equal(core.StringPtr("testString"))) + Expect(supportModel.ProcessI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(supportModel.Locations).To(Equal([]string{"testString"})) + Expect(supportModel.SupportDetails).To(Equal([]catalogmanagementv1.SupportDetail{*supportDetailModel})) + Expect(supportModel.SupportEscalation).To(Equal(supportEscalationModel)) + Expect(supportModel.SupportType).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the LearnMoreLinks model + learnMoreLinksModel := new(catalogmanagementv1.LearnMoreLinks) + Expect(learnMoreLinksModel).ToNot(BeNil()) + learnMoreLinksModel.FirstParty = core.StringPtr("testString") + learnMoreLinksModel.ThirdParty = core.StringPtr("testString") + Expect(learnMoreLinksModel.FirstParty).To(Equal(core.StringPtr("testString"))) + Expect(learnMoreLinksModel.ThirdParty).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the Constraint model + constraintModel := new(catalogmanagementv1.Constraint) + Expect(constraintModel).ToNot(BeNil()) + constraintModel.Type = core.StringPtr("testString") + constraintModel.Rule = "testString" + Expect(constraintModel.Type).To(Equal(core.StringPtr("testString"))) + Expect(constraintModel.Rule).To(Equal("testString")) + + // Construct an instance of the Badge model + badgeModel := new(catalogmanagementv1.Badge) + Expect(badgeModel).ToNot(BeNil()) + badgeModel.ID = core.StringPtr("testString") + badgeModel.Label = core.StringPtr("testString") + badgeModel.LabelI18n = map[string]string{"key1": "testString"} + badgeModel.Description = core.StringPtr("testString") + badgeModel.DescriptionI18n = map[string]string{"key1": "testString"} + badgeModel.Icon = core.StringPtr("testString") + badgeModel.Authority = core.StringPtr("testString") + badgeModel.Tag = core.StringPtr("testString") + badgeModel.LearnMoreLinks = learnMoreLinksModel + badgeModel.Constraints = []catalogmanagementv1.Constraint{*constraintModel} + Expect(badgeModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(badgeModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(badgeModel.Icon).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.Authority).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.Tag).To(Equal(core.StringPtr("testString"))) + Expect(badgeModel.LearnMoreLinks).To(Equal(learnMoreLinksModel)) + Expect(badgeModel.Constraints).To(Equal([]catalogmanagementv1.Constraint{*constraintModel})) + + // Construct an instance of the VersionRange model + versionRangeModel := new(catalogmanagementv1.VersionRange) + Expect(versionRangeModel).ToNot(BeNil()) + versionRangeModel.Kinds = []string{"testString"} + versionRangeModel.Version = core.StringPtr("testString") + versionRangeModel.Flavors = []string{"testString"} + Expect(versionRangeModel.Kinds).To(Equal([]string{"testString"})) + Expect(versionRangeModel.Version).To(Equal(core.StringPtr("testString"))) + Expect(versionRangeModel.Flavors).To(Equal([]string{"testString"})) + + // Construct an instance of the Plan model + planModel := new(catalogmanagementv1.Plan) + Expect(planModel).ToNot(BeNil()) + planModel.URL = core.StringPtr("testString") + planModel.CRN = core.StringPtr("testString") + planModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") + planModel.OfferingID = core.StringPtr("testString") + planModel.CatalogID = core.StringPtr("testString") + planModel.Label = core.StringPtr("testString") + planModel.LabelI18n = map[string]string{"key1": "testString"} + planModel.Name = core.StringPtr("testString") + planModel.ShortDescription = core.StringPtr("testString") + planModel.ShortDescriptionI18n = map[string]string{"key1": "testString"} + planModel.PricingTags = []string{"testString"} + planModel.VersionRange = versionRangeModel + planModel.Features = []catalogmanagementv1.Feature{*featureModel} + planModel.State = stateModel + planModel.DeprecatePending = deprecatePendingModel + planModel.Metadata = map[string]interface{}{"anyKey": "anyValue"} + planModel.PublishApproved = core.BoolPtr(true) + Expect(planModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(planModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(planModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(planModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(planModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(planModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(planModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(planModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(planModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(planModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(planModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(planModel.PricingTags).To(Equal([]string{"testString"})) + Expect(planModel.VersionRange).To(Equal(versionRangeModel)) + Expect(planModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(planModel.State).To(Equal(stateModel)) + Expect(planModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(planModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(planModel.PublishApproved).To(Equal(core.BoolPtr(true))) + + // Construct an instance of the ReplaceOfferingOptions model + catalogIdentifier := "testString" + offeringID := "testString" + replaceOfferingOptionsModel := catalogManagementService.NewReplaceOfferingOptions(catalogIdentifier, offeringID) + replaceOfferingOptionsModel.SetCatalogIdentifier("testString") + replaceOfferingOptionsModel.SetOfferingID("testString") + replaceOfferingOptionsModel.SetID("testString") + replaceOfferingOptionsModel.SetRev("testString") + replaceOfferingOptionsModel.SetURL("testString") + replaceOfferingOptionsModel.SetCRN("testString") + replaceOfferingOptionsModel.SetLabel("testString") + replaceOfferingOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + replaceOfferingOptionsModel.SetName("testString") + replaceOfferingOptionsModel.SetOfferingIconURL("testString") + replaceOfferingOptionsModel.SetOfferingDocsURL("testString") + replaceOfferingOptionsModel.SetOfferingSupportURL("testString") + replaceOfferingOptionsModel.SetTags([]string{"testString"}) + replaceOfferingOptionsModel.SetKeywords([]string{"testString"}) + replaceOfferingOptionsModel.SetRating(ratingModel) + replaceOfferingOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + replaceOfferingOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + replaceOfferingOptionsModel.SetShortDescription("testString") + replaceOfferingOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + replaceOfferingOptionsModel.SetLongDescription("testString") + replaceOfferingOptionsModel.SetLongDescriptionI18n(map[string]string{"key1": "testString"}) + replaceOfferingOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) + replaceOfferingOptionsModel.SetKinds([]catalogmanagementv1.Kind{*kindModel}) + replaceOfferingOptionsModel.SetPublish(publishObjectModel) + replaceOfferingOptionsModel.SetPcManaged(true) + replaceOfferingOptionsModel.SetPublishApproved(true) + replaceOfferingOptionsModel.SetShareWithAll(true) + replaceOfferingOptionsModel.SetShareWithIBM(true) + replaceOfferingOptionsModel.SetShareEnabled(true) + replaceOfferingOptionsModel.SetPublicOriginalCRN("testString") + replaceOfferingOptionsModel.SetPublishPublicCRN("testString") + replaceOfferingOptionsModel.SetPortalApprovalRecord("testString") + replaceOfferingOptionsModel.SetPortalUIURL("testString") + replaceOfferingOptionsModel.SetCatalogID("testString") + replaceOfferingOptionsModel.SetCatalogName("testString") + replaceOfferingOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + replaceOfferingOptionsModel.SetDisclaimer("testString") + replaceOfferingOptionsModel.SetHidden(true) + replaceOfferingOptionsModel.SetProvider("testString") + replaceOfferingOptionsModel.SetProviderInfo(providerInfoModel) + replaceOfferingOptionsModel.SetRepoInfo(repoInfoModel) + replaceOfferingOptionsModel.SetImagePullKeys([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel}) + replaceOfferingOptionsModel.SetSupport(supportModel) + replaceOfferingOptionsModel.SetMedia([]catalogmanagementv1.MediaItem{*mediaItemModel}) + replaceOfferingOptionsModel.SetDeprecatePending(deprecatePendingModel) + replaceOfferingOptionsModel.SetProductKind("testString") + replaceOfferingOptionsModel.SetBadges([]catalogmanagementv1.Badge{*badgeModel}) + replaceOfferingOptionsModel.SetPlans([]catalogmanagementv1.Plan{*planModel}) + replaceOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(replaceOfferingOptionsModel).ToNot(BeNil()) + Expect(replaceOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceOfferingOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.OfferingIconURL).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.OfferingDocsURL).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.OfferingSupportURL).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(replaceOfferingOptionsModel.Keywords).To(Equal([]string{"testString"})) + Expect(replaceOfferingOptionsModel.Rating).To(Equal(ratingModel)) + Expect(replaceOfferingOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(replaceOfferingOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(replaceOfferingOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceOfferingOptionsModel.LongDescription).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(replaceOfferingOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(replaceOfferingOptionsModel.Kinds).To(Equal([]catalogmanagementv1.Kind{*kindModel})) + Expect(replaceOfferingOptionsModel.Publish).To(Equal(publishObjectModel)) + Expect(replaceOfferingOptionsModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(replaceOfferingOptionsModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(replaceOfferingOptionsModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(replaceOfferingOptionsModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(replaceOfferingOptionsModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(replaceOfferingOptionsModel.PublicOriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.PublishPublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.PortalApprovalRecord).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.PortalUIURL).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(replaceOfferingOptionsModel.Disclaimer).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.Hidden).To(Equal(core.BoolPtr(true))) + Expect(replaceOfferingOptionsModel.Provider).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.ProviderInfo).To(Equal(providerInfoModel)) + Expect(replaceOfferingOptionsModel.RepoInfo).To(Equal(repoInfoModel)) + Expect(replaceOfferingOptionsModel.ImagePullKeys).To(Equal([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel})) + Expect(replaceOfferingOptionsModel.Support).To(Equal(supportModel)) + Expect(replaceOfferingOptionsModel.Media).To(Equal([]catalogmanagementv1.MediaItem{*mediaItemModel})) + Expect(replaceOfferingOptionsModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(replaceOfferingOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) + Expect(replaceOfferingOptionsModel.Badges).To(Equal([]catalogmanagementv1.Badge{*badgeModel})) + Expect(replaceOfferingOptionsModel.Plans).To(Equal([]catalogmanagementv1.Plan{*planModel})) + Expect(replaceOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewReplaceOperatorsOptions successfully`, func() { + // Construct an instance of the ReplaceOperatorsOptions model + xAuthRefreshToken := "testString" + replaceOperatorsOptionsModel := catalogManagementService.NewReplaceOperatorsOptions(xAuthRefreshToken) + replaceOperatorsOptionsModel.SetXAuthRefreshToken("testString") + replaceOperatorsOptionsModel.SetClusterID("testString") + replaceOperatorsOptionsModel.SetRegion("testString") + replaceOperatorsOptionsModel.SetNamespaces([]string{"testString"}) + replaceOperatorsOptionsModel.SetAllNamespaces(true) + replaceOperatorsOptionsModel.SetVersionLocatorID("testString") + replaceOperatorsOptionsModel.SetChannel("testString") + replaceOperatorsOptionsModel.SetInstallPlan("testString") + replaceOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(replaceOperatorsOptionsModel).ToNot(BeNil()) + Expect(replaceOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) + Expect(replaceOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) + Expect(replaceOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) + Expect(replaceOperatorsOptionsModel.Namespaces).To(Equal([]string{"testString"})) + Expect(replaceOperatorsOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) + Expect(replaceOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) + Expect(replaceOperatorsOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(replaceOperatorsOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(replaceOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewPrereleaseVersionOptions successfully`, func() { - // Construct an instance of the PrereleaseVersionOptions model + It(`Invoke NewSearchObjectsOptions successfully`, func() { + // Construct an instance of the SearchObjectsOptions model + query := "testString" + searchObjectsOptionsModel := catalogManagementService.NewSearchObjectsOptions(query) + searchObjectsOptionsModel.SetQuery("testString") + searchObjectsOptionsModel.SetKind("vpe") + searchObjectsOptionsModel.SetLimit(int64(10)) + searchObjectsOptionsModel.SetOffset(int64(0)) + searchObjectsOptionsModel.SetCollapse(true) + searchObjectsOptionsModel.SetDigest(true) + searchObjectsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(searchObjectsOptionsModel).ToNot(BeNil()) + Expect(searchObjectsOptionsModel.Query).To(Equal(core.StringPtr("testString"))) + Expect(searchObjectsOptionsModel.Kind).To(Equal(core.StringPtr("vpe"))) + Expect(searchObjectsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) + Expect(searchObjectsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) + Expect(searchObjectsOptionsModel.Collapse).To(Equal(core.BoolPtr(true))) + Expect(searchObjectsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) + Expect(searchObjectsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewSetDeprecatePlanOptions successfully`, func() { + // Construct an instance of the SetDeprecatePlanOptions model + planLocID := "testString" + setting := "true" + setDeprecatePlanOptionsModel := catalogManagementService.NewSetDeprecatePlanOptions(planLocID, setting) + setDeprecatePlanOptionsModel.SetPlanLocID("testString") + setDeprecatePlanOptionsModel.SetSetting("true") + setDeprecatePlanOptionsModel.SetDescription("testString") + setDeprecatePlanOptionsModel.SetDaysUntilDeprecate(int64(38)) + setDeprecatePlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(setDeprecatePlanOptionsModel).ToNot(BeNil()) + Expect(setDeprecatePlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) + Expect(setDeprecatePlanOptionsModel.Setting).To(Equal(core.StringPtr("true"))) + Expect(setDeprecatePlanOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(setDeprecatePlanOptionsModel.DaysUntilDeprecate).To(Equal(core.Int64Ptr(int64(38)))) + Expect(setDeprecatePlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewSetDeprecateVersionOptions successfully`, func() { + // Construct an instance of the SetDeprecateVersionOptions model versionLocID := "testString" - prereleaseVersionOptionsModel := catalogManagementService.NewPrereleaseVersionOptions(versionLocID) - prereleaseVersionOptionsModel.SetVersionLocID("testString") - prereleaseVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(prereleaseVersionOptionsModel).ToNot(BeNil()) - Expect(prereleaseVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(prereleaseVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + setting := "true" + setDeprecateVersionOptionsModel := catalogManagementService.NewSetDeprecateVersionOptions(versionLocID, setting) + setDeprecateVersionOptionsModel.SetVersionLocID("testString") + setDeprecateVersionOptionsModel.SetSetting("true") + setDeprecateVersionOptionsModel.SetDescription("testString") + setDeprecateVersionOptionsModel.SetDaysUntilDeprecate(int64(38)) + setDeprecateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(setDeprecateVersionOptionsModel).ToNot(BeNil()) + Expect(setDeprecateVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(setDeprecateVersionOptionsModel.Setting).To(Equal(core.StringPtr("true"))) + Expect(setDeprecateVersionOptionsModel.Description).To(Equal(core.StringPtr("testString"))) + Expect(setDeprecateVersionOptionsModel.DaysUntilDeprecate).To(Equal(core.Int64Ptr(int64(38)))) + Expect(setDeprecateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewPutOfferingInstanceOptions successfully`, func() { - // Construct an instance of the OfferingInstanceLastOperation model - offeringInstanceLastOperationModel := new(catalogmanagementv1.OfferingInstanceLastOperation) - Expect(offeringInstanceLastOperationModel).ToNot(BeNil()) - offeringInstanceLastOperationModel.Operation = core.StringPtr("testString") - offeringInstanceLastOperationModel.State = core.StringPtr("testString") - offeringInstanceLastOperationModel.Message = core.StringPtr("testString") - offeringInstanceLastOperationModel.TransactionID = core.StringPtr("testString") - offeringInstanceLastOperationModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") - offeringInstanceLastOperationModel.Code = core.StringPtr("testString") - Expect(offeringInstanceLastOperationModel.Operation).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.State).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.Message).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.TransactionID).To(Equal(core.StringPtr("testString"))) - Expect(offeringInstanceLastOperationModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(offeringInstanceLastOperationModel.Code).To(Equal(core.StringPtr("testString"))) - - // Construct an instance of the PutOfferingInstanceOptions model - instanceIdentifier := "testString" - xAuthRefreshToken := "testString" - putOfferingInstanceOptionsModel := catalogManagementService.NewPutOfferingInstanceOptions(instanceIdentifier, xAuthRefreshToken) - putOfferingInstanceOptionsModel.SetInstanceIdentifier("testString") - putOfferingInstanceOptionsModel.SetXAuthRefreshToken("testString") - putOfferingInstanceOptionsModel.SetID("testString") - putOfferingInstanceOptionsModel.SetRev("testString") - putOfferingInstanceOptionsModel.SetURL("testString") - putOfferingInstanceOptionsModel.SetCRN("testString") - putOfferingInstanceOptionsModel.SetLabel("testString") - putOfferingInstanceOptionsModel.SetCatalogID("testString") - putOfferingInstanceOptionsModel.SetOfferingID("testString") - putOfferingInstanceOptionsModel.SetKindFormat("testString") - putOfferingInstanceOptionsModel.SetKindFormatLabel("testString") - putOfferingInstanceOptionsModel.SetVersion("testString") - putOfferingInstanceOptionsModel.SetVersionID("testString") - putOfferingInstanceOptionsModel.SetClusterID("testString") - putOfferingInstanceOptionsModel.SetClusterRegion("testString") - putOfferingInstanceOptionsModel.SetClusterNamespaces([]string{"testString"}) - putOfferingInstanceOptionsModel.SetClusterAllNamespaces(true) - putOfferingInstanceOptionsModel.SetSchematicsWorkspaceID("testString") - putOfferingInstanceOptionsModel.SetInstallPlan("testString") - putOfferingInstanceOptionsModel.SetChannel("testString") - putOfferingInstanceOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - putOfferingInstanceOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - putOfferingInstanceOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) - putOfferingInstanceOptionsModel.SetResourceGroupID("testString") - putOfferingInstanceOptionsModel.SetLocation("testString") - putOfferingInstanceOptionsModel.SetDisabled(true) - putOfferingInstanceOptionsModel.SetAccount("testString") - putOfferingInstanceOptionsModel.SetLastOperation(offeringInstanceLastOperationModel) - putOfferingInstanceOptionsModel.SetKindTarget("testString") - putOfferingInstanceOptionsModel.SetKindTargetLabel("testString") - putOfferingInstanceOptionsModel.SetSha("testString") - putOfferingInstanceOptionsModel.SetPlanID("testString") - putOfferingInstanceOptionsModel.SetParentCRN("testString") - putOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(putOfferingInstanceOptionsModel).ToNot(BeNil()) - Expect(putOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.KindFormat).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.KindFormatLabel).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Version).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.VersionID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.ClusterRegion).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.ClusterNamespaces).To(Equal([]string{"testString"})) - Expect(putOfferingInstanceOptionsModel.ClusterAllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(putOfferingInstanceOptionsModel.SchematicsWorkspaceID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(putOfferingInstanceOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(putOfferingInstanceOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(putOfferingInstanceOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Location).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) - Expect(putOfferingInstanceOptionsModel.Account).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.LastOperation).To(Equal(offeringInstanceLastOperationModel)) - Expect(putOfferingInstanceOptionsModel.KindTarget).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.KindTargetLabel).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Sha).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.PlanID).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.ParentCRN).To(Equal(core.StringPtr("testString"))) - Expect(putOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + It(`Invoke NewSetOfferingPublishOptions successfully`, func() { + // Construct an instance of the SetOfferingPublishOptions model + catalogIdentifier := "testString" + offeringID := "testString" + approvalType := "pc_managed" + approved := "true" + setOfferingPublishOptionsModel := catalogManagementService.NewSetOfferingPublishOptions(catalogIdentifier, offeringID, approvalType, approved) + setOfferingPublishOptionsModel.SetCatalogIdentifier("testString") + setOfferingPublishOptionsModel.SetOfferingID("testString") + setOfferingPublishOptionsModel.SetApprovalType("pc_managed") + setOfferingPublishOptionsModel.SetApproved("true") + setOfferingPublishOptionsModel.SetPortalRecord("testString") + setOfferingPublishOptionsModel.SetPortalURL("testString") + setOfferingPublishOptionsModel.SetXApproverToken("testString") + setOfferingPublishOptionsModel.SetXAuthToken("testString") + setOfferingPublishOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(setOfferingPublishOptionsModel).ToNot(BeNil()) + Expect(setOfferingPublishOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(setOfferingPublishOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(setOfferingPublishOptionsModel.ApprovalType).To(Equal(core.StringPtr("pc_managed"))) + Expect(setOfferingPublishOptionsModel.Approved).To(Equal(core.StringPtr("true"))) + Expect(setOfferingPublishOptionsModel.PortalRecord).To(Equal(core.StringPtr("testString"))) + Expect(setOfferingPublishOptionsModel.PortalURL).To(Equal(core.StringPtr("testString"))) + Expect(setOfferingPublishOptionsModel.XApproverToken).To(Equal(core.StringPtr("testString"))) + Expect(setOfferingPublishOptionsModel.XAuthToken).To(Equal(core.StringPtr("testString"))) + Expect(setOfferingPublishOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewReloadOfferingOptions successfully`, func() { - // Construct an instance of the Flavor model - flavorModel := new(catalogmanagementv1.Flavor) - Expect(flavorModel).ToNot(BeNil()) - flavorModel.Name = core.StringPtr("testString") - flavorModel.Label = core.StringPtr("testString") - flavorModel.LabelI18n = map[string]string{"key1": "testString"} - flavorModel.Index = core.Int64Ptr(int64(38)) - Expect(flavorModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(flavorModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(flavorModel.Index).To(Equal(core.Int64Ptr(int64(38)))) - - // Construct an instance of the ReloadOfferingOptions model + It(`Invoke NewShareObjectOptions successfully`, func() { + // Construct an instance of the ShareObjectOptions model + catalogIdentifier := "testString" + objectIdentifier := "testString" + shareObjectOptionsModel := catalogManagementService.NewShareObjectOptions(catalogIdentifier, objectIdentifier) + shareObjectOptionsModel.SetCatalogIdentifier("testString") + shareObjectOptionsModel.SetObjectIdentifier("testString") + shareObjectOptionsModel.SetIBM(true) + shareObjectOptionsModel.SetPublic(true) + shareObjectOptionsModel.SetEnabled(true) + shareObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(shareObjectOptionsModel).ToNot(BeNil()) + Expect(shareObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(shareObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(shareObjectOptionsModel.IBM).To(Equal(core.BoolPtr(true))) + Expect(shareObjectOptionsModel.Public).To(Equal(core.BoolPtr(true))) + Expect(shareObjectOptionsModel.Enabled).To(Equal(core.BoolPtr(true))) + Expect(shareObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewShareOfferingOptions successfully`, func() { + // Construct an instance of the ShareOfferingOptions model catalogIdentifier := "testString" offeringID := "testString" - targetVersion := "testString" - reloadOfferingOptionsModel := catalogManagementService.NewReloadOfferingOptions(catalogIdentifier, offeringID, targetVersion) - reloadOfferingOptionsModel.SetCatalogIdentifier("testString") - reloadOfferingOptionsModel.SetOfferingID("testString") - reloadOfferingOptionsModel.SetTargetVersion("testString") - reloadOfferingOptionsModel.SetTags([]string{"testString"}) - reloadOfferingOptionsModel.SetContent(*CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=")) - reloadOfferingOptionsModel.SetTargetKinds([]string{"testString"}) - reloadOfferingOptionsModel.SetFormatKind("testString") - reloadOfferingOptionsModel.SetFlavor(flavorModel) - reloadOfferingOptionsModel.SetWorkingDirectory("testString") - reloadOfferingOptionsModel.SetZipurl("testString") - reloadOfferingOptionsModel.SetRepoType("testString") - reloadOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(reloadOfferingOptionsModel).ToNot(BeNil()) - Expect(reloadOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.TargetVersion).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(reloadOfferingOptionsModel.Content).To(Equal(CreateMockByteArray("VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4="))) - Expect(reloadOfferingOptionsModel.TargetKinds).To(Equal([]string{"testString"})) - Expect(reloadOfferingOptionsModel.FormatKind).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.Flavor).To(Equal(flavorModel)) - Expect(reloadOfferingOptionsModel.WorkingDirectory).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.Zipurl).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.RepoType).To(Equal(core.StringPtr("testString"))) - Expect(reloadOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + shareOfferingOptionsModel := catalogManagementService.NewShareOfferingOptions(catalogIdentifier, offeringID) + shareOfferingOptionsModel.SetCatalogIdentifier("testString") + shareOfferingOptionsModel.SetOfferingID("testString") + shareOfferingOptionsModel.SetIBM(true) + shareOfferingOptionsModel.SetPublic(true) + shareOfferingOptionsModel.SetEnabled(true) + shareOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(shareOfferingOptionsModel).ToNot(BeNil()) + Expect(shareOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(shareOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(shareOfferingOptionsModel.IBM).To(Equal(core.BoolPtr(true))) + Expect(shareOfferingOptionsModel.Public).To(Equal(core.BoolPtr(true))) + Expect(shareOfferingOptionsModel.Enabled).To(Equal(core.BoolPtr(true))) + Expect(shareOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewReplaceCatalogOptions successfully`, func() { - // Construct an instance of the Feature model - featureModel := new(catalogmanagementv1.Feature) - Expect(featureModel).ToNot(BeNil()) - featureModel.Title = core.StringPtr("testString") - featureModel.TitleI18n = map[string]string{"key1": "testString"} - featureModel.Description = core.StringPtr("testString") - featureModel.DescriptionI18n = map[string]string{"key1": "testString"} - Expect(featureModel.Title).To(Equal(core.StringPtr("testString"))) - Expect(featureModel.TitleI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(featureModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(featureModel.DescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - + It(`Invoke NewSuspendVersionOptions successfully`, func() { + // Construct an instance of the SuspendVersionOptions model + versionLocID := "testString" + suspendVersionOptionsModel := catalogManagementService.NewSuspendVersionOptions(versionLocID) + suspendVersionOptionsModel.SetVersionLocID("testString") + suspendVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(suspendVersionOptionsModel).ToNot(BeNil()) + Expect(suspendVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(suspendVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewUpdateCatalogAccountOptions successfully`, func() { // Construct an instance of the FilterTerms model filterTermsModel := new(catalogmanagementv1.FilterTerms) Expect(filterTermsModel).ToNot(BeNil()) @@ -31967,169 +38204,75 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(filtersModel.IDFilters).To(Equal(idFilterModel)) Expect(filtersModel.CategoryFilters["foo"]).To(Equal(*categoryFilterModel)) - // Construct an instance of the TrustedProfileInfo model - trustedProfileInfoModel := new(catalogmanagementv1.TrustedProfileInfo) - Expect(trustedProfileInfoModel).ToNot(BeNil()) - trustedProfileInfoModel.TrustedProfileID = core.StringPtr("testString") - trustedProfileInfoModel.CatalogCRN = core.StringPtr("testString") - trustedProfileInfoModel.CatalogName = core.StringPtr("testString") - trustedProfileInfoModel.TargetServiceID = core.StringPtr("testString") - Expect(trustedProfileInfoModel.TrustedProfileID).To(Equal(core.StringPtr("testString"))) - Expect(trustedProfileInfoModel.CatalogCRN).To(Equal(core.StringPtr("testString"))) - Expect(trustedProfileInfoModel.CatalogName).To(Equal(core.StringPtr("testString"))) - Expect(trustedProfileInfoModel.TargetServiceID).To(Equal(core.StringPtr("testString"))) - - // Construct an instance of the TargetAccountContext model - targetAccountContextModel := new(catalogmanagementv1.TargetAccountContext) - Expect(targetAccountContextModel).ToNot(BeNil()) - targetAccountContextModel.APIKey = core.StringPtr("testString") - targetAccountContextModel.TrustedProfile = trustedProfileInfoModel - targetAccountContextModel.Name = core.StringPtr("testString") - targetAccountContextModel.Label = core.StringPtr("testString") - targetAccountContextModel.ProjectID = core.StringPtr("testString") - Expect(targetAccountContextModel.APIKey).To(Equal(core.StringPtr("testString"))) - Expect(targetAccountContextModel.TrustedProfile).To(Equal(trustedProfileInfoModel)) - Expect(targetAccountContextModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(targetAccountContextModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(targetAccountContextModel.ProjectID).To(Equal(core.StringPtr("testString"))) - - // Construct an instance of the ReplaceCatalogOptions model - catalogIdentifier := "testString" - replaceCatalogOptionsModel := catalogManagementService.NewReplaceCatalogOptions(catalogIdentifier) - replaceCatalogOptionsModel.SetCatalogIdentifier("testString") - replaceCatalogOptionsModel.SetID("testString") - replaceCatalogOptionsModel.SetRev("testString") - replaceCatalogOptionsModel.SetLabel("testString") - replaceCatalogOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) - replaceCatalogOptionsModel.SetShortDescription("testString") - replaceCatalogOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) - replaceCatalogOptionsModel.SetCatalogIconURL("testString") - replaceCatalogOptionsModel.SetCatalogBannerURL("testString") - replaceCatalogOptionsModel.SetTags([]string{"testString"}) - replaceCatalogOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) - replaceCatalogOptionsModel.SetDisabled(true) - replaceCatalogOptionsModel.SetResourceGroupID("testString") - replaceCatalogOptionsModel.SetOwningAccount("testString") - replaceCatalogOptionsModel.SetCatalogFilters(filtersModel) - replaceCatalogOptionsModel.SetKind("testString") - replaceCatalogOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) - replaceCatalogOptionsModel.SetTargetAccountContexts([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel}) - replaceCatalogOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(replaceCatalogOptionsModel).ToNot(BeNil()) - Expect(replaceCatalogOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceCatalogOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceCatalogOptionsModel.CatalogIconURL).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.CatalogBannerURL).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(replaceCatalogOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(replaceCatalogOptionsModel.Disabled).To(Equal(core.BoolPtr(true))) - Expect(replaceCatalogOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.OwningAccount).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.CatalogFilters).To(Equal(filtersModel)) - Expect(replaceCatalogOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(replaceCatalogOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(replaceCatalogOptionsModel.TargetAccountContexts).To(Equal([]catalogmanagementv1.TargetAccountContext{*targetAccountContextModel})) - Expect(replaceCatalogOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + // Construct an instance of the UpdateCatalogAccountOptions model + updateCatalogAccountOptionsModel := catalogManagementService.NewUpdateCatalogAccountOptions() + updateCatalogAccountOptionsModel.SetID("testString") + updateCatalogAccountOptionsModel.SetRev("testString") + updateCatalogAccountOptionsModel.SetHideIBMCloudCatalog(true) + updateCatalogAccountOptionsModel.SetAccountFilters(filtersModel) + updateCatalogAccountOptionsModel.SetRegionFilters([]string{"testString"}) + updateCatalogAccountOptionsModel.SetFilteredRegions([]string{"testString"}) + updateCatalogAccountOptionsModel.SetFilterRegions(true) + updateCatalogAccountOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateCatalogAccountOptionsModel).ToNot(BeNil()) + Expect(updateCatalogAccountOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(updateCatalogAccountOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(updateCatalogAccountOptionsModel.HideIBMCloudCatalog).To(Equal(core.BoolPtr(true))) + Expect(updateCatalogAccountOptionsModel.AccountFilters).To(Equal(filtersModel)) + Expect(updateCatalogAccountOptionsModel.RegionFilters).To(Equal([]string{"testString"})) + Expect(updateCatalogAccountOptionsModel.FilteredRegions).To(Equal([]string{"testString"})) + Expect(updateCatalogAccountOptionsModel.FilterRegions).To(Equal(core.BoolPtr(true))) + Expect(updateCatalogAccountOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewReplaceObjectOptions successfully`, func() { - // Construct an instance of the PublishObject model - publishObjectModel := new(catalogmanagementv1.PublishObject) - Expect(publishObjectModel).ToNot(BeNil()) - publishObjectModel.PcManaged = core.BoolPtr(true) - publishObjectModel.ApprovalType = core.StringPtr("testString") - publishObjectModel.PublishApproved = core.BoolPtr(true) - publishObjectModel.ShareWithAll = core.BoolPtr(true) - publishObjectModel.ShareWithIBM = core.BoolPtr(true) - publishObjectModel.ShareEnabled = core.BoolPtr(true) - publishObjectModel.OriginalCRN = core.StringPtr("testString") - publishObjectModel.PublicCRN = core.StringPtr("testString") - publishObjectModel.ApprovalRecord = map[string]interface{}{"anyKey": "anyValue"} - publishObjectModel.PermitIBMPublicPublish = core.BoolPtr(true) - publishObjectModel.IBMApproved = core.BoolPtr(true) - publishObjectModel.PublicApproved = core.BoolPtr(true) - Expect(publishObjectModel.PcManaged).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ApprovalType).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.PublishApproved).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareWithAll).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.ShareEnabled).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.OriginalCRN).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.PublicCRN).To(Equal(core.StringPtr("testString"))) - Expect(publishObjectModel.ApprovalRecord).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(publishObjectModel.PermitIBMPublicPublish).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.IBMApproved).To(Equal(core.BoolPtr(true))) - Expect(publishObjectModel.PublicApproved).To(Equal(core.BoolPtr(true))) - - // Construct an instance of the State model - stateModel := new(catalogmanagementv1.State) - Expect(stateModel).ToNot(BeNil()) - stateModel.Current = core.StringPtr("testString") - stateModel.CurrentEntered = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Pending = core.StringPtr("testString") - stateModel.PendingRequested = CreateMockDateTime("2019-01-01T12:00:00.000Z") - stateModel.Previous = core.StringPtr("testString") - Expect(stateModel.Current).To(Equal(core.StringPtr("testString"))) - Expect(stateModel.CurrentEntered).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(stateModel.Pending).To(Equal(core.StringPtr("testString"))) - Expect(stateModel.PendingRequested).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(stateModel.Previous).To(Equal(core.StringPtr("testString"))) + It(`Invoke NewUpdateOfferingOptions successfully`, func() { + // Construct an instance of the JSONPatchOperation model + jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) + Expect(jsonPatchOperationModel).ToNot(BeNil()) + jsonPatchOperationModel.Op = core.StringPtr("add") + jsonPatchOperationModel.Path = core.StringPtr("testString") + jsonPatchOperationModel.Value = "testString" + jsonPatchOperationModel.From = core.StringPtr("testString") + Expect(jsonPatchOperationModel.Op).To(Equal(core.StringPtr("add"))) + Expect(jsonPatchOperationModel.Path).To(Equal(core.StringPtr("testString"))) + Expect(jsonPatchOperationModel.Value).To(Equal("testString")) + Expect(jsonPatchOperationModel.From).To(Equal(core.StringPtr("testString"))) - // Construct an instance of the ReplaceObjectOptions model + // Construct an instance of the UpdateOfferingOptions model catalogIdentifier := "testString" - objectIdentifier := "testString" - replaceObjectOptionsModel := catalogManagementService.NewReplaceObjectOptions(catalogIdentifier, objectIdentifier) - replaceObjectOptionsModel.SetCatalogIdentifier("testString") - replaceObjectOptionsModel.SetObjectIdentifier("testString") - replaceObjectOptionsModel.SetID("testString") - replaceObjectOptionsModel.SetRev("testString") - replaceObjectOptionsModel.SetName("testString") - replaceObjectOptionsModel.SetCRN("testString") - replaceObjectOptionsModel.SetURL("testString") - replaceObjectOptionsModel.SetParentID("testString") - replaceObjectOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) - replaceObjectOptionsModel.SetLabel("testString") - replaceObjectOptionsModel.SetTags([]string{"testString"}) - replaceObjectOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - replaceObjectOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - replaceObjectOptionsModel.SetShortDescription("testString") - replaceObjectOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) - replaceObjectOptionsModel.SetKind("testString") - replaceObjectOptionsModel.SetPublish(publishObjectModel) - replaceObjectOptionsModel.SetState(stateModel) - replaceObjectOptionsModel.SetCatalogID("testString") - replaceObjectOptionsModel.SetCatalogName("testString") - replaceObjectOptionsModel.SetData(map[string]interface{}{"anyKey": "anyValue"}) - replaceObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(replaceObjectOptionsModel).ToNot(BeNil()) - Expect(replaceObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.ParentID).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceObjectOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(replaceObjectOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(replaceObjectOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(replaceObjectOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceObjectOptionsModel.Kind).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.Publish).To(Equal(publishObjectModel)) - Expect(replaceObjectOptionsModel.State).To(Equal(stateModel)) - Expect(replaceObjectOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) - Expect(replaceObjectOptionsModel.Data).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(replaceObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + offeringID := "testString" + ifMatch := "testString" + updateOfferingOptionsModel := catalogManagementService.NewUpdateOfferingOptions(catalogIdentifier, offeringID, ifMatch) + updateOfferingOptionsModel.SetCatalogIdentifier("testString") + updateOfferingOptionsModel.SetOfferingID("testString") + updateOfferingOptionsModel.SetIfMatch("testString") + updateOfferingOptionsModel.SetUpdates([]catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel}) + updateOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateOfferingOptionsModel).ToNot(BeNil()) + Expect(updateOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) + Expect(updateOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) + Expect(updateOfferingOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) + Expect(updateOfferingOptionsModel.Updates).To(Equal([]catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel})) + Expect(updateOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) - It(`Invoke NewReplaceOfferingOptions successfully`, func() { + It(`Invoke NewUpdateShareApprovalListAsSourceOptions successfully`, func() { + // Construct an instance of the UpdateShareApprovalListAsSourceOptions model + objectType := "offering" + approvalStateIdentifier := "approved" + accesses := []string{"testString"} + updateShareApprovalListAsSourceOptionsModel := catalogManagementService.NewUpdateShareApprovalListAsSourceOptions(objectType, approvalStateIdentifier, accesses) + updateShareApprovalListAsSourceOptionsModel.SetObjectType("offering") + updateShareApprovalListAsSourceOptionsModel.SetApprovalStateIdentifier("approved") + updateShareApprovalListAsSourceOptionsModel.SetAccesses([]string{"testString"}) + updateShareApprovalListAsSourceOptionsModel.SetEnterpriseID("testString") + updateShareApprovalListAsSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateShareApprovalListAsSourceOptionsModel).ToNot(BeNil()) + Expect(updateShareApprovalListAsSourceOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) + Expect(updateShareApprovalListAsSourceOptionsModel.ApprovalStateIdentifier).To(Equal(core.StringPtr("approved"))) + Expect(updateShareApprovalListAsSourceOptionsModel.Accesses).To(Equal([]string{"testString"})) + Expect(updateShareApprovalListAsSourceOptionsModel.EnterpriseID).To(Equal(core.StringPtr("testString"))) + Expect(updateShareApprovalListAsSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewUpdateVersionOptions successfully`, func() { // Construct an instance of the Rating model ratingModel := new(catalogmanagementv1.Rating) Expect(ratingModel).ToNot(BeNil()) @@ -32771,6 +38914,22 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(versionModel.Stack).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) Expect(versionModel.Scripts["foo"]).To(Equal(*scriptRefModel)) + // Construct an instance of the PaginationTokenLink model + paginationTokenLinkModel := new(catalogmanagementv1.PaginationTokenLink) + Expect(paginationTokenLinkModel).ToNot(BeNil()) + paginationTokenLinkModel.Href = core.StringPtr("testString") + paginationTokenLinkModel.Start = core.StringPtr("testString") + Expect(paginationTokenLinkModel.Href).To(Equal(core.StringPtr("testString"))) + Expect(paginationTokenLinkModel.Start).To(Equal(core.StringPtr("testString"))) + + // Construct an instance of the KindAllVersions model + kindAllVersionsModel := new(catalogmanagementv1.KindAllVersions) + Expect(kindAllVersionsModel).ToNot(BeNil()) + kindAllVersionsModel.First = paginationTokenLinkModel + kindAllVersionsModel.Next = paginationTokenLinkModel + Expect(kindAllVersionsModel.First).To(Equal(paginationTokenLinkModel)) + Expect(kindAllVersionsModel.Next).To(Equal(paginationTokenLinkModel)) + // Construct an instance of the Kind model kindModel := new(catalogmanagementv1.Kind) Expect(kindModel).ToNot(BeNil()) @@ -32787,6 +38946,7 @@ var _ = Describe(`CatalogManagementV1`, func() { kindModel.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") kindModel.Versions = []catalogmanagementv1.Version{*versionModel} + kindModel.AllVersions = kindAllVersionsModel Expect(kindModel.ID).To(Equal(core.StringPtr("testString"))) Expect(kindModel.FormatKind).To(Equal(core.StringPtr("testString"))) Expect(kindModel.FormatKindLabel).To(Equal(core.StringPtr("testString"))) @@ -32800,6 +38960,7 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(kindModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) Expect(kindModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) Expect(kindModel.Versions).To(Equal([]catalogmanagementv1.Version{*versionModel})) + Expect(kindModel.AllVersions).To(Equal(kindAllVersionsModel)) // Construct an instance of the PublishObject model publishObjectModel := new(catalogmanagementv1.PublishObject) @@ -33013,358 +39174,120 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(planModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) Expect(planModel.PublishApproved).To(Equal(core.BoolPtr(true))) - // Construct an instance of the ReplaceOfferingOptions model - catalogIdentifier := "testString" - offeringID := "testString" - replaceOfferingOptionsModel := catalogManagementService.NewReplaceOfferingOptions(catalogIdentifier, offeringID) - replaceOfferingOptionsModel.SetCatalogIdentifier("testString") - replaceOfferingOptionsModel.SetOfferingID("testString") - replaceOfferingOptionsModel.SetID("testString") - replaceOfferingOptionsModel.SetRev("testString") - replaceOfferingOptionsModel.SetURL("testString") - replaceOfferingOptionsModel.SetCRN("testString") - replaceOfferingOptionsModel.SetLabel("testString") - replaceOfferingOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) - replaceOfferingOptionsModel.SetName("testString") - replaceOfferingOptionsModel.SetOfferingIconURL("testString") - replaceOfferingOptionsModel.SetOfferingDocsURL("testString") - replaceOfferingOptionsModel.SetOfferingSupportURL("testString") - replaceOfferingOptionsModel.SetTags([]string{"testString"}) - replaceOfferingOptionsModel.SetKeywords([]string{"testString"}) - replaceOfferingOptionsModel.SetRating(ratingModel) - replaceOfferingOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - replaceOfferingOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) - replaceOfferingOptionsModel.SetShortDescription("testString") - replaceOfferingOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) - replaceOfferingOptionsModel.SetLongDescription("testString") - replaceOfferingOptionsModel.SetLongDescriptionI18n(map[string]string{"key1": "testString"}) - replaceOfferingOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) - replaceOfferingOptionsModel.SetKinds([]catalogmanagementv1.Kind{*kindModel}) - replaceOfferingOptionsModel.SetPublish(publishObjectModel) - replaceOfferingOptionsModel.SetPcManaged(true) - replaceOfferingOptionsModel.SetPublishApproved(true) - replaceOfferingOptionsModel.SetShareWithAll(true) - replaceOfferingOptionsModel.SetShareWithIBM(true) - replaceOfferingOptionsModel.SetShareEnabled(true) - replaceOfferingOptionsModel.SetPublicOriginalCRN("testString") - replaceOfferingOptionsModel.SetPublishPublicCRN("testString") - replaceOfferingOptionsModel.SetPortalApprovalRecord("testString") - replaceOfferingOptionsModel.SetPortalUIURL("testString") - replaceOfferingOptionsModel.SetCatalogID("testString") - replaceOfferingOptionsModel.SetCatalogName("testString") - replaceOfferingOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) - replaceOfferingOptionsModel.SetDisclaimer("testString") - replaceOfferingOptionsModel.SetHidden(true) - replaceOfferingOptionsModel.SetProvider("testString") - replaceOfferingOptionsModel.SetProviderInfo(providerInfoModel) - replaceOfferingOptionsModel.SetRepoInfo(repoInfoModel) - replaceOfferingOptionsModel.SetImagePullKeys([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel}) - replaceOfferingOptionsModel.SetSupport(supportModel) - replaceOfferingOptionsModel.SetMedia([]catalogmanagementv1.MediaItem{*mediaItemModel}) - replaceOfferingOptionsModel.SetDeprecatePending(deprecatePendingModel) - replaceOfferingOptionsModel.SetProductKind("testString") - replaceOfferingOptionsModel.SetBadges([]catalogmanagementv1.Badge{*badgeModel}) - replaceOfferingOptionsModel.SetPlans([]catalogmanagementv1.Plan{*planModel}) - replaceOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(replaceOfferingOptionsModel).ToNot(BeNil()) - Expect(replaceOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.URL).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.Label).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceOfferingOptionsModel.Name).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.OfferingIconURL).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.OfferingDocsURL).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.OfferingSupportURL).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.Tags).To(Equal([]string{"testString"})) - Expect(replaceOfferingOptionsModel.Keywords).To(Equal([]string{"testString"})) - Expect(replaceOfferingOptionsModel.Rating).To(Equal(ratingModel)) - Expect(replaceOfferingOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(replaceOfferingOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) - Expect(replaceOfferingOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceOfferingOptionsModel.LongDescription).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) - Expect(replaceOfferingOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) - Expect(replaceOfferingOptionsModel.Kinds).To(Equal([]catalogmanagementv1.Kind{*kindModel})) - Expect(replaceOfferingOptionsModel.Publish).To(Equal(publishObjectModel)) - Expect(replaceOfferingOptionsModel.PcManaged).To(Equal(core.BoolPtr(true))) - Expect(replaceOfferingOptionsModel.PublishApproved).To(Equal(core.BoolPtr(true))) - Expect(replaceOfferingOptionsModel.ShareWithAll).To(Equal(core.BoolPtr(true))) - Expect(replaceOfferingOptionsModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) - Expect(replaceOfferingOptionsModel.ShareEnabled).To(Equal(core.BoolPtr(true))) - Expect(replaceOfferingOptionsModel.PublicOriginalCRN).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.PublishPublicCRN).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.PortalApprovalRecord).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.PortalUIURL).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) - Expect(replaceOfferingOptionsModel.Disclaimer).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.Hidden).To(Equal(core.BoolPtr(true))) - Expect(replaceOfferingOptionsModel.Provider).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.ProviderInfo).To(Equal(providerInfoModel)) - Expect(replaceOfferingOptionsModel.RepoInfo).To(Equal(repoInfoModel)) - Expect(replaceOfferingOptionsModel.ImagePullKeys).To(Equal([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel})) - Expect(replaceOfferingOptionsModel.Support).To(Equal(supportModel)) - Expect(replaceOfferingOptionsModel.Media).To(Equal([]catalogmanagementv1.MediaItem{*mediaItemModel})) - Expect(replaceOfferingOptionsModel.DeprecatePending).To(Equal(deprecatePendingModel)) - Expect(replaceOfferingOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) - Expect(replaceOfferingOptionsModel.Badges).To(Equal([]catalogmanagementv1.Badge{*badgeModel})) - Expect(replaceOfferingOptionsModel.Plans).To(Equal([]catalogmanagementv1.Plan{*planModel})) - Expect(replaceOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewReplaceOperatorsOptions successfully`, func() { - // Construct an instance of the ReplaceOperatorsOptions model - xAuthRefreshToken := "testString" - replaceOperatorsOptionsModel := catalogManagementService.NewReplaceOperatorsOptions(xAuthRefreshToken) - replaceOperatorsOptionsModel.SetXAuthRefreshToken("testString") - replaceOperatorsOptionsModel.SetClusterID("testString") - replaceOperatorsOptionsModel.SetRegion("testString") - replaceOperatorsOptionsModel.SetNamespaces([]string{"testString"}) - replaceOperatorsOptionsModel.SetAllNamespaces(true) - replaceOperatorsOptionsModel.SetVersionLocatorID("testString") - replaceOperatorsOptionsModel.SetChannel("testString") - replaceOperatorsOptionsModel.SetInstallPlan("testString") - replaceOperatorsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(replaceOperatorsOptionsModel).ToNot(BeNil()) - Expect(replaceOperatorsOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) - Expect(replaceOperatorsOptionsModel.ClusterID).To(Equal(core.StringPtr("testString"))) - Expect(replaceOperatorsOptionsModel.Region).To(Equal(core.StringPtr("testString"))) - Expect(replaceOperatorsOptionsModel.Namespaces).To(Equal([]string{"testString"})) - Expect(replaceOperatorsOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) - Expect(replaceOperatorsOptionsModel.VersionLocatorID).To(Equal(core.StringPtr("testString"))) - Expect(replaceOperatorsOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) - Expect(replaceOperatorsOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) - Expect(replaceOperatorsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewSearchObjectsOptions successfully`, func() { - // Construct an instance of the SearchObjectsOptions model - query := "testString" - searchObjectsOptionsModel := catalogManagementService.NewSearchObjectsOptions(query) - searchObjectsOptionsModel.SetQuery("testString") - searchObjectsOptionsModel.SetKind("vpe") - searchObjectsOptionsModel.SetLimit(int64(10)) - searchObjectsOptionsModel.SetOffset(int64(0)) - searchObjectsOptionsModel.SetCollapse(true) - searchObjectsOptionsModel.SetDigest(true) - searchObjectsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(searchObjectsOptionsModel).ToNot(BeNil()) - Expect(searchObjectsOptionsModel.Query).To(Equal(core.StringPtr("testString"))) - Expect(searchObjectsOptionsModel.Kind).To(Equal(core.StringPtr("vpe"))) - Expect(searchObjectsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) - Expect(searchObjectsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) - Expect(searchObjectsOptionsModel.Collapse).To(Equal(core.BoolPtr(true))) - Expect(searchObjectsOptionsModel.Digest).To(Equal(core.BoolPtr(true))) - Expect(searchObjectsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewSetDeprecatePlanOptions successfully`, func() { - // Construct an instance of the SetDeprecatePlanOptions model - planLocID := "testString" - setting := "true" - setDeprecatePlanOptionsModel := catalogManagementService.NewSetDeprecatePlanOptions(planLocID, setting) - setDeprecatePlanOptionsModel.SetPlanLocID("testString") - setDeprecatePlanOptionsModel.SetSetting("true") - setDeprecatePlanOptionsModel.SetDescription("testString") - setDeprecatePlanOptionsModel.SetDaysUntilDeprecate(int64(38)) - setDeprecatePlanOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(setDeprecatePlanOptionsModel).ToNot(BeNil()) - Expect(setDeprecatePlanOptionsModel.PlanLocID).To(Equal(core.StringPtr("testString"))) - Expect(setDeprecatePlanOptionsModel.Setting).To(Equal(core.StringPtr("true"))) - Expect(setDeprecatePlanOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(setDeprecatePlanOptionsModel.DaysUntilDeprecate).To(Equal(core.Int64Ptr(int64(38)))) - Expect(setDeprecatePlanOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewSetDeprecateVersionOptions successfully`, func() { - // Construct an instance of the SetDeprecateVersionOptions model + // Construct an instance of the UpdateVersionOptions model versionLocID := "testString" - setting := "true" - setDeprecateVersionOptionsModel := catalogManagementService.NewSetDeprecateVersionOptions(versionLocID, setting) - setDeprecateVersionOptionsModel.SetVersionLocID("testString") - setDeprecateVersionOptionsModel.SetSetting("true") - setDeprecateVersionOptionsModel.SetDescription("testString") - setDeprecateVersionOptionsModel.SetDaysUntilDeprecate(int64(38)) - setDeprecateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(setDeprecateVersionOptionsModel).ToNot(BeNil()) - Expect(setDeprecateVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(setDeprecateVersionOptionsModel.Setting).To(Equal(core.StringPtr("true"))) - Expect(setDeprecateVersionOptionsModel.Description).To(Equal(core.StringPtr("testString"))) - Expect(setDeprecateVersionOptionsModel.DaysUntilDeprecate).To(Equal(core.Int64Ptr(int64(38)))) - Expect(setDeprecateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewSetOfferingPublishOptions successfully`, func() { - // Construct an instance of the SetOfferingPublishOptions model - catalogIdentifier := "testString" - offeringID := "testString" - approvalType := "pc_managed" - approved := "true" - setOfferingPublishOptionsModel := catalogManagementService.NewSetOfferingPublishOptions(catalogIdentifier, offeringID, approvalType, approved) - setOfferingPublishOptionsModel.SetCatalogIdentifier("testString") - setOfferingPublishOptionsModel.SetOfferingID("testString") - setOfferingPublishOptionsModel.SetApprovalType("pc_managed") - setOfferingPublishOptionsModel.SetApproved("true") - setOfferingPublishOptionsModel.SetPortalRecord("testString") - setOfferingPublishOptionsModel.SetPortalURL("testString") - setOfferingPublishOptionsModel.SetXApproverToken("testString") - setOfferingPublishOptionsModel.SetXAuthToken("testString") - setOfferingPublishOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(setOfferingPublishOptionsModel).ToNot(BeNil()) - Expect(setOfferingPublishOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(setOfferingPublishOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(setOfferingPublishOptionsModel.ApprovalType).To(Equal(core.StringPtr("pc_managed"))) - Expect(setOfferingPublishOptionsModel.Approved).To(Equal(core.StringPtr("true"))) - Expect(setOfferingPublishOptionsModel.PortalRecord).To(Equal(core.StringPtr("testString"))) - Expect(setOfferingPublishOptionsModel.PortalURL).To(Equal(core.StringPtr("testString"))) - Expect(setOfferingPublishOptionsModel.XApproverToken).To(Equal(core.StringPtr("testString"))) - Expect(setOfferingPublishOptionsModel.XAuthToken).To(Equal(core.StringPtr("testString"))) - Expect(setOfferingPublishOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewShareObjectOptions successfully`, func() { - // Construct an instance of the ShareObjectOptions model - catalogIdentifier := "testString" - objectIdentifier := "testString" - shareObjectOptionsModel := catalogManagementService.NewShareObjectOptions(catalogIdentifier, objectIdentifier) - shareObjectOptionsModel.SetCatalogIdentifier("testString") - shareObjectOptionsModel.SetObjectIdentifier("testString") - shareObjectOptionsModel.SetIBM(true) - shareObjectOptionsModel.SetPublic(true) - shareObjectOptionsModel.SetEnabled(true) - shareObjectOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(shareObjectOptionsModel).ToNot(BeNil()) - Expect(shareObjectOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(shareObjectOptionsModel.ObjectIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(shareObjectOptionsModel.IBM).To(Equal(core.BoolPtr(true))) - Expect(shareObjectOptionsModel.Public).To(Equal(core.BoolPtr(true))) - Expect(shareObjectOptionsModel.Enabled).To(Equal(core.BoolPtr(true))) - Expect(shareObjectOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewShareOfferingOptions successfully`, func() { - // Construct an instance of the ShareOfferingOptions model - catalogIdentifier := "testString" - offeringID := "testString" - shareOfferingOptionsModel := catalogManagementService.NewShareOfferingOptions(catalogIdentifier, offeringID) - shareOfferingOptionsModel.SetCatalogIdentifier("testString") - shareOfferingOptionsModel.SetOfferingID("testString") - shareOfferingOptionsModel.SetIBM(true) - shareOfferingOptionsModel.SetPublic(true) - shareOfferingOptionsModel.SetEnabled(true) - shareOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(shareOfferingOptionsModel).ToNot(BeNil()) - Expect(shareOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(shareOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(shareOfferingOptionsModel.IBM).To(Equal(core.BoolPtr(true))) - Expect(shareOfferingOptionsModel.Public).To(Equal(core.BoolPtr(true))) - Expect(shareOfferingOptionsModel.Enabled).To(Equal(core.BoolPtr(true))) - Expect(shareOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewSuspendVersionOptions successfully`, func() { - // Construct an instance of the SuspendVersionOptions model + updateVersionOptionsModel := catalogManagementService.NewUpdateVersionOptions(versionLocID) + updateVersionOptionsModel.SetVersionLocID("testString") + updateVersionOptionsModel.SetID("testString") + updateVersionOptionsModel.SetRev("testString") + updateVersionOptionsModel.SetURL("testString") + updateVersionOptionsModel.SetCRN("testString") + updateVersionOptionsModel.SetLabel("testString") + updateVersionOptionsModel.SetLabelI18n(map[string]string{"key1": "testString"}) + updateVersionOptionsModel.SetName("testString") + updateVersionOptionsModel.SetOfferingIconURL("testString") + updateVersionOptionsModel.SetOfferingDocsURL("testString") + updateVersionOptionsModel.SetOfferingSupportURL("testString") + updateVersionOptionsModel.SetTags([]string{"testString"}) + updateVersionOptionsModel.SetKeywords([]string{"testString"}) + updateVersionOptionsModel.SetRating(ratingModel) + updateVersionOptionsModel.SetCreated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + updateVersionOptionsModel.SetUpdated(CreateMockDateTime("2019-01-01T12:00:00.000Z")) + updateVersionOptionsModel.SetShortDescription("testString") + updateVersionOptionsModel.SetShortDescriptionI18n(map[string]string{"key1": "testString"}) + updateVersionOptionsModel.SetLongDescription("testString") + updateVersionOptionsModel.SetLongDescriptionI18n(map[string]string{"key1": "testString"}) + updateVersionOptionsModel.SetFeatures([]catalogmanagementv1.Feature{*featureModel}) + updateVersionOptionsModel.SetKinds([]catalogmanagementv1.Kind{*kindModel}) + updateVersionOptionsModel.SetPublish(publishObjectModel) + updateVersionOptionsModel.SetPcManaged(true) + updateVersionOptionsModel.SetPublishApproved(true) + updateVersionOptionsModel.SetShareWithAll(true) + updateVersionOptionsModel.SetShareWithIBM(true) + updateVersionOptionsModel.SetShareEnabled(true) + updateVersionOptionsModel.SetPublicOriginalCRN("testString") + updateVersionOptionsModel.SetPublishPublicCRN("testString") + updateVersionOptionsModel.SetPortalApprovalRecord("testString") + updateVersionOptionsModel.SetPortalUIURL("testString") + updateVersionOptionsModel.SetCatalogID("testString") + updateVersionOptionsModel.SetCatalogName("testString") + updateVersionOptionsModel.SetMetadata(map[string]interface{}{"anyKey": "anyValue"}) + updateVersionOptionsModel.SetDisclaimer("testString") + updateVersionOptionsModel.SetHidden(true) + updateVersionOptionsModel.SetProvider("testString") + updateVersionOptionsModel.SetProviderInfo(providerInfoModel) + updateVersionOptionsModel.SetRepoInfo(repoInfoModel) + updateVersionOptionsModel.SetImagePullKeys([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel}) + updateVersionOptionsModel.SetSupport(supportModel) + updateVersionOptionsModel.SetMedia([]catalogmanagementv1.MediaItem{*mediaItemModel}) + updateVersionOptionsModel.SetDeprecatePending(deprecatePendingModel) + updateVersionOptionsModel.SetProductKind("testString") + updateVersionOptionsModel.SetBadges([]catalogmanagementv1.Badge{*badgeModel}) + updateVersionOptionsModel.SetPlans([]catalogmanagementv1.Plan{*planModel}) + updateVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(updateVersionOptionsModel).ToNot(BeNil()) + Expect(updateVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.ID).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.URL).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.CRN).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.Label).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.LabelI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(updateVersionOptionsModel.Name).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.OfferingIconURL).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.OfferingDocsURL).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.OfferingSupportURL).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.Tags).To(Equal([]string{"testString"})) + Expect(updateVersionOptionsModel.Keywords).To(Equal([]string{"testString"})) + Expect(updateVersionOptionsModel.Rating).To(Equal(ratingModel)) + Expect(updateVersionOptionsModel.Created).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(updateVersionOptionsModel.Updated).To(Equal(CreateMockDateTime("2019-01-01T12:00:00.000Z"))) + Expect(updateVersionOptionsModel.ShortDescription).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.ShortDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(updateVersionOptionsModel.LongDescription).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.LongDescriptionI18n).To(Equal(map[string]string{"key1": "testString"})) + Expect(updateVersionOptionsModel.Features).To(Equal([]catalogmanagementv1.Feature{*featureModel})) + Expect(updateVersionOptionsModel.Kinds).To(Equal([]catalogmanagementv1.Kind{*kindModel})) + Expect(updateVersionOptionsModel.Publish).To(Equal(publishObjectModel)) + Expect(updateVersionOptionsModel.PcManaged).To(Equal(core.BoolPtr(true))) + Expect(updateVersionOptionsModel.PublishApproved).To(Equal(core.BoolPtr(true))) + Expect(updateVersionOptionsModel.ShareWithAll).To(Equal(core.BoolPtr(true))) + Expect(updateVersionOptionsModel.ShareWithIBM).To(Equal(core.BoolPtr(true))) + Expect(updateVersionOptionsModel.ShareEnabled).To(Equal(core.BoolPtr(true))) + Expect(updateVersionOptionsModel.PublicOriginalCRN).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.PublishPublicCRN).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.PortalApprovalRecord).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.PortalUIURL).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.CatalogID).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.CatalogName).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.Metadata).To(Equal(map[string]interface{}{"anyKey": "anyValue"})) + Expect(updateVersionOptionsModel.Disclaimer).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.Hidden).To(Equal(core.BoolPtr(true))) + Expect(updateVersionOptionsModel.Provider).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.ProviderInfo).To(Equal(providerInfoModel)) + Expect(updateVersionOptionsModel.RepoInfo).To(Equal(repoInfoModel)) + Expect(updateVersionOptionsModel.ImagePullKeys).To(Equal([]catalogmanagementv1.ImagePullKey{*imagePullKeyModel})) + Expect(updateVersionOptionsModel.Support).To(Equal(supportModel)) + Expect(updateVersionOptionsModel.Media).To(Equal([]catalogmanagementv1.MediaItem{*mediaItemModel})) + Expect(updateVersionOptionsModel.DeprecatePending).To(Equal(deprecatePendingModel)) + Expect(updateVersionOptionsModel.ProductKind).To(Equal(core.StringPtr("testString"))) + Expect(updateVersionOptionsModel.Badges).To(Equal([]catalogmanagementv1.Badge{*badgeModel})) + Expect(updateVersionOptionsModel.Plans).To(Equal([]catalogmanagementv1.Plan{*planModel})) + Expect(updateVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + }) + It(`Invoke NewValidateInputsOptions successfully`, func() { + // Construct an instance of the ValidateInputsOptions model versionLocID := "testString" - suspendVersionOptionsModel := catalogManagementService.NewSuspendVersionOptions(versionLocID) - suspendVersionOptionsModel.SetVersionLocID("testString") - suspendVersionOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(suspendVersionOptionsModel).ToNot(BeNil()) - Expect(suspendVersionOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) - Expect(suspendVersionOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUpdateCatalogAccountOptions successfully`, func() { - // Construct an instance of the FilterTerms model - filterTermsModel := new(catalogmanagementv1.FilterTerms) - Expect(filterTermsModel).ToNot(BeNil()) - filterTermsModel.FilterTerms = []string{"testString"} - Expect(filterTermsModel.FilterTerms).To(Equal([]string{"testString"})) - - // Construct an instance of the CategoryFilter model - categoryFilterModel := new(catalogmanagementv1.CategoryFilter) - Expect(categoryFilterModel).ToNot(BeNil()) - categoryFilterModel.Include = core.BoolPtr(true) - categoryFilterModel.Filter = filterTermsModel - Expect(categoryFilterModel.Include).To(Equal(core.BoolPtr(true))) - Expect(categoryFilterModel.Filter).To(Equal(filterTermsModel)) - - // Construct an instance of the IDFilter model - idFilterModel := new(catalogmanagementv1.IDFilter) - Expect(idFilterModel).ToNot(BeNil()) - idFilterModel.Include = filterTermsModel - idFilterModel.Exclude = filterTermsModel - Expect(idFilterModel.Include).To(Equal(filterTermsModel)) - Expect(idFilterModel.Exclude).To(Equal(filterTermsModel)) - - // Construct an instance of the Filters model - filtersModel := new(catalogmanagementv1.Filters) - Expect(filtersModel).ToNot(BeNil()) - filtersModel.IncludeAll = core.BoolPtr(true) - filtersModel.CategoryFilters = map[string]catalogmanagementv1.CategoryFilter{"key1": *categoryFilterModel} - filtersModel.IDFilters = idFilterModel - filtersModel.CategoryFilters["foo"] = *categoryFilterModel - Expect(filtersModel.IncludeAll).To(Equal(core.BoolPtr(true))) - Expect(filtersModel.IDFilters).To(Equal(idFilterModel)) - Expect(filtersModel.CategoryFilters["foo"]).To(Equal(*categoryFilterModel)) - - // Construct an instance of the UpdateCatalogAccountOptions model - updateCatalogAccountOptionsModel := catalogManagementService.NewUpdateCatalogAccountOptions() - updateCatalogAccountOptionsModel.SetID("testString") - updateCatalogAccountOptionsModel.SetRev("testString") - updateCatalogAccountOptionsModel.SetHideIBMCloudCatalog(true) - updateCatalogAccountOptionsModel.SetAccountFilters(filtersModel) - updateCatalogAccountOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(updateCatalogAccountOptionsModel).ToNot(BeNil()) - Expect(updateCatalogAccountOptionsModel.ID).To(Equal(core.StringPtr("testString"))) - Expect(updateCatalogAccountOptionsModel.Rev).To(Equal(core.StringPtr("testString"))) - Expect(updateCatalogAccountOptionsModel.HideIBMCloudCatalog).To(Equal(core.BoolPtr(true))) - Expect(updateCatalogAccountOptionsModel.AccountFilters).To(Equal(filtersModel)) - Expect(updateCatalogAccountOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUpdateOfferingOptions successfully`, func() { - // Construct an instance of the JSONPatchOperation model - jsonPatchOperationModel := new(catalogmanagementv1.JSONPatchOperation) - Expect(jsonPatchOperationModel).ToNot(BeNil()) - jsonPatchOperationModel.Op = core.StringPtr("add") - jsonPatchOperationModel.Path = core.StringPtr("testString") - jsonPatchOperationModel.Value = "testString" - jsonPatchOperationModel.From = core.StringPtr("testString") - Expect(jsonPatchOperationModel.Op).To(Equal(core.StringPtr("add"))) - Expect(jsonPatchOperationModel.Path).To(Equal(core.StringPtr("testString"))) - Expect(jsonPatchOperationModel.Value).To(Equal("testString")) - Expect(jsonPatchOperationModel.From).To(Equal(core.StringPtr("testString"))) - - // Construct an instance of the UpdateOfferingOptions model - catalogIdentifier := "testString" - offeringID := "testString" - ifMatch := "testString" - updateOfferingOptionsModel := catalogManagementService.NewUpdateOfferingOptions(catalogIdentifier, offeringID, ifMatch) - updateOfferingOptionsModel.SetCatalogIdentifier("testString") - updateOfferingOptionsModel.SetOfferingID("testString") - updateOfferingOptionsModel.SetIfMatch("testString") - updateOfferingOptionsModel.SetUpdates([]catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel}) - updateOfferingOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(updateOfferingOptionsModel).ToNot(BeNil()) - Expect(updateOfferingOptionsModel.CatalogIdentifier).To(Equal(core.StringPtr("testString"))) - Expect(updateOfferingOptionsModel.OfferingID).To(Equal(core.StringPtr("testString"))) - Expect(updateOfferingOptionsModel.IfMatch).To(Equal(core.StringPtr("testString"))) - Expect(updateOfferingOptionsModel.Updates).To(Equal([]catalogmanagementv1.JSONPatchOperation{*jsonPatchOperationModel})) - Expect(updateOfferingOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) - }) - It(`Invoke NewUpdateShareApprovalListAsSourceOptions successfully`, func() { - // Construct an instance of the UpdateShareApprovalListAsSourceOptions model - objectType := "offering" - approvalStateIdentifier := "approved" - accesses := []string{"testString"} - updateShareApprovalListAsSourceOptionsModel := catalogManagementService.NewUpdateShareApprovalListAsSourceOptions(objectType, approvalStateIdentifier, accesses) - updateShareApprovalListAsSourceOptionsModel.SetObjectType("offering") - updateShareApprovalListAsSourceOptionsModel.SetApprovalStateIdentifier("approved") - updateShareApprovalListAsSourceOptionsModel.SetAccesses([]string{"testString"}) - updateShareApprovalListAsSourceOptionsModel.SetEnterpriseID("testString") - updateShareApprovalListAsSourceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) - Expect(updateShareApprovalListAsSourceOptionsModel).ToNot(BeNil()) - Expect(updateShareApprovalListAsSourceOptionsModel.ObjectType).To(Equal(core.StringPtr("offering"))) - Expect(updateShareApprovalListAsSourceOptionsModel.ApprovalStateIdentifier).To(Equal(core.StringPtr("approved"))) - Expect(updateShareApprovalListAsSourceOptionsModel.Accesses).To(Equal([]string{"testString"})) - Expect(updateShareApprovalListAsSourceOptionsModel.EnterpriseID).To(Equal(core.StringPtr("testString"))) - Expect(updateShareApprovalListAsSourceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) + validateInputsOptionsModel := catalogManagementService.NewValidateInputsOptions(versionLocID) + validateInputsOptionsModel.SetVersionLocID("testString") + validateInputsOptionsModel.SetInput1("testString") + validateInputsOptionsModel.SetInput2("testString") + validateInputsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) + Expect(validateInputsOptionsModel).ToNot(BeNil()) + Expect(validateInputsOptionsModel.VersionLocID).To(Equal(core.StringPtr("testString"))) + Expect(validateInputsOptionsModel.Input1).To(Equal(core.StringPtr("testString"))) + Expect(validateInputsOptionsModel.Input2).To(Equal(core.StringPtr("testString"))) + Expect(validateInputsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewValidateInstallOptions successfully`, func() { // Construct an instance of the DeployRequestBodyOverrideValues model @@ -33437,6 +39360,7 @@ var _ = Describe(`CatalogManagementV1`, func() { validateInstallOptionsModel.SetNamespaces([]string{"testString"}) validateInstallOptionsModel.SetAllNamespaces(true) validateInstallOptionsModel.SetOverrideValues(deployRequestBodyOverrideValuesModel) + validateInstallOptionsModel.SetDependencyConfigs([]string{"testString"}) validateInstallOptionsModel.SetEnvironmentVariables([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel}) validateInstallOptionsModel.SetEntitlementApikey("testString") validateInstallOptionsModel.SetSchematics(deployRequestBodySchematicsModel) @@ -33462,6 +39386,7 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(validateInstallOptionsModel.Namespaces).To(Equal([]string{"testString"})) Expect(validateInstallOptionsModel.AllNamespaces).To(Equal(core.BoolPtr(true))) Expect(validateInstallOptionsModel.OverrideValues).To(Equal(deployRequestBodyOverrideValuesModel)) + Expect(validateInstallOptionsModel.DependencyConfigs).To(Equal([]string{"testString"})) Expect(validateInstallOptionsModel.EnvironmentVariables).To(Equal([]catalogmanagementv1.DeployRequestBodyEnvironmentVariablesItem{*deployRequestBodyEnvironmentVariablesItemModel})) Expect(validateInstallOptionsModel.EntitlementApikey).To(Equal(core.StringPtr("testString"))) Expect(validateInstallOptionsModel.Schematics).To(Equal(deployRequestBodySchematicsModel)) @@ -33489,6 +39414,9 @@ var _ = Describe(`CatalogManagementV1`, func() { model.Rev = core.StringPtr("testString") model.HideIBMCloudCatalog = core.BoolPtr(true) model.AccountFilters = nil + model.RegionFilters = []string{"testString"} + model.FilteredRegions = []string{"testString"} + model.FilterRegions = core.BoolPtr(true) b, err := json.Marshal(model) Expect(err).To(BeNil()) @@ -34302,6 +40230,7 @@ var _ = Describe(`CatalogManagementV1`, func() { model.Created = CreateMockDateTime("2019-01-01T12:00:00.000Z") model.Updated = CreateMockDateTime("2019-01-01T12:00:00.000Z") model.Versions = nil + model.AllVersions = nil b, err := json.Marshal(model) Expect(err).To(BeNil()) @@ -34316,6 +40245,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(result).ToNot(BeNil()) Expect(result).To(Equal(model)) }) + It(`Invoke UnmarshalKindAllVersions successfully`, func() { + // Construct an instance of the model. + model := new(catalogmanagementv1.KindAllVersions) + model.First = nil + model.Next = nil + + b, err := json.Marshal(model) + Expect(err).To(BeNil()) + + var raw map[string]json.RawMessage + err = json.Unmarshal(b, &raw) + Expect(err).To(BeNil()) + + var result *catalogmanagementv1.KindAllVersions + err = catalogmanagementv1.UnmarshalKindAllVersions(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) It(`Invoke UnmarshalLearnMoreLinks successfully`, func() { // Construct an instance of the model. model := new(catalogmanagementv1.LearnMoreLinks) @@ -34557,6 +40505,25 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(result).ToNot(BeNil()) Expect(result).To(Equal(model)) }) + It(`Invoke UnmarshalPaginationTokenLink successfully`, func() { + // Construct an instance of the model. + model := new(catalogmanagementv1.PaginationTokenLink) + model.Href = core.StringPtr("testString") + model.Start = core.StringPtr("testString") + + b, err := json.Marshal(model) + Expect(err).To(BeNil()) + + var raw map[string]json.RawMessage + err = json.Unmarshal(b, &raw) + Expect(err).To(BeNil()) + + var result *catalogmanagementv1.PaginationTokenLink + err = catalogmanagementv1.UnmarshalPaginationTokenLink(raw, &result) + Expect(err).To(BeNil()) + Expect(result).ToNot(BeNil()) + Expect(result).To(Equal(model)) + }) It(`Invoke UnmarshalPlan successfully`, func() { // Construct an instance of the model. model := new(catalogmanagementv1.Plan) diff --git a/catalogmanagementv1/utils.go b/catalogmanagementv1/utils.go index 273bc1aa..b2f30a9d 100644 --- a/catalogmanagementv1/utils.go +++ b/catalogmanagementv1/utils.go @@ -3,6 +3,7 @@ package catalogmanagementv1 import ( "context" "encoding/json" + "fmt" "github.com/IBM/go-sdk-core/v5/core" common "github.com/IBM/platform-services-go-sdk/common" @@ -184,14 +185,14 @@ func (catalogManagement *CatalogManagementV1) SetAllowPublishPlanWithContext(ctx } // Set allow publish offering. -func (catalogManagement *CatalogManagementV1) SetAllowPublishOffering(catalogID string, offeringID string, headers map[string]string) (response *core.DetailedResponse, err error) { - response, err = catalogManagement.SetAllowPublishOfferingWithContext(context.Background(), catalogID, offeringID, headers) +func (catalogManagement *CatalogManagementV1) SetAllowPublishOffering(catalogID string, offeringID string, approvalType string, setting bool, headers map[string]string) (response *core.DetailedResponse, err error) { + response, err = catalogManagement.SetAllowPublishOfferingWithContext(context.Background(), catalogID, offeringID, approvalType, setting, headers) err = core.RepurposeSDKProblem(err, "") return } // SetAllowPublishOfferingWithContext is an alternate form of the setAllowPublishOffering method which supports a Context parameter -func (catalogManagement *CatalogManagementV1) SetAllowPublishOfferingWithContext(ctx context.Context, catalogID string, offeringID string, headers map[string]string) (response *core.DetailedResponse, err error) { +func (catalogManagement *CatalogManagementV1) SetAllowPublishOfferingWithContext(ctx context.Context, catalogID string, offeringID string, approvalType string, setting bool, headers map[string]string) (response *core.DetailedResponse, err error) { pathParamsMap := map[string]string{ "catalogID": catalogID, "offeringID": offeringID, @@ -200,7 +201,7 @@ func (catalogManagement *CatalogManagementV1) SetAllowPublishOfferingWithContext builder := core.NewRequestBuilder(core.POST) builder = builder.WithContext(ctx) builder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/catalogs/{catalogID}/offerings/{offeringID}/publish/publish_approved/true`, pathParamsMap) + _, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, fmt.Sprintf("/catalogs/{catalogID}/offerings/{offeringID}/publish/%s/%v", approvalType, setting), pathParamsMap) if err != nil { err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return