Skip to content

Commit

Permalink
fix(enterprise manager): update enterprise management after recent ap…
Browse files Browse the repository at this point in the history
…i changes (#107)


Co-authored-by: Phil Adams <[email protected]>
Co-authored-by: Norbert Biczo <[email protected]>
Co-authored-by: András Csányi <[email protected]>
  • Loading branch information
4 people authored Apr 7, 2021
1 parent 6280185 commit 3a11a67
Show file tree
Hide file tree
Showing 4 changed files with 944 additions and 987 deletions.
126 changes: 82 additions & 44 deletions enterprisemanagementv1/enterprise_management_v1.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-629bbb97-20201207-171303
* IBM OpenAPI SDK Code Generator Version: 3.29.1-b338fb38-20210313-010605
*/

// Package enterprisemanagementv1 : Operations and models for the EnterpriseManagementV1 service
Expand All @@ -25,13 +25,12 @@ import (
"context"
"encoding/json"
"fmt"
"net/http"
"reflect"
"time"

"github.com/IBM/go-sdk-core/v5/core"
common "github.com/IBM/platform-services-go-sdk/common"
"github.com/go-openapi/strfmt"
"net/http"
"reflect"
"time"
)

// EnterpriseManagementV1 : The Enterprise Management API enables you to create and manage an enterprise, account
Expand Down Expand Up @@ -279,6 +278,9 @@ func (enterpriseManagement *EnterpriseManagementV1) ListAccountGroupsWithContext
if listAccountGroupsOptions.ParentAccountGroupID != nil {
builder.AddQuery("parent_account_group_id", fmt.Sprint(*listAccountGroupsOptions.ParentAccountGroupID))
}
if listAccountGroupsOptions.NextDocid != nil {
builder.AddQuery("next_docid", fmt.Sprint(*listAccountGroupsOptions.NextDocid))
}
if listAccountGroupsOptions.Parent != nil {
builder.AddQuery("parent", fmt.Sprint(*listAccountGroupsOptions.Parent))
}
Expand Down Expand Up @@ -612,6 +614,9 @@ func (enterpriseManagement *EnterpriseManagementV1) ListAccountsWithContext(ctx
if listAccountsOptions.AccountGroupID != nil {
builder.AddQuery("account_group_id", fmt.Sprint(*listAccountsOptions.AccountGroupID))
}
if listAccountsOptions.NextDocid != nil {
builder.AddQuery("next_docid", fmt.Sprint(*listAccountsOptions.NextDocid))
}
if listAccountsOptions.Parent != nil {
builder.AddQuery("parent", fmt.Sprint(*listAccountsOptions.Parent))
}
Expand Down Expand Up @@ -880,6 +885,9 @@ func (enterpriseManagement *EnterpriseManagementV1) ListEnterprisesWithContext(c
if listEnterprisesOptions.AccountID != nil {
builder.AddQuery("account_id", fmt.Sprint(*listEnterprisesOptions.AccountID))
}
if listEnterprisesOptions.NextDocid != nil {
builder.AddQuery("next_docid", fmt.Sprint(*listEnterprisesOptions.NextDocid))
}
if listEnterprisesOptions.Limit != nil {
builder.AddQuery("limit", fmt.Sprint(*listEnterprisesOptions.Limit))
}
Expand Down Expand Up @@ -1275,13 +1283,13 @@ func UnmarshalAccountGroup(m map[string]json.RawMessage, result interface{}) (er
type CreateAccountGroupOptions struct {
// The CRN of the parent under which the account group will be created. The parent can be an existing account group or
// the enterprise itself.
Parent *string `json:"parent" validate:"required"`
Parent *string `validate:"required"`

// The name of the account group. This field must have 3 - 60 characters.
Name *string `json:"name" validate:"required"`
Name *string `validate:"required"`

// The IAM ID of the primary contact for this account group, such as `IBMid-0123ABC`. The IAM ID must already exist.
PrimaryContactIamID *string `json:"primary_contact_iam_id" validate:"required"`
PrimaryContactIamID *string `validate:"required"`

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1341,13 +1349,13 @@ func UnmarshalCreateAccountGroupResponse(m map[string]json.RawMessage, result in
type CreateAccountOptions struct {
// The CRN of the parent under which the account will be created. The parent can be an existing account group or the
// enterprise itself.
Parent *string `json:"parent" validate:"required"`
Parent *string `validate:"required"`

// The name of the account. This field must have 3 - 60 characters.
Name *string `json:"name" validate:"required"`
Name *string `validate:"required"`

// The IAM ID of the account owner, such as `IBMid-0123ABC`. The IAM ID must already exist.
OwnerIamID *string `json:"owner_iam_id" validate:"required"`
OwnerIamID *string `validate:"required"`

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1406,16 +1414,16 @@ func UnmarshalCreateAccountResponse(m map[string]json.RawMessage, result interfa
// CreateEnterpriseOptions : The CreateEnterprise options.
type CreateEnterpriseOptions struct {
// The ID of the account that is used to create the enterprise.
SourceAccountID *string `json:"source_account_id" validate:"required"`
SourceAccountID *string `validate:"required"`

// The name of the enterprise. This field must have 3 - 60 characters.
Name *string `json:"name" validate:"required"`
Name *string `validate:"required"`

// The IAM ID of the enterprise primary contact, such as `IBMid-0123ABC`. The IAM ID must already exist.
PrimaryContactIamID *string `json:"primary_contact_iam_id" validate:"required"`
PrimaryContactIamID *string `validate:"required"`

// A domain or subdomain for the enterprise, such as `example.com` or `my.example.com`.
Domain *string `json:"domain,omitempty"`
Domain *string

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1589,7 +1597,7 @@ func UnmarshalEnterprise(m map[string]json.RawMessage, result interface{}) (err
// GetAccountGroupOptions : The GetAccountGroup options.
type GetAccountGroupOptions struct {
// The ID of the account group to retrieve.
AccountGroupID *string `json:"account_group_id" validate:"required,ne="`
AccountGroupID *string `validate:"required,ne="`

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1617,7 +1625,7 @@ func (options *GetAccountGroupOptions) SetHeaders(param map[string]string) *GetA
// GetAccountOptions : The GetAccount options.
type GetAccountOptions struct {
// The ID of the account to retrieve.
AccountID *string `json:"account_id" validate:"required,ne="`
AccountID *string `validate:"required,ne="`

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1645,7 +1653,7 @@ func (options *GetAccountOptions) SetHeaders(param map[string]string) *GetAccoun
// GetEnterpriseOptions : The GetEnterprise options.
type GetEnterpriseOptions struct {
// The ID of the enterprise to retrieve.
EnterpriseID *string `json:"enterprise_id" validate:"required,ne="`
EnterpriseID *string `validate:"required,ne="`

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1673,18 +1681,18 @@ func (options *GetEnterpriseOptions) SetHeaders(param map[string]string) *GetEnt
// ImportAccountToEnterpriseOptions : The ImportAccountToEnterprise options.
type ImportAccountToEnterpriseOptions struct {
// The ID of the enterprise to import the stand-alone account into.
EnterpriseID *string `json:"enterprise_id" validate:"required,ne="`
EnterpriseID *string `validate:"required,ne="`

// The ID of the existing stand-alone account to be imported.
AccountID *string `json:"account_id" validate:"required,ne="`
AccountID *string `validate:"required,ne="`

// The CRN of the expected parent of the imported account. The parent is the enterprise or account group that the
// account is added to.
Parent *string `json:"parent,omitempty"`
Parent *string

// The ID of the [billing unit](/apidocs/enterprise-apis/billing-unit) to use for billing this account in the
// enterprise.
BillingUnitID *string `json:"billing_unit_id,omitempty"`
BillingUnitID *string

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1731,16 +1739,20 @@ func (options *ImportAccountToEnterpriseOptions) SetHeaders(param map[string]str
// ListAccountGroupsOptions : The ListAccountGroups options.
type ListAccountGroupsOptions struct {
// Get account groups that are either immediate children or are a part of the hierarchy for a given enterprise ID.
EnterpriseID *string `json:"enterprise_id,omitempty"`
EnterpriseID *string

// Get account groups that are either immediate children or are a part of the hierarchy for a given account group ID.
ParentAccountGroupID *string `json:"parent_account_group_id,omitempty"`
ParentAccountGroupID *string

// The first item to be returned in the page of results. This value can be obtained from the next_url property from the
// previous call of the operation. If not specified, then the first page of results is returned.
NextDocid *string

// Get account groups that are either immediate children or are a part of the hierarchy for a given parent CRN.
Parent *string `json:"parent,omitempty"`
Parent *string

// Return results up to this limit. Valid values are between `0` and `100`.
Limit *int64 `json:"limit,omitempty"`
Limit *int64

// Allows users to set headers on API requests
Headers map[string]string
Expand All @@ -1763,6 +1775,12 @@ func (options *ListAccountGroupsOptions) SetParentAccountGroupID(parentAccountGr
return options
}

// SetNextDocid : Allow user to set NextDocid
func (options *ListAccountGroupsOptions) SetNextDocid(nextDocid string) *ListAccountGroupsOptions {
options.NextDocid = core.StringPtr(nextDocid)
return options
}

// SetParent : Allow user to set Parent
func (options *ListAccountGroupsOptions) SetParent(parent string) *ListAccountGroupsOptions {
options.Parent = core.StringPtr(parent)
Expand Down Expand Up @@ -1815,16 +1833,20 @@ func UnmarshalListAccountGroupsResponse(m map[string]json.RawMessage, result int
// ListAccountsOptions : The ListAccounts options.
type ListAccountsOptions struct {
// Get accounts that are either immediate children or are a part of the hierarchy for a given enterprise ID.
EnterpriseID *string `json:"enterprise_id,omitempty"`
EnterpriseID *string

// Get accounts that are either immediate children or are a part of the hierarchy for a given account group ID.
AccountGroupID *string `json:"account_group_id,omitempty"`
AccountGroupID *string

// The first item to be returned in the page of results. This value can be obtained from the next_url property from the
// previous call of the operation. If not specified, then the first page of results is returned.
NextDocid *string

// Get accounts that are either immediate children or are a part of the hierarchy for a given parent CRN.
Parent *string `json:"parent,omitempty"`
Parent *string

// Return results up to this limit. Valid values are between `0` and `100`.
Limit *int64 `json:"limit,omitempty"`
Limit *int64

// Allows users to set headers on API requests
Headers map[string]string
Expand All @@ -1847,6 +1869,12 @@ func (options *ListAccountsOptions) SetAccountGroupID(accountGroupID string) *Li
return options
}

// SetNextDocid : Allow user to set NextDocid
func (options *ListAccountsOptions) SetNextDocid(nextDocid string) *ListAccountsOptions {
options.NextDocid = core.StringPtr(nextDocid)
return options
}

// SetParent : Allow user to set Parent
func (options *ListAccountsOptions) SetParent(parent string) *ListAccountsOptions {
options.Parent = core.StringPtr(parent)
Expand Down Expand Up @@ -1899,16 +1927,20 @@ func UnmarshalListAccountsResponse(m map[string]json.RawMessage, result interfac
// ListEnterprisesOptions : The ListEnterprises options.
type ListEnterprisesOptions struct {
// Get enterprises for a given enterprise account ID.
EnterpriseAccountID *string `json:"enterprise_account_id,omitempty"`
EnterpriseAccountID *string

// Get enterprises for a given account group ID.
AccountGroupID *string `json:"account_group_id,omitempty"`
AccountGroupID *string

// Get enterprises for a given account ID.
AccountID *string `json:"account_id,omitempty"`
AccountID *string

// The first item to be returned in the page of results. This value can be obtained from the next_url property from the
// previous call of the operation. If not specified, then the first page of results is returned.
NextDocid *string

// Return results up to this limit. Valid values are between `0` and `100`.
Limit *int64 `json:"limit,omitempty"`
Limit *int64

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -1937,6 +1969,12 @@ func (options *ListEnterprisesOptions) SetAccountID(accountID string) *ListEnter
return options
}

// SetNextDocid : Allow user to set NextDocid
func (options *ListEnterprisesOptions) SetNextDocid(nextDocid string) *ListEnterprisesOptions {
options.NextDocid = core.StringPtr(nextDocid)
return options
}

// SetLimit : Allow user to set Limit
func (options *ListEnterprisesOptions) SetLimit(limit int64) *ListEnterprisesOptions {
options.Limit = core.Int64Ptr(limit)
Expand Down Expand Up @@ -1983,13 +2021,13 @@ func UnmarshalListEnterprisesResponse(m map[string]json.RawMessage, result inter
// UpdateAccountGroupOptions : The UpdateAccountGroup options.
type UpdateAccountGroupOptions struct {
// The ID of the account group to retrieve.
AccountGroupID *string `json:"account_group_id" validate:"required,ne="`
AccountGroupID *string `validate:"required,ne="`

// The new name of the account group. This field must have 3 - 60 characters.
Name *string `json:"name,omitempty"`
Name *string

// The IAM ID of the user to be the new primary contact for the account group.
PrimaryContactIamID *string `json:"primary_contact_iam_id,omitempty"`
PrimaryContactIamID *string

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -2029,10 +2067,10 @@ func (options *UpdateAccountGroupOptions) SetHeaders(param map[string]string) *U
// UpdateAccountOptions : The UpdateAccount options.
type UpdateAccountOptions struct {
// The ID of the account to retrieve.
AccountID *string `json:"account_id" validate:"required,ne="`
AccountID *string `validate:"required,ne="`

// The CRN of the new parent within the enterprise.
Parent *string `json:"parent" validate:"required"`
Parent *string `validate:"required"`

// Allows users to set headers on API requests
Headers map[string]string
Expand Down Expand Up @@ -2067,16 +2105,16 @@ func (options *UpdateAccountOptions) SetHeaders(param map[string]string) *Update
// UpdateEnterpriseOptions : The UpdateEnterprise options.
type UpdateEnterpriseOptions struct {
// The ID of the enterprise to retrieve.
EnterpriseID *string `json:"enterprise_id" validate:"required,ne="`
EnterpriseID *string `validate:"required,ne="`

// The new name of the enterprise. This field must have 3 - 60 characters.
Name *string `json:"name,omitempty"`
Name *string

// The new domain of the enterprise. This field has a limit of 60 characters.
Domain *string `json:"domain,omitempty"`
Domain *string

// The IAM ID of the user to be the new primary contact for the enterprise.
PrimaryContactIamID *string `json:"primary_contact_iam_id,omitempty"`
PrimaryContactIamID *string

// Allows users to set headers on API requests
Headers map[string]string
Expand Down
Loading

0 comments on commit 3a11a67

Please sign in to comment.