Skip to content

Commit

Permalink
fix(Partner Center Sell): re-gen SDK code after recent API changes (#361
Browse files Browse the repository at this point in the history
)


Signed-off-by: Peter Harasztia <peter.harasztia@ibm.com>
  • Loading branch information
HarasztiaPeter authored Oct 22, 2024
1 parent 5f5df93 commit 654e5ca
Show file tree
Hide file tree
Showing 6 changed files with 779 additions and 559 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
)
)
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
114 changes: 111 additions & 3 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.95.2-120e65bc-20240924-152329
* IBM OpenAPI SDK Code Generator Version: 3.96.0-d6dec9d7-20241008-212902
*/

// Package partnercentersellv1 : Operations and models for the PartnerCenterSellV1 service
Expand Down Expand Up @@ -833,6 +833,9 @@ func (partnerCenterSell *PartnerCenterSellV1) CreateCatalogProductWithContext(ct
if createCatalogProductOptions.ID != nil {
body["id"] = createCatalogProductOptions.ID
}
if createCatalogProductOptions.ObjectID != nil {
body["object_id"] = createCatalogProductOptions.ObjectID
}
if createCatalogProductOptions.OverviewUi != nil {
body["overview_ui"] = createCatalogProductOptions.OverviewUi
}
Expand Down Expand Up @@ -1164,6 +1167,9 @@ func (partnerCenterSell *PartnerCenterSellV1) CreateCatalogPlanWithContext(ctx c
if createCatalogPlanOptions.ID != nil {
body["id"] = createCatalogPlanOptions.ID
}
if createCatalogPlanOptions.ObjectID != nil {
body["object_id"] = createCatalogPlanOptions.ObjectID
}
if createCatalogPlanOptions.OverviewUi != nil {
body["overview_ui"] = createCatalogPlanOptions.OverviewUi
}
Expand Down Expand Up @@ -1497,6 +1503,9 @@ func (partnerCenterSell *PartnerCenterSellV1) CreateCatalogDeploymentWithContext
if createCatalogDeploymentOptions.ID != nil {
body["id"] = createCatalogDeploymentOptions.ID
}
if createCatalogDeploymentOptions.ObjectID != nil {
body["object_id"] = createCatalogDeploymentOptions.ObjectID
}
if createCatalogDeploymentOptions.OverviewUi != nil {
body["overview_ui"] = createCatalogDeploymentOptions.OverviewUi
}
Expand Down Expand Up @@ -3268,6 +3277,9 @@ type CreateCatalogDeploymentOptions struct {
// The ID of a global catalog object.
ID *string `json:"id,omitempty"`

// The desired ID of the global catalog object.
ObjectID *string `json:"object_id,omitempty"`

// The object that contains the service details from the Overview page in global catalog.
OverviewUi *GlobalCatalogOverviewUI `json:"overview_ui,omitempty"`

Expand Down Expand Up @@ -3362,6 +3374,12 @@ func (_options *CreateCatalogDeploymentOptions) SetID(id string) *CreateCatalogD
return _options
}

// SetObjectID : Allow user to set ObjectID
func (_options *CreateCatalogDeploymentOptions) SetObjectID(objectID string) *CreateCatalogDeploymentOptions {
_options.ObjectID = core.StringPtr(objectID)
return _options
}

// SetOverviewUi : Allow user to set OverviewUi
func (_options *CreateCatalogDeploymentOptions) SetOverviewUi(overviewUi *GlobalCatalogOverviewUI) *CreateCatalogDeploymentOptions {
_options.OverviewUi = overviewUi
Expand Down Expand Up @@ -3417,6 +3435,9 @@ type CreateCatalogPlanOptions struct {
// The ID of a global catalog object.
ID *string `json:"id,omitempty"`

// The desired ID of the global catalog object.
ObjectID *string `json:"object_id,omitempty"`

// The object that contains the service details from the Overview page in global catalog.
OverviewUi *GlobalCatalogOverviewUI `json:"overview_ui,omitempty"`

Expand Down Expand Up @@ -3504,6 +3525,12 @@ func (_options *CreateCatalogPlanOptions) SetID(id string) *CreateCatalogPlanOpt
return _options
}

// SetObjectID : Allow user to set ObjectID
func (_options *CreateCatalogPlanOptions) SetObjectID(objectID string) *CreateCatalogPlanOptions {
_options.ObjectID = core.StringPtr(objectID)
return _options
}

// SetOverviewUi : Allow user to set OverviewUi
func (_options *CreateCatalogPlanOptions) SetOverviewUi(overviewUi *GlobalCatalogOverviewUI) *CreateCatalogPlanOptions {
_options.OverviewUi = overviewUi
Expand Down Expand Up @@ -3556,6 +3583,9 @@ type CreateCatalogProductOptions struct {
// The ID of a global catalog object.
ID *string `json:"id,omitempty"`

// The desired ID of the global catalog object.
ObjectID *string `json:"object_id,omitempty"`

// The object that contains the service details from the Overview page in global catalog.
OverviewUi *GlobalCatalogOverviewUI `json:"overview_ui,omitempty"`

Expand Down Expand Up @@ -3641,6 +3671,12 @@ func (_options *CreateCatalogProductOptions) SetID(id string) *CreateCatalogProd
return _options
}

// SetObjectID : Allow user to set ObjectID
func (_options *CreateCatalogProductOptions) SetObjectID(objectID string) *CreateCatalogProductOptions {
_options.ObjectID = core.StringPtr(objectID)
return _options
}

// SetOverviewUi : Allow user to set OverviewUi
func (_options *CreateCatalogProductOptions) SetOverviewUi(overviewUi *GlobalCatalogOverviewUI) *CreateCatalogProductOptions {
_options.OverviewUi = overviewUi
Expand Down Expand Up @@ -4892,6 +4928,9 @@ type GlobalCatalogDeployment struct {
// The ID of a global catalog object.
ID *string `json:"id,omitempty"`

// The desired ID of the global catalog object.
ObjectID *string `json:"object_id,omitempty"`

// The programmatic name of this deployment.
Name *string `json:"name,omitempty"`

Expand Down Expand Up @@ -4936,6 +4975,11 @@ func UnmarshalGlobalCatalogDeployment(m map[string]json.RawMessage, result inter
err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "object_id", &obj.ObjectID)
if err != nil {
err = core.SDKErrorf(err, "", "object_id-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "name", &obj.Name)
if err != nil {
err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo())
Expand Down Expand Up @@ -5240,6 +5284,14 @@ type GlobalCatalogMetadataPricing struct {
Origin *string `json:"origin,omitempty"`
}

// Constants associated with the GlobalCatalogMetadataPricing.Type property.
// The type of the pricing plan.
const (
GlobalCatalogMetadataPricing_Type_Free = "free"
GlobalCatalogMetadataPricing_Type_Paid = "paid"
GlobalCatalogMetadataPricing_Type_Subscription = "subscription"
)

// Constants associated with the GlobalCatalogMetadataPricing.Origin property.
// The source of the pricing information: global_catalog or pricing_catalog.
const (
Expand Down Expand Up @@ -5675,6 +5727,9 @@ type GlobalCatalogPlan struct {
// The ID of a global catalog object.
ID *string `json:"id,omitempty"`

// The desired ID of the global catalog object.
ObjectID *string `json:"object_id,omitempty"`

// The programmatic name of this plan.
Name *string `json:"name,omitempty"`

Expand Down Expand Up @@ -5719,6 +5774,11 @@ func UnmarshalGlobalCatalogPlan(m map[string]json.RawMessage, result interface{}
err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "object_id", &obj.ObjectID)
if err != nil {
err = core.SDKErrorf(err, "", "object_id-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "name", &obj.Name)
if err != nil {
err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo())
Expand Down Expand Up @@ -5969,6 +6029,9 @@ type GlobalCatalogProduct struct {
// The ID of a global catalog object.
ID *string `json:"id,omitempty"`

// The desired ID of the global catalog object.
ObjectID *string `json:"object_id,omitempty"`

// The programmatic name of this product.
Name *string `json:"name,omitempty"`

Expand Down Expand Up @@ -6018,6 +6081,11 @@ func UnmarshalGlobalCatalogProduct(m map[string]json.RawMessage, result interfac
err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "object_id", &obj.ObjectID)
if err != nil {
err = core.SDKErrorf(err, "", "object_id-error", common.GetComponentInfo())
return
}
err = core.UnmarshalPrimitive(m, "name", &obj.Name)
if err != nil {
err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo())
Expand Down Expand Up @@ -7319,15 +7387,32 @@ func (iamServiceRegistrationSupportedAnonymousAccess *IamServiceRegistrationSupp
// This type supports additional properties of type *string.
type IamServiceRegistrationSupportedAnonymousAccessAttributes struct {
// An account id.
AccountID *string `json:"account_id,omitempty"`
AccountID *string `json:"account_id" validate:"required"`

// The name of the service.
ServiceName *string `json:"service_name,omitempty"`
ServiceName *string `json:"service_name" validate:"required"`

// Additional properties the key must come from supported attributes.
AdditionalProperties map[string]string `json:"additional_properties" validate:"required"`

// Allows users to set arbitrary properties of type *string.
additionalProperties map[string]*string
}

// NewIamServiceRegistrationSupportedAnonymousAccessAttributes : Instantiate IamServiceRegistrationSupportedAnonymousAccessAttributes (Generic Model Constructor)
func (*PartnerCenterSellV1) NewIamServiceRegistrationSupportedAnonymousAccessAttributes(accountID string, serviceName string, additionalProperties map[string]string) (_model *IamServiceRegistrationSupportedAnonymousAccessAttributes, err error) {
_model = &IamServiceRegistrationSupportedAnonymousAccessAttributes{
AccountID: core.StringPtr(accountID),
ServiceName: core.StringPtr(serviceName),
AdditionalProperties: additionalProperties,
}
err = core.ValidateStruct(_model, "required parameters")
if err != nil {
err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo())
}
return
}

// SetProperty allows the user to set an arbitrary property on an instance of IamServiceRegistrationSupportedAnonymousAccessAttributes.
func (o *IamServiceRegistrationSupportedAnonymousAccessAttributes) SetProperty(key string, value *string) {
if o.additionalProperties == nil {
Expand Down Expand Up @@ -7368,6 +7453,9 @@ func (o *IamServiceRegistrationSupportedAnonymousAccessAttributes) MarshalJSON()
if o.ServiceName != nil {
m["service_name"] = o.ServiceName
}
if o.AdditionalProperties != nil {
m["additional_properties"] = o.AdditionalProperties
}
buffer, err = json.Marshal(m)
if err != nil {
err = core.SDKErrorf(err, "", "model-marshal", common.GetComponentInfo())
Expand All @@ -7390,6 +7478,12 @@ func UnmarshalIamServiceRegistrationSupportedAnonymousAccessAttributes(m map[str
return
}
delete(m, "service_name")
err = core.UnmarshalPrimitive(m, "additional_properties", &obj.AdditionalProperties)
if err != nil {
err = core.SDKErrorf(err, "", "additional_properties-error", common.GetComponentInfo())
return
}
delete(m, "additional_properties")
for k := range m {
var v *string
e := core.UnmarshalPrimitive(m, k, &v)
Expand Down Expand Up @@ -7417,6 +7511,9 @@ func (iamServiceRegistrationSupportedAnonymousAccessAttributes *IamServiceRegist
if !core.IsNil(iamServiceRegistrationSupportedAnonymousAccessAttributes.ServiceName) {
_patch["service_name"] = iamServiceRegistrationSupportedAnonymousAccessAttributes.ServiceName
}
if !core.IsNil(iamServiceRegistrationSupportedAnonymousAccessAttributes.AdditionalProperties) {
_patch["additional_properties"] = iamServiceRegistrationSupportedAnonymousAccessAttributes.AdditionalProperties
}

return
}
Expand Down Expand Up @@ -9096,6 +9193,9 @@ 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 @@ -9137,6 +9237,11 @@ 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 @@ -9157,6 +9262,9 @@ 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
2 changes: 2 additions & 0 deletions partnercentersellv1/partner_center_sell_v1_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
. "github.com/onsi/gomega"
)

//
// This file provides an example of how to use the Partner Center Sell service.
//
// The following configuration properties are assumed to be defined:
Expand All @@ -40,6 +41,7 @@ import (
// PARTNER_CENTER_SELL_AUTH_URL=<IAM token service base URL - omit this if using the production environment>
// PRODUCT_ID_APPROVED=<product id>
// PARTNER_CENTER_SELL_BADGE_ID=<badge id>
// PARTNER_CENTER_SELL_IAM_REGISTRATION_ID=<iam registration id>

// PARTNER_CENTER_SELL_ALT_AUTH_TYPE=iam
// PARTNER_CENTER_SELL_ALT_APIKEY=<IAM apikey>
Expand Down
Loading

0 comments on commit 654e5ca

Please sign in to comment.