diff --git a/atrackerv2/atracker_v2.go b/atrackerv2/atracker_v2.go index 9434a505..a8ff5fdf 100644 --- a/atrackerv2/atracker_v2.go +++ b/atrackerv2/atracker_v2.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.51.0-5b8b699d-20220613-200818 + * IBM OpenAPI SDK Code Generator Version: 3.55.1-b24c7487-20220831-201343 */ // Package atrackerv2 : Operations and models for the AtrackerV2 service @@ -35,7 +35,7 @@ import ( ) // AtrackerV2 : IBM Cloud Activity Tracker allows you to configure how auditing events are collected and stored in each -// region in your account. Events can be sent to Cloud Object Storage bucket or Logdna. +// region in your account. Events can be sent to Cloud Object Storage bucket, Logdna or Event Streams. // // API Version: 2.0.0 type AtrackerV2 struct { @@ -228,6 +228,9 @@ func (atracker *AtrackerV2) CreateTargetWithContext(ctx context.Context, createT if createTargetOptions.LogdnaEndpoint != nil { body["logdna_endpoint"] = createTargetOptions.LogdnaEndpoint } + if createTargetOptions.EventstreamsEndpoint != nil { + body["eventstreams_endpoint"] = createTargetOptions.EventstreamsEndpoint + } if createTargetOptions.Region != nil { body["region"] = createTargetOptions.Region } @@ -423,6 +426,9 @@ func (atracker *AtrackerV2) ReplaceTargetWithContext(ctx context.Context, replac if replaceTargetOptions.LogdnaEndpoint != nil { body["logdna_endpoint"] = replaceTargetOptions.LogdnaEndpoint } + if replaceTargetOptions.EventstreamsEndpoint != nil { + body["eventstreams_endpoint"] = replaceTargetOptions.EventstreamsEndpoint + } _, err = builder.SetBodyContentJSON(body) if err != nil { return @@ -1249,8 +1255,8 @@ type CreateTargetOptions struct { // than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names. Name *string `json:"name" validate:"required"` - // The type of the target. It can be cloud_object_storage or logdna. Based on this type you must include cos_endpoint - // or logdna_endpoint. + // The type of the target. It can be cloud_object_storage, logdna or event_streams. Based on this type you must include + // cos_endpoint, logdna_endpoint or eventstreams_endpoint. TargetType *string `json:"target_type" validate:"required"` // Property values for a Cloud Object Storage Endpoint in requests. @@ -1259,6 +1265,9 @@ type CreateTargetOptions struct { // Property values for a LogDNA Endpoint in requests. LogdnaEndpoint *LogdnaEndpointPrototype `json:"logdna_endpoint,omitempty"` + // Property values for a Event Streams Endpoint in requests. + EventstreamsEndpoint *EventstreamsEndpointPrototype `json:"eventstreams_endpoint,omitempty"` + // Include this optional field if you want to create a target in a different region other than the one you are // connected. Region *string `json:"region,omitempty"` @@ -1268,10 +1277,11 @@ type CreateTargetOptions struct { } // Constants associated with the CreateTargetOptions.TargetType property. -// The type of the target. It can be cloud_object_storage or logdna. Based on this type you must include cos_endpoint or -// logdna_endpoint. +// The type of the target. It can be cloud_object_storage, logdna or event_streams. Based on this type you must include +// cos_endpoint, logdna_endpoint or eventstreams_endpoint. const ( CreateTargetOptionsTargetTypeCloudObjectStorageConst = "cloud_object_storage" + CreateTargetOptionsTargetTypeEventStreamsConst = "event_streams" CreateTargetOptionsTargetTypeLogdnaConst = "logdna" ) @@ -1307,6 +1317,12 @@ func (_options *CreateTargetOptions) SetLogdnaEndpoint(logdnaEndpoint *LogdnaEnd return _options } +// SetEventstreamsEndpoint : Allow user to set EventstreamsEndpoint +func (_options *CreateTargetOptions) SetEventstreamsEndpoint(eventstreamsEndpoint *EventstreamsEndpointPrototype) *CreateTargetOptions { + _options.EventstreamsEndpoint = eventstreamsEndpoint + return _options +} + // SetRegion : Allow user to set Region func (_options *CreateTargetOptions) SetRegion(region string) *CreateTargetOptions { _options.Region = core.StringPtr(region) @@ -1375,6 +1391,94 @@ func (options *DeleteTargetOptions) SetHeaders(param map[string]string) *DeleteT return options } +// EventstreamsEndpoint : Property values for a Event Streams Endpoint in responses. +type EventstreamsEndpoint struct { + // The CRN of the event streams instance. + TargetCRN *string `json:"target_crn" validate:"required"` + + // list of broker endpoints. + Brokers []string `json:"brokers" validate:"required"` + + // The messsage hub topic defined in the event streams instance. + Topic *string `json:"topic" validate:"required"` + + // The messsage hub topic's user password specified in the event streams instance (the apikey). + Password *string `json:"password" validate:"required"` +} + +// UnmarshalEventstreamsEndpoint unmarshals an instance of EventstreamsEndpoint from the specified map of raw messages. +func UnmarshalEventstreamsEndpoint(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EventstreamsEndpoint) + err = core.UnmarshalPrimitive(m, "target_crn", &obj.TargetCRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "brokers", &obj.Brokers) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "topic", &obj.Topic) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "password", &obj.Password) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EventstreamsEndpointPrototype : Property values for a Event Streams Endpoint in requests. +type EventstreamsEndpointPrototype struct { + // The CRN of the event streams instance. + TargetCRN *string `json:"target_crn" validate:"required"` + + // list of broker endpoints. + Brokers []string `json:"brokers" validate:"required"` + + // The messsage hub topic defined in the event streams instance. + Topic *string `json:"topic" validate:"required"` + + // The messsage hub topic's user password specified in the event streams instance (the apikey). + Password *string `json:"password" validate:"required"` +} + +// NewEventstreamsEndpointPrototype : Instantiate EventstreamsEndpointPrototype (Generic Model Constructor) +func (*AtrackerV2) NewEventstreamsEndpointPrototype(targetCRN string, brokers []string, topic string, password string) (_model *EventstreamsEndpointPrototype, err error) { + _model = &EventstreamsEndpointPrototype{ + TargetCRN: core.StringPtr(targetCRN), + Brokers: brokers, + Topic: core.StringPtr(topic), + Password: core.StringPtr(password), + } + err = core.ValidateStruct(_model, "required parameters") + return +} + +// UnmarshalEventstreamsEndpointPrototype unmarshals an instance of EventstreamsEndpointPrototype from the specified map of raw messages. +func UnmarshalEventstreamsEndpointPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EventstreamsEndpointPrototype) + err = core.UnmarshalPrimitive(m, "target_crn", &obj.TargetCRN) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "brokers", &obj.Brokers) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "topic", &obj.Topic) + if err != nil { + return + } + err = core.UnmarshalPrimitive(m, "password", &obj.Password) + if err != nil { + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // GetMigrationOptions : The GetMigration options. type GetMigrationOptions struct { @@ -1824,6 +1928,9 @@ type ReplaceTargetOptions struct { // Property values for a LogDNA Endpoint in requests. LogdnaEndpoint *LogdnaEndpointPrototype `json:"logdna_endpoint,omitempty"` + // Property values for a Event Streams Endpoint in requests. + EventstreamsEndpoint *EventstreamsEndpointPrototype `json:"eventstreams_endpoint,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -1859,6 +1966,12 @@ func (_options *ReplaceTargetOptions) SetLogdnaEndpoint(logdnaEndpoint *LogdnaEn return _options } +// SetEventstreamsEndpoint : Allow user to set EventstreamsEndpoint +func (_options *ReplaceTargetOptions) SetEventstreamsEndpoint(eventstreamsEndpoint *EventstreamsEndpointPrototype) *ReplaceTargetOptions { + _options.EventstreamsEndpoint = eventstreamsEndpoint + return _options +} + // SetHeaders : Allow user to set Headers func (options *ReplaceTargetOptions) SetHeaders(param map[string]string) *ReplaceTargetOptions { options.Headers = param @@ -2095,6 +2208,9 @@ type Target struct { // Property values for a LogDNA Endpoint in responses. LogdnaEndpoint *LogdnaEndpoint `json:"logdna_endpoint,omitempty"` + // Property values for a Event Streams Endpoint in responses. + EventstreamsEndpoint *EventstreamsEndpoint `json:"eventstreams_endpoint,omitempty"` + // The status of the write attempt to the target with the provided endpoint parameters. WriteStatus *WriteStatus `json:"write_status" validate:"required"` @@ -2149,6 +2265,10 @@ func UnmarshalTarget(m map[string]json.RawMessage, result interface{}) (err erro if err != nil { return } + err = core.UnmarshalModel(m, "eventstreams_endpoint", &obj.EventstreamsEndpoint, UnmarshalEventstreamsEndpoint) + if err != nil { + return + } err = core.UnmarshalModel(m, "write_status", &obj.WriteStatus, UnmarshalWriteStatus) if err != nil { return diff --git a/atrackerv2/atracker_v2_integration_test.go b/atrackerv2/atracker_v2_integration_test.go index 9a27cae1..4431d351 100644 --- a/atrackerv2/atracker_v2_integration_test.go +++ b/atrackerv2/atracker_v2_integration_test.go @@ -61,6 +61,7 @@ var _ = Describe(`AtrackerV2 Integration Tests`, func() { routeIDLink string targetIDLink string targetIDLink2 string + targetIDLink3 string ) var shouldSkipTest = func() { @@ -174,6 +175,31 @@ var _ = Describe(`AtrackerV2 Integration Tests`, func() { fmt.Fprintf(GinkgoWriter, "Saved logdna targetIDLink value: %v\n", targetIDLink) }) + It(`CreateTarget(createTargetOptions *CreateTargetOptions)`, func() { + + eventstreamsEndpointPrototypeModel := &atrackerv2.EventstreamsEndpointPrototype{ + TargetCRN: core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"), + Topic: core.StringPtr("my-test-topic"), + Brokers: []string{"kafka-x:9094"}, + Password: core.StringPtr("xxxxxxxxxxx"), + } + + createTargetOptions := &atrackerv2.CreateTargetOptions{ + Name: core.StringPtr("my-ies-target"), + TargetType: core.StringPtr("event_streams"), + EventstreamsEndpoint: eventstreamsEndpointPrototypeModel, + } + + target, response, err := atrackerService.CreateTarget(createTargetOptions) + + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(201)) + Expect(target).ToNot(BeNil()) + + targetIDLink3 = *target.ID + fmt.Fprintf(GinkgoWriter, "Saved event streams targetIDLink value: %v\n", targetIDLink) + }) + It(`Returns 400 when backend input validation fails`, func() { cosEndpointPrototypeModel := &atrackerv2.CosEndpointPrototype{ Endpoint: core.StringPtr("s3.private.us-east.cloud-object-storage.appdomain.cloud"), @@ -391,6 +417,28 @@ var _ = Describe(`AtrackerV2 Integration Tests`, func() { Expect(target).ToNot(BeNil()) }) + It(`ReplaceTarget(replaceTargetOptions *ReplaceTargetOptions) for event streams type of target`, func() { + + eventstreamsEndpointPrototypeModel := &atrackerv2.EventstreamsEndpointPrototype{ + TargetCRN: core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"), + Topic: core.StringPtr("my-test-topic"), + Brokers: []string{"kafka-x:9094"}, + Password: core.StringPtr("xxxxxxxxxxxxx"), + } + + replaceTargetOptions := &atrackerv2.ReplaceTargetOptions{ + ID: &targetIDLink3, + Name: core.StringPtr("my-ies-target-modified"), + EventstreamsEndpoint: eventstreamsEndpointPrototypeModel, + } + + target, response, err := atrackerService.ReplaceTarget(replaceTargetOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + Expect(target).ToNot(BeNil()) + }) + + It(`Returns 404 when target id is not found`, func() { cosEndpointPrototypeModel := &atrackerv2.CosEndpointPrototype{ @@ -801,6 +849,16 @@ var _ = Describe(`AtrackerV2 Integration Tests`, func() { ID: &targetIDLink2, } + _, response, err := atrackerService.DeleteTarget(deleteTargetOptions) + Expect(err).To(BeNil()) + Expect(response.StatusCode).To(Equal(200)) + }) + It(`DeleteTarget(deleteTargetOptions *DeleteTargetOptions)`, func() { + + deleteTargetOptions := &atrackerv2.DeleteTargetOptions{ + ID: &targetIDLink3, + } + _, response, err := atrackerService.DeleteTarget(deleteTargetOptions) Expect(err).To(BeNil()) Expect(response.StatusCode).To(Equal(200)) diff --git a/atrackerv2/atracker_v2_test.go b/atrackerv2/atracker_v2_test.go index 68a0d5c5..bf0295b9 100644 --- a/atrackerv2/atracker_v2_test.go +++ b/atrackerv2/atracker_v2_test.go @@ -66,13 +66,14 @@ var _ = Describe(`AtrackerV2`, func() { Context(`Using external config, construct service client instances`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "ATRACKER_URL": "https://atrackerv2/api", + "ATRACKER_URL": "https://atrackerv2/api", "ATRACKER_AUTH_TYPE": "noauth", } It(`Create service client using external config successfully`, func() { SetTestEnvironment(testEnvironment) - atrackerService, serviceErr := atrackerv2.NewAtrackerV2UsingExternalConfig(&atrackerv2.AtrackerV2Options{}) + atrackerService, serviceErr := atrackerv2.NewAtrackerV2UsingExternalConfig(&atrackerv2.AtrackerV2Options{ + }) Expect(atrackerService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) @@ -101,7 +102,8 @@ var _ = Describe(`AtrackerV2`, func() { }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) - atrackerService, serviceErr := atrackerv2.NewAtrackerV2UsingExternalConfig(&atrackerv2.AtrackerV2Options{}) + atrackerService, serviceErr := atrackerv2.NewAtrackerV2UsingExternalConfig(&atrackerv2.AtrackerV2Options{ + }) err := atrackerService.SetServiceURL("https://testService/api") Expect(err).To(BeNil()) Expect(atrackerService).ToNot(BeNil()) @@ -119,12 +121,13 @@ var _ = Describe(`AtrackerV2`, 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{ - "ATRACKER_URL": "https://atrackerv2/api", + "ATRACKER_URL": "https://atrackerv2/api", "ATRACKER_AUTH_TYPE": "someOtherAuth", } SetTestEnvironment(testEnvironment) - atrackerService, serviceErr := atrackerv2.NewAtrackerV2UsingExternalConfig(&atrackerv2.AtrackerV2Options{}) + atrackerService, serviceErr := atrackerv2.NewAtrackerV2UsingExternalConfig(&atrackerv2.AtrackerV2Options{ + }) It(`Instantiate service client with error`, func() { Expect(atrackerService).To(BeNil()) @@ -135,7 +138,7 @@ var _ = Describe(`AtrackerV2`, 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{ - "ATRACKER_AUTH_TYPE": "NOAuth", + "ATRACKER_AUTH_TYPE": "NOAuth", } SetTestEnvironment(testEnvironment) @@ -236,12 +239,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the CreateTargetOptions model createTargetOptionsModel := new(atrackerv2.CreateTargetOptions) createTargetOptionsModel.Name = core.StringPtr("my-cos-target") createTargetOptionsModel.TargetType = core.StringPtr("cloud_object_storage") createTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel createTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + createTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel createTargetOptionsModel.Region = core.StringPtr("us-south") createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response @@ -295,7 +306,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke CreateTarget successfully with retries`, func() { @@ -320,12 +331,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the CreateTargetOptions model createTargetOptionsModel := new(atrackerv2.CreateTargetOptions) createTargetOptionsModel.Name = core.StringPtr("my-cos-target") createTargetOptionsModel.TargetType = core.StringPtr("cloud_object_storage") createTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel createTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + createTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel createTargetOptionsModel.Region = core.StringPtr("us-south") createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -382,7 +401,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke CreateTarget successfully`, func() { @@ -412,12 +431,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the CreateTargetOptions model createTargetOptionsModel := new(atrackerv2.CreateTargetOptions) createTargetOptionsModel.Name = core.StringPtr("my-cos-target") createTargetOptionsModel.TargetType = core.StringPtr("cloud_object_storage") createTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel createTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + createTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel createTargetOptionsModel.Region = core.StringPtr("us-south") createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -449,12 +476,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the CreateTargetOptions model createTargetOptionsModel := new(atrackerv2.CreateTargetOptions) createTargetOptionsModel.Name = core.StringPtr("my-cos-target") createTargetOptionsModel.TargetType = core.StringPtr("cloud_object_storage") createTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel createTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + createTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel createTargetOptionsModel.Region = core.StringPtr("us-south") createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) @@ -507,12 +542,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the CreateTargetOptions model createTargetOptionsModel := new(atrackerv2.CreateTargetOptions) createTargetOptionsModel.Name = core.StringPtr("my-cos-target") createTargetOptionsModel.TargetType = core.StringPtr("cloud_object_storage") createTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel createTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + createTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel createTargetOptionsModel.Region = core.StringPtr("us-south") createTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -593,7 +636,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}]}`) + fmt.Fprintf(res, "%s", `{"targets": [{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}]}`) })) }) It(`Invoke ListTargets successfully with retries`, func() { @@ -648,7 +691,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}]}`) + fmt.Fprintf(res, "%s", `{"targets": [{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}]}`) })) }) It(`Invoke ListTargets successfully`, func() { @@ -799,7 +842,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke GetTarget successfully with retries`, func() { @@ -853,7 +896,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke GetTarget successfully`, func() { @@ -985,12 +1028,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the ReplaceTargetOptions model replaceTargetOptionsModel := new(atrackerv2.ReplaceTargetOptions) replaceTargetOptionsModel.ID = core.StringPtr("testString") replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target") replaceTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel replaceTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + replaceTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := atrackerService.ReplaceTarget(replaceTargetOptionsModel) @@ -1043,7 +1094,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke ReplaceTarget successfully with retries`, func() { @@ -1068,12 +1119,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the ReplaceTargetOptions model replaceTargetOptionsModel := new(atrackerv2.ReplaceTargetOptions) replaceTargetOptionsModel.ID = core.StringPtr("testString") replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target") replaceTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel replaceTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + replaceTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -1129,7 +1188,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke ReplaceTarget successfully`, func() { @@ -1159,12 +1218,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the ReplaceTargetOptions model replaceTargetOptionsModel := new(atrackerv2.ReplaceTargetOptions) replaceTargetOptionsModel.ID = core.StringPtr("testString") replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target") replaceTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel replaceTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + replaceTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -1195,12 +1262,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the ReplaceTargetOptions model replaceTargetOptionsModel := new(atrackerv2.ReplaceTargetOptions) replaceTargetOptionsModel.ID = core.StringPtr("testString") replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target") replaceTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel replaceTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + replaceTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := atrackerService.SetServiceURL("") @@ -1252,12 +1327,20 @@ var _ = Describe(`AtrackerV2`, func() { logdnaEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") logdnaEndpointPrototypeModel.IngestionKey = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + // Construct an instance of the ReplaceTargetOptions model replaceTargetOptionsModel := new(atrackerv2.ReplaceTargetOptions) replaceTargetOptionsModel.ID = core.StringPtr("testString") replaceTargetOptionsModel.Name = core.StringPtr("my-cos-target") replaceTargetOptionsModel.CosEndpoint = cosEndpointPrototypeModel replaceTargetOptionsModel.LogdnaEndpoint = logdnaEndpointPrototypeModel + replaceTargetOptionsModel.EventstreamsEndpoint = eventstreamsEndpointPrototypeModel replaceTargetOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -1547,7 +1630,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke ValidateTarget successfully with retries`, func() { @@ -1601,7 +1684,7 @@ var _ = Describe(`AtrackerV2`, 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", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) + fmt.Fprintf(res, "%s", `{"id": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6", "name": "a-cos-target-us-south", "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", "region": "us-south", "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", "service_to_service_enabled": true}, "logdna_endpoint": {"target_crn": "crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"}, "eventstreams_endpoint": {"target_crn": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::", "brokers": ["kafka-x:9094"], "topic": "my-topic", "password": "xxxxxxxxxxxxxx"}, "write_status": {"status": "success", "last_failure": "2021-05-18T20:15:12.353Z", "reason_for_last_failure": "Provided API key could not be found"}, "created_at": "2021-05-18T20:15:12.353Z", "updated_at": "2021-05-18T20:15:12.353Z", "message": "This is a valid target. However, there is another target already defined with the same target endpoint.", "api_version": 2}`) })) }) It(`Invoke ValidateTarget successfully`, func() { @@ -3652,6 +3735,18 @@ var _ = Describe(`AtrackerV2`, func() { Expect(logdnaEndpointPrototypeModel.TargetCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"))) Expect(logdnaEndpointPrototypeModel.IngestionKey).To(Equal(core.StringPtr("xxxxxxxxxxxxxx"))) + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + Expect(eventstreamsEndpointPrototypeModel).ToNot(BeNil()) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + Expect(eventstreamsEndpointPrototypeModel.TargetCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"))) + Expect(eventstreamsEndpointPrototypeModel.Brokers).To(Equal([]string{"kafka-x:9094"})) + Expect(eventstreamsEndpointPrototypeModel.Topic).To(Equal(core.StringPtr("my-topic"))) + Expect(eventstreamsEndpointPrototypeModel.Password).To(Equal(core.StringPtr("xxxxxxxxxxxxxx"))) + // Construct an instance of the CreateTargetOptions model createTargetOptionsName := "my-cos-target" createTargetOptionsTargetType := "cloud_object_storage" @@ -3660,6 +3755,7 @@ var _ = Describe(`AtrackerV2`, func() { createTargetOptionsModel.SetTargetType("cloud_object_storage") createTargetOptionsModel.SetCosEndpoint(cosEndpointPrototypeModel) createTargetOptionsModel.SetLogdnaEndpoint(logdnaEndpointPrototypeModel) + createTargetOptionsModel.SetEventstreamsEndpoint(eventstreamsEndpointPrototypeModel) createTargetOptionsModel.SetRegion("us-south") createTargetOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createTargetOptionsModel).ToNot(BeNil()) @@ -3667,6 +3763,7 @@ var _ = Describe(`AtrackerV2`, func() { Expect(createTargetOptionsModel.TargetType).To(Equal(core.StringPtr("cloud_object_storage"))) Expect(createTargetOptionsModel.CosEndpoint).To(Equal(cosEndpointPrototypeModel)) Expect(createTargetOptionsModel.LogdnaEndpoint).To(Equal(logdnaEndpointPrototypeModel)) + Expect(createTargetOptionsModel.EventstreamsEndpoint).To(Equal(eventstreamsEndpointPrototypeModel)) Expect(createTargetOptionsModel.Region).To(Equal(core.StringPtr("us-south"))) Expect(createTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) @@ -3690,6 +3787,15 @@ var _ = Describe(`AtrackerV2`, func() { Expect(deleteTargetOptionsModel.ID).To(Equal(core.StringPtr("testString"))) Expect(deleteTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) + It(`Invoke NewEventstreamsEndpointPrototype successfully`, func() { + targetCRN := "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::" + brokers := []string{"kafka-x:9094"} + topic := "my-topic" + password := "xxxxxxxxxxxxxx" + _model, err := atrackerService.NewEventstreamsEndpointPrototype(targetCRN, brokers, topic, password) + Expect(_model).ToNot(BeNil()) + Expect(err).To(BeNil()) + }) It(`Invoke NewGetMigrationOptions successfully`, func() { // Construct an instance of the GetMigrationOptions model getMigrationOptionsModel := atrackerService.NewGetMigrationOptions() @@ -3820,6 +3926,18 @@ var _ = Describe(`AtrackerV2`, func() { Expect(logdnaEndpointPrototypeModel.TargetCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:logdna:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"))) Expect(logdnaEndpointPrototypeModel.IngestionKey).To(Equal(core.StringPtr("xxxxxxxxxxxxxx"))) + // Construct an instance of the EventstreamsEndpointPrototype model + eventstreamsEndpointPrototypeModel := new(atrackerv2.EventstreamsEndpointPrototype) + Expect(eventstreamsEndpointPrototypeModel).ToNot(BeNil()) + eventstreamsEndpointPrototypeModel.TargetCRN = core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::") + eventstreamsEndpointPrototypeModel.Brokers = []string{"kafka-x:9094"} + eventstreamsEndpointPrototypeModel.Topic = core.StringPtr("my-topic") + eventstreamsEndpointPrototypeModel.Password = core.StringPtr("xxxxxxxxxxxxxx") + Expect(eventstreamsEndpointPrototypeModel.TargetCRN).To(Equal(core.StringPtr("crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"))) + Expect(eventstreamsEndpointPrototypeModel.Brokers).To(Equal([]string{"kafka-x:9094"})) + Expect(eventstreamsEndpointPrototypeModel.Topic).To(Equal(core.StringPtr("my-topic"))) + Expect(eventstreamsEndpointPrototypeModel.Password).To(Equal(core.StringPtr("xxxxxxxxxxxxxx"))) + // Construct an instance of the ReplaceTargetOptions model id := "testString" replaceTargetOptionsModel := atrackerService.NewReplaceTargetOptions(id) @@ -3827,12 +3945,14 @@ var _ = Describe(`AtrackerV2`, func() { replaceTargetOptionsModel.SetName("my-cos-target") replaceTargetOptionsModel.SetCosEndpoint(cosEndpointPrototypeModel) replaceTargetOptionsModel.SetLogdnaEndpoint(logdnaEndpointPrototypeModel) + replaceTargetOptionsModel.SetEventstreamsEndpoint(eventstreamsEndpointPrototypeModel) 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.CosEndpoint).To(Equal(cosEndpointPrototypeModel)) Expect(replaceTargetOptionsModel.LogdnaEndpoint).To(Equal(logdnaEndpointPrototypeModel)) + Expect(replaceTargetOptionsModel.EventstreamsEndpoint).To(Equal(eventstreamsEndpointPrototypeModel)) Expect(replaceTargetOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewRulePrototype successfully`, func() {