From 86b1b17d8bcea307ffa60a8dc2dae623a4433a37 Mon Sep 17 00:00:00 2001 From: Jon Woodlief Date: Tue, 8 Jun 2021 11:05:31 -0400 Subject: [PATCH] fix(Catalog Management): add metadata and lastoperation to offering instance --- catalogmanagementv1/catalog_management_v1.go | 107 +++++++++++ .../catalog_management_v1_integration_test.go | 2 + .../catalog_management_v1_test.go | 176 +++++++++++++++++- 3 files changed, 279 insertions(+), 6 deletions(-) diff --git a/catalogmanagementv1/catalog_management_v1.go b/catalogmanagementv1/catalog_management_v1.go index 040db49b..9eb9def0 100644 --- a/catalogmanagementv1/catalog_management_v1.go +++ b/catalogmanagementv1/catalog_management_v1.go @@ -4683,6 +4683,12 @@ func (catalogManagement *CatalogManagementV1) CreateOfferingInstanceWithContext( if createOfferingInstanceOptions.Channel != nil { body["channel"] = createOfferingInstanceOptions.Channel } + if createOfferingInstanceOptions.Metadata != nil { + body["metadata"] = createOfferingInstanceOptions.Metadata + } + if createOfferingInstanceOptions.LastOperation != nil { + body["last_operation"] = createOfferingInstanceOptions.LastOperation + } _, err = builder.SetBodyContentJSON(body) if err != nil { return @@ -4864,6 +4870,12 @@ func (catalogManagement *CatalogManagementV1) PutOfferingInstanceWithContext(ctx if putOfferingInstanceOptions.Channel != nil { body["channel"] = putOfferingInstanceOptions.Channel } + if putOfferingInstanceOptions.Metadata != nil { + body["metadata"] = putOfferingInstanceOptions.Metadata + } + if putOfferingInstanceOptions.LastOperation != nil { + body["last_operation"] = putOfferingInstanceOptions.LastOperation + } _, err = builder.SetBodyContentJSON(body) if err != nil { return @@ -6250,6 +6262,12 @@ type CreateOfferingInstanceOptions struct { // Channel to pin the operator subscription to. Channel *string + // Map of metadata values for this offering instance. + Metadata map[string]interface{} + + // the last operation performed and status. + LastOperation *OfferingInstanceLastOperation + // Allows users to set headers on API requests Headers map[string]string } @@ -6369,6 +6387,18 @@ func (options *CreateOfferingInstanceOptions) SetChannel(channel string) *Create return options } +// SetMetadata : Allow user to set Metadata +func (options *CreateOfferingInstanceOptions) SetMetadata(metadata map[string]interface{}) *CreateOfferingInstanceOptions { + options.Metadata = metadata + return options +} + +// SetLastOperation : Allow user to set LastOperation +func (options *CreateOfferingInstanceOptions) SetLastOperation(lastOperation *OfferingInstanceLastOperation) *CreateOfferingInstanceOptions { + options.LastOperation = lastOperation + return options +} + // SetHeaders : Allow user to set Headers func (options *CreateOfferingInstanceOptions) SetHeaders(param map[string]string) *CreateOfferingInstanceOptions { options.Headers = param @@ -9919,6 +9949,12 @@ type OfferingInstance struct { // Channel to pin the operator subscription to. Channel *string `json:"channel,omitempty"` + + // Map of metadata values for this offering instance. + Metadata map[string]interface{} `json:"metadata,omitempty"` + + // the last operation performed and status. + LastOperation *OfferingInstanceLastOperation `json:"last_operation,omitempty"` } // UnmarshalOfferingInstance unmarshals an instance of OfferingInstance from the specified map of raw messages. @@ -9992,6 +10028,59 @@ func UnmarshalOfferingInstance(m map[string]json.RawMessage, result interface{}) if err != nil { return } + err = core.UnmarshalPrimitive(m, "metadata", &obj.Metadata) + if err != nil { + return + } + err = core.UnmarshalModel(m, "last_operation", &obj.LastOperation, UnmarshalOfferingInstanceLastOperation) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// OfferingInstanceLastOperation : the last operation performed and status. +type OfferingInstanceLastOperation struct { + // last operation performed. + Operation *string `json:"operation,omitempty"` + + // state after the last operation performed. + State *string `json:"state,omitempty"` + + // additional information about the last operation. + Message *string `json:"message,omitempty"` + + // transaction id from the last operation. + TransactionID *string `json:"transaction_id,omitempty"` + + // Date and time last updated. + Updated *string `json:"updated,omitempty"` +} + +// UnmarshalOfferingInstanceLastOperation unmarshals an instance of OfferingInstanceLastOperation from the specified map of raw messages. +func UnmarshalOfferingInstanceLastOperation(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(OfferingInstanceLastOperation) + err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "transaction_id", &obj.TransactionID) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "updated", &obj.Updated) + if err != nil { + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -10558,6 +10647,12 @@ type PutOfferingInstanceOptions struct { // Channel to pin the operator subscription to. Channel *string + // Map of metadata values for this offering instance. + Metadata map[string]interface{} + + // the last operation performed and status. + LastOperation *OfferingInstanceLastOperation + // Allows users to set headers on API requests Headers map[string]string } @@ -10684,6 +10779,18 @@ func (options *PutOfferingInstanceOptions) SetChannel(channel string) *PutOfferi return options } +// SetMetadata : Allow user to set Metadata +func (options *PutOfferingInstanceOptions) SetMetadata(metadata map[string]interface{}) *PutOfferingInstanceOptions { + options.Metadata = metadata + return options +} + +// SetLastOperation : Allow user to set LastOperation +func (options *PutOfferingInstanceOptions) SetLastOperation(lastOperation *OfferingInstanceLastOperation) *PutOfferingInstanceOptions { + options.LastOperation = lastOperation + return options +} + // SetHeaders : Allow user to set Headers func (options *PutOfferingInstanceOptions) SetHeaders(param map[string]string) *PutOfferingInstanceOptions { options.Headers = param diff --git a/catalogmanagementv1/catalog_management_v1_integration_test.go b/catalogmanagementv1/catalog_management_v1_integration_test.go index d8d9bc0b..757dd98e 100644 --- a/catalogmanagementv1/catalog_management_v1_integration_test.go +++ b/catalogmanagementv1/catalog_management_v1_integration_test.go @@ -2098,6 +2098,7 @@ var _ = Describe(`CatalogManagementV1 Integration Tests (New)`, func() { Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(202)) Expect(offeringInstance).ToNot(BeNil()) + Expect(*offeringInstance.LastOperation.State).To(Equal("in progress")) fmt.Fprintf(GinkgoWriter, "CreateOfferingInstance() result:\n%s\n", common.ToJSON(offeringInstance)) Expect(offeringInstance.ID).ToNot(BeNil()) @@ -2119,6 +2120,7 @@ var _ = Describe(`CatalogManagementV1 Integration Tests (New)`, func() { offeringInstance, response, err := catalogManagementService.GetOfferingInstance(getOfferingInstanceOptions) + Expect(offeringInstance.Metadata).ToNot(BeNil()) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) Expect(offeringInstance).ToNot(BeNil()) diff --git a/catalogmanagementv1/catalog_management_v1_test.go b/catalogmanagementv1/catalog_management_v1_test.go index abcba3bc..06898a3b 100644 --- a/catalogmanagementv1/catalog_management_v1_test.go +++ b/catalogmanagementv1/catalog_management_v1_test.go @@ -14743,6 +14743,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 = core.StringPtr("testString") + // Construct an instance of the CreateOfferingInstanceOptions model createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") @@ -14761,6 +14769,10 @@ var _ = Describe(`CatalogManagementV1`, func() { createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel 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) @@ -14815,7 +14827,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", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID", "install_plan": "InstallPlan", "channel": "Channel", "metadata": {"mapKey": "anyValue"}, "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "Updated"}}`) })) }) It(`Invoke CreateOfferingInstance successfully with retries`, func() { @@ -14827,6 +14839,14 @@ 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 = core.StringPtr("testString") + // Construct an instance of the CreateOfferingInstanceOptions model createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") @@ -14845,6 +14865,10 @@ var _ = Describe(`CatalogManagementV1`, func() { createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -14902,7 +14926,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", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID", "install_plan": "InstallPlan", "channel": "Channel", "metadata": {"mapKey": "anyValue"}, "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "Updated"}}`) })) }) It(`Invoke CreateOfferingInstance successfully`, func() { @@ -14919,6 +14943,14 @@ var _ = Describe(`CatalogManagementV1`, func() { 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 = core.StringPtr("testString") + // Construct an instance of the CreateOfferingInstanceOptions model createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") @@ -14937,6 +14969,10 @@ var _ = Describe(`CatalogManagementV1`, func() { createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -14954,6 +14990,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 = core.StringPtr("testString") + // Construct an instance of the CreateOfferingInstanceOptions model createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") @@ -14972,6 +15016,10 @@ var _ = Describe(`CatalogManagementV1`, func() { createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") @@ -15010,6 +15058,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 = core.StringPtr("testString") + // Construct an instance of the CreateOfferingInstanceOptions model createOfferingInstanceOptionsModel := new(catalogmanagementv1.CreateOfferingInstanceOptions) createOfferingInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString") @@ -15028,6 +15084,10 @@ var _ = Describe(`CatalogManagementV1`, func() { createOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) createOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") createOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + createOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + createOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + createOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel createOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -15105,7 +15165,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", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID", "install_plan": "InstallPlan", "channel": "Channel", "metadata": {"mapKey": "anyValue"}, "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "Updated"}}`) })) }) It(`Invoke GetOfferingInstance successfully with retries`, func() { @@ -15159,7 +15219,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", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID", "install_plan": "InstallPlan", "channel": "Channel", "metadata": {"mapKey": "anyValue"}, "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "Updated"}}`) })) }) It(`Invoke GetOfferingInstance successfully`, func() { @@ -15280,6 +15340,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 = core.StringPtr("testString") + // Construct an instance of the PutOfferingInstanceOptions model putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") @@ -15299,6 +15367,10 @@ var _ = Describe(`CatalogManagementV1`, func() { putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel 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) @@ -15353,7 +15425,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", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID", "install_plan": "InstallPlan", "channel": "Channel", "metadata": {"mapKey": "anyValue"}, "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "Updated"}}`) })) }) It(`Invoke PutOfferingInstance successfully with retries`, func() { @@ -15365,6 +15437,14 @@ 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 = core.StringPtr("testString") + // Construct an instance of the PutOfferingInstanceOptions model putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") @@ -15384,6 +15464,10 @@ var _ = Describe(`CatalogManagementV1`, func() { putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -15441,7 +15525,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", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID"}`) + fmt.Fprintf(res, "%s", `{"id": "ID", "_rev": "Rev", "url": "URL", "crn": "CRN", "label": "Label", "catalog_id": "CatalogID", "offering_id": "OfferingID", "kind_format": "KindFormat", "version": "Version", "cluster_id": "ClusterID", "cluster_region": "ClusterRegion", "cluster_namespaces": ["ClusterNamespaces"], "cluster_all_namespaces": true, "schematics_workspace_id": "SchematicsWorkspaceID", "resource_group_id": "ResourceGroupID", "install_plan": "InstallPlan", "channel": "Channel", "metadata": {"mapKey": "anyValue"}, "last_operation": {"operation": "Operation", "state": "State", "message": "Message", "transaction_id": "TransactionID", "updated": "Updated"}}`) })) }) It(`Invoke PutOfferingInstance successfully`, func() { @@ -15458,6 +15542,14 @@ var _ = Describe(`CatalogManagementV1`, func() { 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 = core.StringPtr("testString") + // Construct an instance of the PutOfferingInstanceOptions model putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") @@ -15477,6 +15569,10 @@ var _ = Describe(`CatalogManagementV1`, func() { putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -15494,6 +15590,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 = core.StringPtr("testString") + // Construct an instance of the PutOfferingInstanceOptions model putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") @@ -15513,6 +15617,10 @@ var _ = Describe(`CatalogManagementV1`, func() { putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := catalogManagementService.SetServiceURL("") @@ -15551,6 +15659,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 = core.StringPtr("testString") + // Construct an instance of the PutOfferingInstanceOptions model putOfferingInstanceOptionsModel := new(catalogmanagementv1.PutOfferingInstanceOptions) putOfferingInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString") @@ -15570,6 +15686,10 @@ var _ = Describe(`CatalogManagementV1`, func() { putOfferingInstanceOptionsModel.ClusterAllNamespaces = core.BoolPtr(true) putOfferingInstanceOptionsModel.SchematicsWorkspaceID = core.StringPtr("testString") putOfferingInstanceOptionsModel.ResourceGroupID = core.StringPtr("testString") + putOfferingInstanceOptionsModel.InstallPlan = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Channel = core.StringPtr("testString") + putOfferingInstanceOptionsModel.Metadata = make(map[string]interface{}) + putOfferingInstanceOptionsModel.LastOperation = offeringInstanceLastOperationModel putOfferingInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -15943,6 +16063,20 @@ var _ = Describe(`CatalogManagementV1`, func() { 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 = 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(core.StringPtr("testString"))) + // Construct an instance of the CreateOfferingInstanceOptions model xAuthRefreshToken := "testString" createOfferingInstanceOptionsModel := catalogManagementService.NewCreateOfferingInstanceOptions(xAuthRefreshToken) @@ -15962,6 +16096,10 @@ var _ = Describe(`CatalogManagementV1`, func() { createOfferingInstanceOptionsModel.SetClusterAllNamespaces(true) createOfferingInstanceOptionsModel.SetSchematicsWorkspaceID("testString") createOfferingInstanceOptionsModel.SetResourceGroupID("testString") + createOfferingInstanceOptionsModel.SetInstallPlan("testString") + createOfferingInstanceOptionsModel.SetChannel("testString") + createOfferingInstanceOptionsModel.SetMetadata(make(map[string]interface{})) + createOfferingInstanceOptionsModel.SetLastOperation(offeringInstanceLastOperationModel) createOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createOfferingInstanceOptionsModel).ToNot(BeNil()) Expect(createOfferingInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString"))) @@ -15980,6 +16118,10 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(createOfferingInstanceOptionsModel.ClusterAllNamespaces).To(Equal(core.BoolPtr(true))) Expect(createOfferingInstanceOptionsModel.SchematicsWorkspaceID).To(Equal(core.StringPtr("testString"))) Expect(createOfferingInstanceOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(createOfferingInstanceOptionsModel.Metadata).To(Equal(make(map[string]interface{}))) + Expect(createOfferingInstanceOptionsModel.LastOperation).To(Equal(offeringInstanceLastOperationModel)) Expect(createOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewCreateOfferingOptions successfully`, func() { @@ -17052,6 +17194,20 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(publicPublishVersionOptionsModel.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 = 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(core.StringPtr("testString"))) + // Construct an instance of the PutOfferingInstanceOptions model instanceIdentifier := "testString" xAuthRefreshToken := "testString" @@ -17073,6 +17229,10 @@ var _ = Describe(`CatalogManagementV1`, func() { putOfferingInstanceOptionsModel.SetClusterAllNamespaces(true) putOfferingInstanceOptionsModel.SetSchematicsWorkspaceID("testString") putOfferingInstanceOptionsModel.SetResourceGroupID("testString") + putOfferingInstanceOptionsModel.SetInstallPlan("testString") + putOfferingInstanceOptionsModel.SetChannel("testString") + putOfferingInstanceOptionsModel.SetMetadata(make(map[string]interface{})) + putOfferingInstanceOptionsModel.SetLastOperation(offeringInstanceLastOperationModel) putOfferingInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(putOfferingInstanceOptionsModel).ToNot(BeNil()) Expect(putOfferingInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString"))) @@ -17092,6 +17252,10 @@ var _ = Describe(`CatalogManagementV1`, func() { Expect(putOfferingInstanceOptionsModel.ClusterAllNamespaces).To(Equal(core.BoolPtr(true))) Expect(putOfferingInstanceOptionsModel.SchematicsWorkspaceID).To(Equal(core.StringPtr("testString"))) Expect(putOfferingInstanceOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.InstallPlan).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Channel).To(Equal(core.StringPtr("testString"))) + Expect(putOfferingInstanceOptionsModel.Metadata).To(Equal(make(map[string]interface{}))) + Expect(putOfferingInstanceOptionsModel.LastOperation).To(Equal(offeringInstanceLastOperationModel)) Expect(putOfferingInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewReloadOfferingOptions successfully`, func() {