Skip to content

Commit

Permalink
fix(Activity Tracker): re-gen after recent API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
padamstx committed Nov 30, 2020
1 parent b814879 commit efc8062
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
30 changes: 15 additions & 15 deletions atrackerv1/atracker_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-ef9b3113-20201118-074613
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-60fd6b3d-20201128-071551
*/


Expand Down Expand Up @@ -817,7 +817,7 @@ type CreateTargetOptions struct {
// Constants associated with the CreateTargetOptions.TargetType property.
// The type of the target.
const (
CreateTargetOptions_TargetType_Cos = "cos"
CreateTargetOptions_TargetType_CloudObjectStorage = "cloud-object-storage"
)

// NewCreateTargetOptions : Instantiate CreateTargetOptions
Expand Down Expand Up @@ -1081,7 +1081,7 @@ type ReplaceTargetOptions struct {
// Constants associated with the ReplaceTargetOptions.TargetType property.
// The type of the target.
const (
ReplaceTargetOptions_TargetType_Cos = "cos"
ReplaceTargetOptions_TargetType_CloudObjectStorage = "cloud-object-storage"
)

// NewReplaceTargetOptions : Instantiate ReplaceTargetOptions
Expand Down Expand Up @@ -1127,25 +1127,25 @@ func (options *ReplaceTargetOptions) SetHeaders(param map[string]string) *Replac
// Route : The route resource.
type Route struct {
// The uuid of this route resource.
ID *string `json:"id,omitempty"`
ID *string `json:"id" validate:"required"`

// The name of this route.
Name *string `json:"name,omitempty"`
Name *string `json:"name" validate:"required"`

// The uuid of ATracker services in this region.
InstanceID *string `json:"instance_id,omitempty"`
InstanceID *string `json:"instance_id" validate:"required"`

// The crn of this route type resource.
Crn *string `json:"crn,omitempty"`
Crn *string `json:"crn" validate:"required"`

// The version of this route.
Version *int64 `json:"version,omitempty"`

// Whether or not all global events should be forwarded to this region.
ReceiveGlobalEvents *bool `json:"receive_global_events,omitempty"`
ReceiveGlobalEvents *bool `json:"receive_global_events" validate:"required"`

// The routing rules that will be evaluated in their order of the array.
Rules []Rule `json:"rules,omitempty"`
Rules []Rule `json:"rules" validate:"required"`
}


Expand Down Expand Up @@ -1234,19 +1234,19 @@ func UnmarshalRule(m map[string]json.RawMessage, result interface{}) (err error)
// in the response.
type Target struct {
// The uuid of this target resource.
ID *string `json:"id,omitempty"`
ID *string `json:"id" validate:"required"`

// The name of this target resource.
Name *string `json:"name,omitempty"`
Name *string `json:"name" validate:"required"`

// The uuid of ATracker services in this region.
InstanceID *string `json:"instance_id,omitempty"`
InstanceID *string `json:"instance_id" validate:"required"`

// The crn of this target type resource.
Crn *string `json:"crn,omitempty"`
Crn *string `json:"crn" validate:"required"`

// The type of this target.
TargetType *string `json:"target_type,omitempty"`
TargetType *string `json:"target_type" validate:"required"`

// The encryption key used to encrypt events before ATracker services buffer them on storage. This credential will be
// masked in the response.
Expand All @@ -1259,7 +1259,7 @@ type Target struct {
// Constants associated with the Target.TargetType property.
// The type of this target.
const (
Target_TargetType_Cos = "cos"
Target_TargetType_CloudObjectStorage = "cloud-object-storage"
)


Expand Down
32 changes: 16 additions & 16 deletions atrackerv1/atracker_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Construct an instance of the CreateTargetOptions model
createTargetOptionsModel := new(atrackerv1.CreateTargetOptions)
createTargetOptionsModel.Name = core.StringPtr("my-cos-target")
createTargetOptionsModel.TargetType = core.StringPtr("cos")
createTargetOptionsModel.TargetType = core.StringPtr("cloud-object-storage")
createTargetOptionsModel.CosEndpoint = cosEndpointModel
createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
// Expect response parsing to fail since we are receiving a text/plain response
Expand Down Expand Up @@ -225,7 +225,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Set mock response
res.Header().Set("Content-type", "application/json")
res.WriteHeader(201)
fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cos", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}`)
fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cloud-object-storage", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}`)
}))
})
It(`Invoke CreateTarget successfully`, func() {
Expand Down Expand Up @@ -253,7 +253,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Construct an instance of the CreateTargetOptions model
createTargetOptionsModel := new(atrackerv1.CreateTargetOptions)
createTargetOptionsModel.Name = core.StringPtr("my-cos-target")
createTargetOptionsModel.TargetType = core.StringPtr("cos")
createTargetOptionsModel.TargetType = core.StringPtr("cloud-object-storage")
createTargetOptionsModel.CosEndpoint = cosEndpointModel
createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

Expand Down Expand Up @@ -306,7 +306,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Construct an instance of the CreateTargetOptions model
createTargetOptionsModel := new(atrackerv1.CreateTargetOptions)
createTargetOptionsModel.Name = core.StringPtr("my-cos-target")
createTargetOptionsModel.TargetType = core.StringPtr("cos")
createTargetOptionsModel.TargetType = core.StringPtr("cloud-object-storage")
createTargetOptionsModel.CosEndpoint = cosEndpointModel
createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
// Invoke operation with empty URL (negative test)
Expand Down Expand Up @@ -394,7 +394,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Set mock response
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, "%s", `{"targets": [{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cos", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}]}`)
fmt.Fprintf(res, "%s", `{"targets": [{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cloud-object-storage", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}]}`)
}))
})
It(`Invoke ListTargets successfully`, func() {
Expand Down Expand Up @@ -537,7 +537,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Set mock response
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cos", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}`)
fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cloud-object-storage", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}`)
}))
})
It(`Invoke GetTarget successfully`, func() {
Expand Down Expand Up @@ -658,7 +658,7 @@ var _ = Describe(`AtrackerV1`, func() {
replaceTargetOptionsModel := new(atrackerv1.ReplaceTargetOptions)
replaceTargetOptionsModel.ID = core.StringPtr("testString")
replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target")
replaceTargetOptionsModel.TargetType = core.StringPtr("cos")
replaceTargetOptionsModel.TargetType = core.StringPtr("cloud-object-storage")
replaceTargetOptionsModel.CosEndpoint = cosEndpointModel
replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
// Expect response parsing to fail since we are receiving a text/plain response
Expand Down Expand Up @@ -715,7 +715,7 @@ var _ = Describe(`AtrackerV1`, func() {
// Set mock response
res.Header().Set("Content-type", "application/json")
res.WriteHeader(200)
fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cos", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}`)
fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "instance_id": "b6eec08b-5201-08ca-451b-cd71523e3626", "crn": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "target_type": "cloud-object-storage", "encrypt_key": "REDACTED", "cos_endpoint": {"endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud", "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "bucket": "my-atracker-bucket", "api_key": "REDACTED"}}`)
}))
})
It(`Invoke ReplaceTarget successfully`, func() {
Expand Down Expand Up @@ -744,7 +744,7 @@ var _ = Describe(`AtrackerV1`, func() {
replaceTargetOptionsModel := new(atrackerv1.ReplaceTargetOptions)
replaceTargetOptionsModel.ID = core.StringPtr("testString")
replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target")
replaceTargetOptionsModel.TargetType = core.StringPtr("cos")
replaceTargetOptionsModel.TargetType = core.StringPtr("cloud-object-storage")
replaceTargetOptionsModel.CosEndpoint = cosEndpointModel
replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}

Expand Down Expand Up @@ -798,7 +798,7 @@ var _ = Describe(`AtrackerV1`, func() {
replaceTargetOptionsModel := new(atrackerv1.ReplaceTargetOptions)
replaceTargetOptionsModel.ID = core.StringPtr("testString")
replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target")
replaceTargetOptionsModel.TargetType = core.StringPtr("cos")
replaceTargetOptionsModel.TargetType = core.StringPtr("cloud-object-storage")
replaceTargetOptionsModel.CosEndpoint = cosEndpointModel
replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"}
// Invoke operation with empty URL (negative test)
Expand Down Expand Up @@ -1786,16 +1786,16 @@ var _ = Describe(`AtrackerV1`, func() {

// Construct an instance of the CreateTargetOptions model
createTargetOptionsName := "my-cos-target"
createTargetOptionsTargetType := "cos"
createTargetOptionsTargetType := "cloud-object-storage"
var createTargetOptionsCosEndpoint *atrackerv1.CosEndpoint = nil
createTargetOptionsModel := atrackerService.NewCreateTargetOptions(createTargetOptionsName, createTargetOptionsTargetType, createTargetOptionsCosEndpoint)
createTargetOptionsModel.SetName("my-cos-target")
createTargetOptionsModel.SetTargetType("cos")
createTargetOptionsModel.SetTargetType("cloud-object-storage")
createTargetOptionsModel.SetCosEndpoint(cosEndpointModel)
createTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
Expect(createTargetOptionsModel).ToNot(BeNil())
Expect(createTargetOptionsModel.Name).To(Equal(core.StringPtr("my-cos-target")))
Expect(createTargetOptionsModel.TargetType).To(Equal(core.StringPtr("cos")))
Expect(createTargetOptionsModel.TargetType).To(Equal(core.StringPtr("cloud-object-storage")))
Expect(createTargetOptionsModel.CosEndpoint).To(Equal(cosEndpointModel))
Expect(createTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
})
Expand Down Expand Up @@ -1894,18 +1894,18 @@ var _ = Describe(`AtrackerV1`, func() {
// Construct an instance of the ReplaceTargetOptions model
id := "testString"
replaceTargetOptionsName := "my-cos-target"
replaceTargetOptionsTargetType := "cos"
replaceTargetOptionsTargetType := "cloud-object-storage"
var replaceTargetOptionsCosEndpoint *atrackerv1.CosEndpoint = nil
replaceTargetOptionsModel := atrackerService.NewReplaceTargetOptions(id, replaceTargetOptionsName, replaceTargetOptionsTargetType, replaceTargetOptionsCosEndpoint)
replaceTargetOptionsModel.SetID("testString")
replaceTargetOptionsModel.SetName("my-cos-target")
replaceTargetOptionsModel.SetTargetType("cos")
replaceTargetOptionsModel.SetTargetType("cloud-object-storage")
replaceTargetOptionsModel.SetCosEndpoint(cosEndpointModel)
replaceTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"})
Expect(replaceTargetOptionsModel).ToNot(BeNil())
Expect(replaceTargetOptionsModel.ID).To(Equal(core.StringPtr("testString")))
Expect(replaceTargetOptionsModel.Name).To(Equal(core.StringPtr("my-cos-target")))
Expect(replaceTargetOptionsModel.TargetType).To(Equal(core.StringPtr("cos")))
Expect(replaceTargetOptionsModel.TargetType).To(Equal(core.StringPtr("cloud-object-storage")))
Expect(replaceTargetOptionsModel.CosEndpoint).To(Equal(cosEndpointModel))
Expect(replaceTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"}))
})
Expand Down

0 comments on commit efc8062

Please sign in to comment.