Skip to content

Commit

Permalink
fix(deps): use v5 core with all services (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
padamstx committed Apr 2, 2021
1 parent a74b822 commit a482f6d
Show file tree
Hide file tree
Showing 37 changed files with 387 additions and 510 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"time"

"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/catalogmanagementv1"
common "github.com/IBM/platform-services-go-sdk/common"

Expand Down Expand Up @@ -83,7 +83,7 @@ var _ = Describe("Catalog Management - Integration Tests (OLD)", func() {
Expect(err).To(BeNil())
Expect(service).ToNot(BeNil())

core.SetLogger(core.NewLogger(core.LevelDebug, log.New(GinkgoWriter, "", log.LstdFlags)))
core.SetLogger(core.NewLogger(core.LevelDebug, log.New(GinkgoWriter, "", log.LstdFlags), log.New(GinkgoWriter, "", log.LstdFlags)))
service.EnableRetries(4, 30*time.Second)

config, err = core.GetServiceProperties(catalogmanagementv1.DefaultServiceName)
Expand Down
267 changes: 122 additions & 145 deletions configurationgovernancev1/configuration_governance_v1.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/configurationgovernancev1"
"github.com/google/uuid"
. "github.com/onsi/ginkgo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"time"

"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/go-sdk-core/v5/core"
common "github.com/IBM/platform-services-go-sdk/common"
. "github.com/IBM/platform-services-go-sdk/configurationgovernancev1"
"github.com/google/uuid"
Expand Down Expand Up @@ -229,7 +229,7 @@ var _ = Describe(`ConfigurationGovernanceV1 Integration Tests`, func() {
Expect(service).ToNot(BeNil())
Expect(service.Service.Options.URL).To(Equal(serviceURL))

core.SetLogger(core.NewLogger(core.LevelDebug, log.New(GinkgoWriter, "", log.LstdFlags)))
core.SetLogger(core.NewLogger(core.LevelDebug, log.New(GinkgoWriter, "", log.LstdFlags), log.New(GinkgoWriter, "", log.LstdFlags)))
service.EnableRetries(4, 30*time.Second)
})
It("Successfully construct addition 'no-access' service client instance", func() {
Expand Down
29 changes: 12 additions & 17 deletions configurationgovernancev1/configuration_governance_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ import (
"bytes"
"context"
"fmt"
"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/platform-services-go-sdk/configurationgovernancev1"
"github.com/go-openapi/strfmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"time"

"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/configurationgovernancev1"
"github.com/go-openapi/strfmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

var _ = Describe(`ConfigurationGovernanceV1`, func() {
Expand Down Expand Up @@ -66,14 +67,13 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
Context(`Using external config, construct service client instances`, func() {
// Map containing environment variables used in testing.
var testEnvironment = map[string]string{
"CONFIGURATION_GOVERNANCE_URL": "https://configurationgovernancev1/api",
"CONFIGURATION_GOVERNANCE_URL": "https://configurationgovernancev1/api",
"CONFIGURATION_GOVERNANCE_AUTH_TYPE": "noauth",
}

It(`Create service client using external config successfully`, func() {
SetTestEnvironment(testEnvironment)
configurationGovernanceService, serviceErr := configurationgovernancev1.NewConfigurationGovernanceV1UsingExternalConfig(&configurationgovernancev1.ConfigurationGovernanceV1Options{
})
configurationGovernanceService, serviceErr := configurationgovernancev1.NewConfigurationGovernanceV1UsingExternalConfig(&configurationgovernancev1.ConfigurationGovernanceV1Options{})
Expect(configurationGovernanceService).ToNot(BeNil())
Expect(serviceErr).To(BeNil())
ClearTestEnvironment(testEnvironment)
Expand Down Expand Up @@ -102,8 +102,7 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
})
It(`Create service client using external config and set url programatically successfully`, func() {
SetTestEnvironment(testEnvironment)
configurationGovernanceService, serviceErr := configurationgovernancev1.NewConfigurationGovernanceV1UsingExternalConfig(&configurationgovernancev1.ConfigurationGovernanceV1Options{
})
configurationGovernanceService, serviceErr := configurationgovernancev1.NewConfigurationGovernanceV1UsingExternalConfig(&configurationgovernancev1.ConfigurationGovernanceV1Options{})
err := configurationGovernanceService.SetServiceURL("https://testService/api")
Expect(err).To(BeNil())
Expect(configurationGovernanceService).ToNot(BeNil())
Expand All @@ -121,13 +120,12 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
Context(`Using external config, construct service client instances with error: Invalid Auth`, func() {
// Map containing environment variables used in testing.
var testEnvironment = map[string]string{
"CONFIGURATION_GOVERNANCE_URL": "https://configurationgovernancev1/api",
"CONFIGURATION_GOVERNANCE_URL": "https://configurationgovernancev1/api",
"CONFIGURATION_GOVERNANCE_AUTH_TYPE": "someOtherAuth",
}

SetTestEnvironment(testEnvironment)
configurationGovernanceService, serviceErr := configurationgovernancev1.NewConfigurationGovernanceV1UsingExternalConfig(&configurationgovernancev1.ConfigurationGovernanceV1Options{
})
configurationGovernanceService, serviceErr := configurationgovernancev1.NewConfigurationGovernanceV1UsingExternalConfig(&configurationgovernancev1.ConfigurationGovernanceV1Options{})

It(`Instantiate service client with error`, func() {
Expect(configurationGovernanceService).To(BeNil())
Expand All @@ -138,7 +136,7 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
Context(`Using external config, construct service client instances with error: Invalid URL`, func() {
// Map containing environment variables used in testing.
var testEnvironment = map[string]string{
"CONFIGURATION_GOVERNANCE_AUTH_TYPE": "NOAuth",
"CONFIGURATION_GOVERNANCE_AUTH_TYPE": "NOAuth",
}

SetTestEnvironment(testEnvironment)
Expand Down Expand Up @@ -574,7 +572,6 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString")))
Expect(req.URL.Query()["account_id"]).To(Equal([]string{"531fc3e28bfc43c5a2cea07786d93f5c"}))


// TODO: Add check for attached query parameter

Expect(req.URL.Query()["labels"]).To(Equal([]string{"SOC2,ITCS300"}))
Expand Down Expand Up @@ -642,7 +639,6 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString")))
Expect(req.URL.Query()["account_id"]).To(Equal([]string{"531fc3e28bfc43c5a2cea07786d93f5c"}))


// TODO: Add check for attached query parameter

Expect(req.URL.Query()["labels"]).To(Equal([]string{"SOC2,ITCS300"}))
Expand Down Expand Up @@ -720,7 +716,6 @@ var _ = Describe(`ConfigurationGovernanceV1`, func() {
Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString")))
Expect(req.URL.Query()["account_id"]).To(Equal([]string{"531fc3e28bfc43c5a2cea07786d93f5c"}))


// TODO: Add check for attached query parameter

Expect(req.URL.Query()["labels"]).To(Equal([]string{"SOC2,ITCS300"}))
Expand Down
34 changes: 13 additions & 21 deletions enterprisebillingunitsv1/enterprise_billing_units_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-629bbb97-20201207-171303
*/


// Package enterprisebillingunitsv1 : Operations and models for the EnterpriseBillingUnitsV1 service
package enterprisebillingunitsv1
Expand All @@ -26,12 +25,13 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/IBM/go-sdk-core/v4/core"
common "github.com/IBM/platform-services-go-sdk/common"
"github.com/go-openapi/strfmt"
"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"
)

// EnterpriseBillingUnitsV1 : Billing units for IBM Cloud enterprises
Expand Down Expand Up @@ -446,27 +446,26 @@ type BillingOption struct {
// Constants associated with the BillingOption.State property.
// The state of the billing option. The valid values include `ACTIVE, `SUSPENDED`, and `CANCELED`.
const (
BillingOptionStateActiveConst = "ACTIVE"
BillingOptionStateCanceledConst = "CANCELED"
BillingOptionStateActiveConst = "ACTIVE"
BillingOptionStateCanceledConst = "CANCELED"
BillingOptionStateSuspendedConst = "SUSPENDED"
)

// Constants associated with the BillingOption.Type property.
// The type of billing option. The valid values are `SUBSCRIPTION` and `OFFER`.
const (
BillingOptionTypeOfferConst = "OFFER"
BillingOptionTypeOfferConst = "OFFER"
BillingOptionTypeSubscriptionConst = "SUBSCRIPTION"
)

// Constants associated with the BillingOption.Category property.
// The category of the billing option. The valid values are `PLATFORM`, `SERVICE`, and `SUPPORT`.
const (
BillingOptionCategoryPlatformConst = "PLATFORM"
BillingOptionCategoryServiceConst = "SERVICE"
BillingOptionCategorySupportConst = "SUPPORT"
BillingOptionCategoryServiceConst = "SERVICE"
BillingOptionCategorySupportConst = "SUPPORT"
)


// UnmarshalBillingOption unmarshals an instance of BillingOption from the specified map of raw messages.
func UnmarshalBillingOption(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(BillingOption)
Expand Down Expand Up @@ -538,7 +537,6 @@ type BillingOptionsList struct {
Resources []BillingOption `json:"resources,omitempty"`
}


// UnmarshalBillingOptionsList unmarshals an instance of BillingOptionsList from the specified map of raw messages.
func UnmarshalBillingOptionsList(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(BillingOptionsList)
Expand Down Expand Up @@ -585,7 +583,6 @@ type BillingUnit struct {
CreatedAt *strfmt.DateTime `json:"created_at,omitempty"`
}


// UnmarshalBillingUnit unmarshals an instance of BillingUnit from the specified map of raw messages.
func UnmarshalBillingUnit(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(BillingUnit)
Expand Down Expand Up @@ -637,7 +634,6 @@ type BillingUnitsList struct {
Resources []BillingUnit `json:"resources,omitempty"`
}


// UnmarshalBillingUnitsList unmarshals an instance of BillingUnitsList from the specified map of raw messages.
func UnmarshalBillingUnitsList(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(BillingUnitsList)
Expand Down Expand Up @@ -680,10 +676,9 @@ type CreditPool struct {
// The type of credit, either `PLATFORM` or `SUPPORT`.
const (
CreditPoolTypePlatformConst = "PLATFORM"
CreditPoolTypeSupportConst = "SUPPORT"
CreditPoolTypeSupportConst = "SUPPORT"
)


// UnmarshalCreditPool unmarshals an instance of CreditPool from the specified map of raw messages.
func UnmarshalCreditPool(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(CreditPool)
Expand Down Expand Up @@ -720,7 +715,6 @@ type CreditPoolOverage struct {
Resources []map[string]interface{} `json:"resources,omitempty"`
}


// UnmarshalCreditPoolOverage unmarshals an instance of CreditPoolOverage from the specified map of raw messages.
func UnmarshalCreditPoolOverage(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(CreditPoolOverage)
Expand Down Expand Up @@ -749,7 +743,6 @@ type CreditPoolsList struct {
Resources []CreditPool `json:"resources,omitempty"`
}


// UnmarshalCreditPoolsList unmarshals an instance of CreditPoolsList from the specified map of raw messages.
func UnmarshalCreditPoolsList(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(CreditPoolsList)
Expand Down Expand Up @@ -950,13 +943,12 @@ type TermCredits struct {
// The category of the credit pool. The valid values are `PLATFORM`, `OFFER`, or `SERVICE` for platform credit and
// `SUPPORT` for support credit.
const (
TermCreditsCategoryOfferConst = "OFFER"
TermCreditsCategoryOfferConst = "OFFER"
TermCreditsCategoryPlatformConst = "PLATFORM"
TermCreditsCategoryServiceConst = "SERVICE"
TermCreditsCategorySupportConst = "SUPPORT"
TermCreditsCategoryServiceConst = "SERVICE"
TermCreditsCategorySupportConst = "SUPPORT"
)


// UnmarshalTermCredits unmarshals an instance of TermCredits from the specified map of raw messages.
func UnmarshalTermCredits(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(TermCredits)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"os"

"github.com/IBM/go-sdk-core/v4/core"
"github.com/IBM/go-sdk-core/v5/core"
common "github.com/IBM/platform-services-go-sdk/common"
"github.com/IBM/platform-services-go-sdk/enterprisebillingunitsv1"
. "github.com/onsi/ginkgo"
Expand Down

0 comments on commit a482f6d

Please sign in to comment.