Skip to content

Commit

Permalink
fix(Catalog Management): re-gen after update to delete_version_instan…
Browse files Browse the repository at this point in the history
…ce (#85)
  • Loading branch information
padamstx authored Feb 23, 2021
1 parent 4fffae2 commit 568be81
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
17 changes: 15 additions & 2 deletions catalogmanagementv1/catalog_management_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-4c92c221-20210211-060810
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-212f8afa-20210222-123519
*/

// Package catalogmanagementv1 : Operations and models for the CatalogManagementV1 service
Expand Down Expand Up @@ -5230,6 +5230,9 @@ func (catalogManagement *CatalogManagementV1) DeleteVersionInstanceWithContext(c
for headerName, headerValue := range sdkHeaders {
builder.AddHeader(headerName, headerValue)
}
if deleteVersionInstanceOptions.XAuthRefreshToken != nil {
builder.AddHeader("X-Auth-Refresh-Token", fmt.Sprint(*deleteVersionInstanceOptions.XAuthRefreshToken))
}

request, err := builder.Build()
if err != nil {
Expand Down Expand Up @@ -7342,14 +7345,18 @@ type DeleteVersionInstanceOptions struct {
// Version Instance identifier.
InstanceIdentifier *string `validate:"required,ne="`

// IAM Refresh token.
XAuthRefreshToken *string `validate:"required"`

// Allows users to set headers on API requests
Headers map[string]string
}

// NewDeleteVersionInstanceOptions : Instantiate DeleteVersionInstanceOptions
func (*CatalogManagementV1) NewDeleteVersionInstanceOptions(instanceIdentifier string) *DeleteVersionInstanceOptions {
func (*CatalogManagementV1) NewDeleteVersionInstanceOptions(instanceIdentifier string, xAuthRefreshToken string) *DeleteVersionInstanceOptions {
return &DeleteVersionInstanceOptions{
InstanceIdentifier: core.StringPtr(instanceIdentifier),
XAuthRefreshToken: core.StringPtr(xAuthRefreshToken),
}
}

Expand All @@ -7359,6 +7366,12 @@ func (options *DeleteVersionInstanceOptions) SetInstanceIdentifier(instanceIdent
return options
}

// SetXAuthRefreshToken : Allow user to set XAuthRefreshToken
func (options *DeleteVersionInstanceOptions) SetXAuthRefreshToken(xAuthRefreshToken string) *DeleteVersionInstanceOptions {
options.XAuthRefreshToken = core.StringPtr(xAuthRefreshToken)
return options
}

// SetHeaders : Allow user to set Headers
func (options *DeleteVersionInstanceOptions) SetHeaders(param map[string]string) *DeleteVersionInstanceOptions {
options.Headers = param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ var _ = Describe(`CatalogManagementV1 Integration Tests (New)`, func() {
It(`DeleteVersionInstance(deleteVersionInstanceOptions *DeleteVersionInstanceOptions)`, func() {
Expect(testVersionInstanceID).ToNot(BeEmpty())

deleteVersionInstanceOptions := catalogManagementService.NewDeleteVersionInstanceOptions(testVersionInstanceID)
deleteVersionInstanceOptions := catalogManagementService.NewDeleteVersionInstanceOptions(testVersionInstanceID, refreshToken)

response, err := catalogManagementService.DeleteVersionInstance(deleteVersionInstanceOptions)

Expand Down
9 changes: 8 additions & 1 deletion catalogmanagementv1/catalog_management_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15699,6 +15699,8 @@ var _ = Describe(`CatalogManagementV1`, func() {
Expect(req.URL.EscapedPath()).To(Equal(deleteVersionInstancePath))
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)
}))
})
Expand All @@ -15718,6 +15720,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
// Construct an instance of the DeleteVersionInstanceOptions model
deleteVersionInstanceOptionsModel := new(catalogmanagementv1.DeleteVersionInstanceOptions)
deleteVersionInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString")
deleteVersionInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString")
deleteVersionInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

// Invoke operation with valid options model (positive test)
Expand All @@ -15736,6 +15739,7 @@ var _ = Describe(`CatalogManagementV1`, func() {
// Construct an instance of the DeleteVersionInstanceOptions model
deleteVersionInstanceOptionsModel := new(catalogmanagementv1.DeleteVersionInstanceOptions)
deleteVersionInstanceOptionsModel.InstanceIdentifier = core.StringPtr("testString")
deleteVersionInstanceOptionsModel.XAuthRefreshToken = core.StringPtr("testString")
deleteVersionInstanceOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
// Invoke operation with empty URL (negative test)
err := catalogManagementService.SetServiceURL("")
Expand Down Expand Up @@ -16538,11 +16542,14 @@ var _ = Describe(`CatalogManagementV1`, func() {
It(`Invoke NewDeleteVersionInstanceOptions successfully`, func() {
// Construct an instance of the DeleteVersionInstanceOptions model
instanceIdentifier := "testString"
deleteVersionInstanceOptionsModel := catalogManagementService.NewDeleteVersionInstanceOptions(instanceIdentifier)
xAuthRefreshToken := "testString"
deleteVersionInstanceOptionsModel := catalogManagementService.NewDeleteVersionInstanceOptions(instanceIdentifier, xAuthRefreshToken)
deleteVersionInstanceOptionsModel.SetInstanceIdentifier("testString")
deleteVersionInstanceOptionsModel.SetXAuthRefreshToken("testString")
deleteVersionInstanceOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
Expect(deleteVersionInstanceOptionsModel).ToNot(BeNil())
Expect(deleteVersionInstanceOptionsModel.InstanceIdentifier).To(Equal(core.StringPtr("testString")))
Expect(deleteVersionInstanceOptionsModel.XAuthRefreshToken).To(Equal(core.StringPtr("testString")))
Expect(deleteVersionInstanceOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
})
It(`Invoke NewDeleteVersionOptions successfully`, func() {
Expand Down

0 comments on commit 568be81

Please sign in to comment.