Skip to content

Commit

Permalink
fix(Partner Center Sell): bug fix (#362)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Harasztia <[email protected]>
  • Loading branch information
HarasztiaPeter authored Nov 20, 2024
1 parent f2f960f commit edc97bd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 63 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
23 changes: 6 additions & 17 deletions partnercentersellv1/partner_center_sell_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.96.0-d6dec9d7-20241008-212902
* IBM OpenAPI SDK Code Generator Version: 3.96.1-5136e54a-20241108-203028
*/

// Package partnercentersellv1 : Operations and models for the PartnerCenterSellV1 service
Expand Down Expand Up @@ -8971,7 +8971,7 @@ type SupportedAttributesOptions struct {
Hidden *bool `json:"hidden,omitempty"`

// The list of supported patterns.
SupportedAttributes []string `json:"supported_attributes,omitempty"`
SupportedPatterns []string `json:"supported_patterns,omitempty"`

// The list of policy types.
PolicyTypes []string `json:"policy_types,omitempty"`
Expand Down Expand Up @@ -9017,9 +9017,9 @@ func UnmarshalSupportedAttributesOptions(m map[string]json.RawMessage, result in
err = core.SDKErrorf(err, "", "hidden-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "supported_attributes", &obj.SupportedAttributes)
err = core.UnmarshalPrimitive(m, "supported_patterns", &obj.SupportedPatterns)
if err != nil {
err = core.SDKErrorf(err, "", "supported_attributes-error", common.GetComponentInfo())
err = core.SDKErrorf(err, "", "supported_patterns-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "policy_types", &obj.PolicyTypes)
Expand Down Expand Up @@ -9060,8 +9060,8 @@ func (supportedAttributesOptions *SupportedAttributesOptions) asPatch() (_patch
if !core.IsNil(supportedAttributesOptions.Hidden) {
_patch["hidden"] = supportedAttributesOptions.Hidden
}
if !core.IsNil(supportedAttributesOptions.SupportedAttributes) {
_patch["supported_attributes"] = supportedAttributesOptions.SupportedAttributes
if !core.IsNil(supportedAttributesOptions.SupportedPatterns) {
_patch["supported_patterns"] = supportedAttributesOptions.SupportedPatterns
}
if !core.IsNil(supportedAttributesOptions.PolicyTypes) {
_patch["policy_types"] = supportedAttributesOptions.PolicyTypes
Expand Down Expand Up @@ -9193,9 +9193,6 @@ type SupportedRoleOptions struct {
// Optional opt-in to require access control on the role.
AccessPolicy *bool `json:"access_policy" validate:"required"`

// Additional properties for access policy.
AdditionalPropertiesForAccessPolicy map[string]string `json:"additional_properties_for_access_policy,omitempty"`

// Optional opt-in to require checking policy type when applying the role.
PolicyType []string `json:"policy_type,omitempty"`

Expand Down Expand Up @@ -9237,11 +9234,6 @@ func UnmarshalSupportedRoleOptions(m map[string]json.RawMessage, result interfac
err = core.SDKErrorf(err, "", "access_policy-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "additional_properties_for_access_policy", &obj.AdditionalPropertiesForAccessPolicy)
if err != nil {
err = core.SDKErrorf(err, "", "additional_properties_for_access_policy-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "policy_type", &obj.PolicyType)
if err != nil {
err = core.SDKErrorf(err, "", "policy_type-error", common.GetComponentInfo())
Expand All @@ -9262,9 +9254,6 @@ func (supportedRoleOptions *SupportedRoleOptions) asPatch() (_patch map[string]i
if !core.IsNil(supportedRoleOptions.AccessPolicy) {
_patch["access_policy"] = supportedRoleOptions.AccessPolicy
}
if !core.IsNil(supportedRoleOptions.AdditionalPropertiesForAccessPolicy) {
_patch["additional_properties_for_access_policy"] = supportedRoleOptions.AdditionalPropertiesForAccessPolicy
}
if !core.IsNil(supportedRoleOptions.PolicyType) {
_patch["policy_type"] = supportedRoleOptions.PolicyType
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,11 @@ var _ = Describe(`PartnerCenterSellV1 Integration Tests`, func() {

var randomInteger = strconv.Itoa(rand.Intn(1000))
objectId := fmt.Sprintf("random-id-%s", randomInteger)
randomName := fmt.Sprintf("random-name-%s", randomInteger)

createCatalogProductOptions := &partnercentersellv1.CreateCatalogProductOptions{
ProductID: core.StringPtr(productIdWithApprovedProgrammaticName),
Name: core.StringPtr(iamServiceRegistrationId),
Name: core.StringPtr(randomName),
Active: core.BoolPtr(true),
Disabled: core.BoolPtr(false),
Kind: core.StringPtr("service"),
Expand Down Expand Up @@ -934,7 +935,7 @@ var _ = Describe(`PartnerCenterSellV1 Integration Tests`, func() {
ObjectID: core.StringPtr(objectId),
OverviewUi: globalCatalogOverviewUiModel,
Metadata: globalCatalogDeploymentMetadataModel,
Env: core.StringPtr("testString"),
Env: core.StringPtr(env),
}

globalCatalogDeployment, response, err := partnerCenterSellService.CreateCatalogDeployment(createCatalogDeploymentOptions)
Expand Down Expand Up @@ -1464,7 +1465,7 @@ var _ = Describe(`PartnerCenterSellV1 Integration Tests`, func() {
RegistrationID: &registrationIdLink,
}

registration, response, err := partnerCenterSellService.GetRegistration(getRegistrationOptions)
registration, response, err := partnerCenterSellServiceAlt.GetRegistration(getRegistrationOptions)
Expect(err).To(BeNil())
Expect(response.StatusCode).To(Equal(200))
Expect(registration).ToNot(BeNil())
Expand Down Expand Up @@ -1681,7 +1682,7 @@ var _ = Describe(`PartnerCenterSellV1 Integration Tests`, func() {
})
It(`GetProductBadge(getProductBadgeOptions *GetProductBadgeOptions)`, func() {
getProductBadgeOptions := &partnercentersellv1.GetProductBadgeOptions{
BadgeID: CreateMockUUID("9fab83da-98cb-4f18-a7ba-b6f0435c9673"),
BadgeID: CreateMockUUID(badgeId),
}

productBadge, response, err := partnerCenterSellService.GetProductBadge(getProductBadgeOptions)
Expand Down
Loading

0 comments on commit edc97bd

Please sign in to comment.