google-cloud-pubsub 1.9.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +53 -0
  4. data/OVERVIEW.md +26 -58
  5. data/lib/google-cloud-pubsub.rb +14 -13
  6. data/lib/google/cloud/pubsub.rb +15 -18
  7. data/lib/google/cloud/pubsub/async_publisher.rb +2 -3
  8. data/lib/google/cloud/pubsub/credentials.rb +2 -2
  9. data/lib/google/cloud/pubsub/message.rb +1 -1
  10. data/lib/google/cloud/pubsub/project.rb +1 -1
  11. data/lib/google/cloud/pubsub/received_message.rb +4 -4
  12. data/lib/google/cloud/pubsub/service.rb +110 -257
  13. data/lib/google/cloud/pubsub/subscriber.rb +3 -3
  14. data/lib/google/cloud/pubsub/subscriber/stream.rb +1 -2
  15. data/lib/google/cloud/pubsub/subscription.rb +124 -22
  16. data/lib/google/cloud/pubsub/subscription/push_config.rb +55 -31
  17. data/lib/google/cloud/pubsub/topic.rb +50 -15
  18. data/lib/google/cloud/pubsub/version.rb +1 -1
  19. metadata +8 -79
  20. data/lib/google/cloud/pubsub/v1.rb +0 -17
  21. data/lib/google/cloud/pubsub/v1/credentials.rb +0 -41
  22. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/iam_policy.rb +0 -21
  23. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/options.rb +0 -21
  24. data/lib/google/cloud/pubsub/v1/doc/google/iam/v1/policy.rb +0 -21
  25. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/duration.rb +0 -91
  26. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/empty.rb +0 -29
  27. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/field_mask.rb +0 -222
  28. data/lib/google/cloud/pubsub/v1/doc/google/protobuf/timestamp.rb +0 -113
  29. data/lib/google/cloud/pubsub/v1/doc/google/pubsub/v1/pubsub.rb +0 -833
  30. data/lib/google/cloud/pubsub/v1/doc/google/type/expr.rb +0 -19
  31. data/lib/google/cloud/pubsub/v1/publisher_client.rb +0 -928
  32. data/lib/google/cloud/pubsub/v1/publisher_client_config.json +0 -120
  33. data/lib/google/cloud/pubsub/v1/subscriber_client.rb +0 -1466
  34. data/lib/google/cloud/pubsub/v1/subscriber_client_config.json +0 -153
  35. data/lib/google/pubsub/v1/pubsub_pb.rb +0 -269
  36. data/lib/google/pubsub/v1/pubsub_services_pb.rb +0 -215
@@ -41,7 +41,7 @@ module Google
41
41
  # subscriber.start
42
42
  #
43
43
  # # Shut down the subscriber when ready to stop receiving messages.
44
- # subscriber.stop.wait!
44
+ # subscriber.stop!
45
45
  #
46
46
  # @attr_reader [String] subscription_name The name of the subscription the
47
47
  # messages are pulled from.
@@ -240,7 +240,7 @@ module Google
240
240
  # subscriber.start
241
241
  #
242
242
  # # Shut down the subscriber when ready to stop receiving messages.
243
- # subscriber.stop.wait!
243
+ # subscriber.stop!
244
244
  #
245
245
  def on_error &block
246
246
  synchronize do
@@ -276,7 +276,7 @@ module Google
276
276
  # subscriber.last_error #=> nil
277
277
  #
278
278
  # # Shut down the subscriber when ready to stop receiving messages.
279
- # subscriber.stop.wait!
279
+ # subscriber.stop!
280
280
  #
281
281
  def last_error
282
282
  synchronize { @last_error }
@@ -271,9 +271,8 @@ module Google
271
271
  stop
272
272
  rescue GRPC::Cancelled, GRPC::DeadlineExceeded, GRPC::Internal,
273
273
  GRPC::ResourceExhausted, GRPC::Unauthenticated,
274
- GRPC::Unavailable, GRPC::Core::CallError
274
+ GRPC::Unavailable
275
275
  # Restart the stream with an incremental back for a retriable error.
276
- # Also when GRPC raises the internal CallError.
277
276
 
278
277
  retry
279
278
  rescue RestartStream
@@ -43,12 +43,19 @@ module Google
43
43
  # received_message.acknowledge!
44
44
  # end
45
45
  #
46
- # # Start background threads that will call the block passed to listen.
47
- # subscriber.start
46
+ # # Handle exceptions from listener
47
+ # subscriber.on_error do |exception|
48
+ # puts "Exception: #{exception.class} #{exception.message}"
49
+ # end
48
50
  #
49
- # # Shut down the subscriber when ready to stop receiving messages.
50
- # subscriber.stop.wait!
51
+ # # Gracefully shut down the subscriber
52
+ # at_exit do
53
+ # subscriber.stop!
54
+ # end
51
55
  #
56
+ # # Start background threads that will call the block passed to listen.
57
+ # subscriber.start
58
+ # sleep
52
59
  class Subscription
53
60
  ##
54
61
  # @private The Service object.
@@ -323,7 +330,7 @@ module Google
323
330
  # If {#expires_in=} is not set, a *default* value of of 31 days will be
324
331
  # used. The minimum allowed value is 1 day.
325
332
  #
326
- # Makes an API call to retrieve the labels value when called on a
333
+ # Makes an API call to retrieve the value when called on a
327
334
  # reference object. See {#reference?}.
328
335
  #
329
336
  # @return [Numeric, nil] The expiration duration, or `nil` if unset.
@@ -346,7 +353,7 @@ module Google
346
353
  # to unset.
347
354
  #
348
355
  def expires_in= ttl
349
- new_expiration_policy = Google::Pubsub::V1::ExpirationPolicy.new ttl: Convert.number_to_duration(ttl)
356
+ new_expiration_policy = Google::Cloud::PubSub::V1::ExpirationPolicy.new ttl: Convert.number_to_duration(ttl)
350
357
 
351
358
  update_grpc = Google::Cloud::PubSub::V1::Subscription.new name: name, expiration_policy: new_expiration_policy
352
359
  @grpc = service.update_subscription update_grpc, :expiration_policy
@@ -370,8 +377,8 @@ module Google
370
377
  # otherwise `nil`. Dead lettering is done on a best effort basis. The same message might be dead lettered
371
378
  # multiple times.
372
379
  #
373
- # See also {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts=} and
374
- # {#dead_letter_max_delivery_attempts}.
380
+ # See also {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts=}, {#dead_letter_max_delivery_attempts}
381
+ # and {#remove_dead_letter_policy}.
375
382
  #
376
383
  # Makes an API call to retrieve the topic name when called on a reference object. See {#reference?}.
377
384
  #
@@ -402,7 +409,8 @@ module Google
402
409
  # The operation will fail if the topic does not exist. Users should ensure that there is a subscription attached
403
410
  # to this topic since messages published to a topic with no subscriptions are lost.
404
411
  #
405
- # See also {#dead_letter_topic}, {#dead_letter_max_delivery_attempts=} and {#dead_letter_max_delivery_attempts}.
412
+ # See also {#dead_letter_topic}, {#dead_letter_max_delivery_attempts=}, {#dead_letter_max_delivery_attempts}
413
+ # and {#remove_dead_letter_policy}.
406
414
  #
407
415
  # @param [Topic] new_dead_letter_topic The topic to which dead letter messages for the subscription should be
408
416
  # published.
@@ -434,14 +442,15 @@ module Google
434
442
  # acknowledgement deadline has been exceeded for the message). A NACK is any call to ModifyAckDeadline with a 0
435
443
  # deadline. Note that client libraries may automatically extend ack_deadlines.
436
444
  #
437
- # This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used.
445
+ # This field will be honored on a best effort basis. If this parameter is `nil` or `0`, a default value of `5`
446
+ # is used.
438
447
  #
439
- # See also {#dead_letter_max_delivery_attempts=}, {#dead_letter_topic=} and {#dead_letter_topic}.
448
+ # See also {#dead_letter_max_delivery_attempts=}, {#dead_letter_topic=}, {#dead_letter_topic}
449
+ # and {#remove_dead_letter_policy}.
440
450
  #
441
451
  # Makes an API call to retrieve the value when called on a reference object. See {#reference?}.
442
452
  #
443
- # @return [Integer, nil] A value between 5 and 100, or `nil` if no dead letter policy is configured. If this
444
- # value is 0, a default value of 5 is used.
453
+ # @return [Integer, nil] A value between `5` and `100`, or `nil` if no dead letter policy is configured.
445
454
  #
446
455
  # @example
447
456
  # require "google/cloud/pubsub"
@@ -468,10 +477,13 @@ module Google
468
477
  #
469
478
  # This field will be honored on a best effort basis. If this parameter is 0, a default value of 5 is used.
470
479
  #
471
- # The dead letter topic must also be set. See {#dead_letter_topic=} and {#dead_letter_topic}.
480
+ # The dead letter topic must be set first. See {#dead_letter_topic=}, {#dead_letter_topic} and
481
+ # {#remove_dead_letter_policy}.
472
482
  #
473
- # @param [Integer] new_dead_letter_max_delivery_attempts A value between 5 and 100. If this parameter is 0, a
474
- # default value of 5 is used.
483
+ # @param [Integer, nil] new_dead_letter_max_delivery_attempts A value between 5 and 100. If this parameter is
484
+ # `nil` or `0`, a default value of 5 is used.
485
+ #
486
+ # @raise [ArgumentError] if the dead letter topic has not been set. See {#dead_letter_topic=}.
475
487
  #
476
488
  # @example
477
489
  # require "google/cloud/pubsub"
@@ -496,6 +508,39 @@ module Google
496
508
  @resource_name = nil
497
509
  end
498
510
 
511
+ ##
512
+ # Removes an existing dead letter policy. A dead letter policy specifies the conditions for dead lettering
513
+ # messages in the subscription. If a dead letter policy is not set, dead lettering is disabled.
514
+ #
515
+ # See {#dead_letter_topic}, {#dead_letter_topic=}, {#dead_letter_max_delivery_attempts} and
516
+ # {#dead_letter_max_delivery_attempts=}.
517
+ #
518
+ # @return [Boolean] `true` if an existing dead letter policy was removed, `false` if no existing dead letter
519
+ # policy was present.
520
+ #
521
+ # @example
522
+ # require "google/cloud/pubsub"
523
+ #
524
+ # pubsub = Google::Cloud::PubSub.new
525
+ #
526
+ # sub = pubsub.subscription "my-topic-sub"
527
+ #
528
+ # sub.dead_letter_topic.name #=> "projects/my-project/topics/my-dead-letter-topic"
529
+ # sub.dead_letter_max_delivery_attempts #=> 10
530
+ #
531
+ # sub.remove_dead_letter_policy
532
+ #
533
+ # sub.dead_letter_topic #=> nil
534
+ # sub.dead_letter_max_delivery_attempts #=> nil
535
+ #
536
+ def remove_dead_letter_policy
537
+ ensure_grpc!
538
+ return false if @grpc.dead_letter_policy.nil?
539
+ update_grpc = Google::Cloud::PubSub::V1::Subscription.new name: name, dead_letter_policy: nil
540
+ @grpc = service.update_subscription update_grpc, :dead_letter_policy
541
+ true
542
+ end
543
+
499
544
  ##
500
545
  # A policy that specifies how Cloud Pub/Sub retries message delivery for this subscription. If `nil`, the
501
546
  # default retry policy is applied. This generally implies that messages will be retried as soon as possible
@@ -566,7 +611,7 @@ module Google
566
611
  #
567
612
  # See {Topic#publish_async}, {#listen}, and {Message#ordering_key}.
568
613
  #
569
- # Makes an API call to retrieve the retain_acked value when called on a
614
+ # Makes an API call to retrieve the enable_message_ordering value when called on a
570
615
  # reference object. See {#reference?}.
571
616
  #
572
617
  # @return [Boolean]
@@ -576,6 +621,35 @@ module Google
576
621
  @grpc.enable_message_ordering
577
622
  end
578
623
 
624
+ ##
625
+ # Whether the subscription is detached from its topic. Detached subscriptions don't receive messages from their
626
+ # topic and don't retain any backlog. {#pull} and {#listen} (pull and streaming pull) operations will raise
627
+ # `FAILED_PRECONDITION`. If the subscription is a push subscription (see {#push_config}), pushes to the endpoint
628
+ # will not be made. The default value is `false`.
629
+ #
630
+ # See {Topic#subscribe} and {#detach}.
631
+ #
632
+ # Makes an API call to retrieve the value when called on a
633
+ # reference object. See {#reference?}.
634
+ #
635
+ # @return [Boolean]
636
+ #
637
+ # @example
638
+ # require "google/cloud/pubsub"
639
+ #
640
+ # pubsub = Google::Cloud::PubSub.new
641
+ #
642
+ # sub = pubsub.subscription "my-topic-sub"
643
+ # sub.detach
644
+ #
645
+ # # sleep 120
646
+ # sub.detached? #=> true
647
+ #
648
+ def detached?
649
+ ensure_grpc!
650
+ @grpc.detached
651
+ end
652
+
579
653
  ##
580
654
  # Determines whether the subscription exists in the Pub/Sub service.
581
655
  #
@@ -623,6 +697,32 @@ module Google
623
697
  true
624
698
  end
625
699
 
700
+ ##
701
+ # Detaches a subscription from its topic. All messages retained in the subscription are dropped. Detached
702
+ # subscriptions don't receive messages from their topic and don't retain any backlog. Subsequent {#pull} and
703
+ # {#listen} (pull and streaming pull) operations will raise `FAILED_PRECONDITION`. If the subscription is a push
704
+ # subscription (see {#push_config}), pushes to the endpoint will stop. It may take a few minutes for the
705
+ # subscription's detached state to be reflected in subsequent calls to {#detached?}.
706
+ #
707
+ # @return [Boolean] Returns `true` if the detach operation was successful.
708
+ #
709
+ # @example
710
+ # require "google/cloud/pubsub"
711
+ #
712
+ # pubsub = Google::Cloud::PubSub.new
713
+ #
714
+ # sub = pubsub.subscription "my-topic-sub"
715
+ # sub.detach
716
+ #
717
+ # # sleep 120
718
+ # sub.detached? #=> true
719
+ #
720
+ def detach
721
+ ensure_service!
722
+ service.detach_subscription name
723
+ true
724
+ end
725
+
626
726
  ##
627
727
  # Pulls messages from the server. Returns an empty list if there are no
628
728
  # messages available in the backlog. Raises an ApiError with status
@@ -761,7 +861,8 @@ module Google
761
861
  # @param [Integer] streams The number of concurrent streams to open to
762
862
  # pull messages from the subscription. Default is 4. Optional.
763
863
  # @param [Hash, Integer] inventory The settings to control how received messages are to be handled by the
764
- # subscriber. When provided as an Integer instead of a Hash only the `limit` will be set. Optional.
864
+ # subscriber. When provided as an Integer instead of a Hash only `max_outstanding_messages` will be set.
865
+ # Optional.
765
866
  #
766
867
  # Hash keys and values may include the following:
767
868
  #
@@ -801,6 +902,7 @@ module Google
801
902
  #
802
903
  # subscriber = sub.listen do |received_message|
803
904
  # # process message
905
+ # puts "Data: #{received_message.message.data}, published at #{received_message.message.published_at}"
804
906
  # received_message.acknowledge!
805
907
  # end
806
908
  #
@@ -808,7 +910,7 @@ module Google
808
910
  # subscriber.start
809
911
  #
810
912
  # # Shut down the subscriber when ready to stop receiving messages.
811
- # subscriber.stop.wait!
913
+ # subscriber.stop!
812
914
  #
813
915
  # @example Configuring to increase concurrent callbacks:
814
916
  # require "google/cloud/pubsub"
@@ -827,7 +929,7 @@ module Google
827
929
  # subscriber.start
828
930
  #
829
931
  # # Shut down the subscriber when ready to stop receiving messages.
830
- # subscriber.stop.wait!
932
+ # subscriber.stop!
831
933
  #
832
934
  # @example Ordered messages are supported using ordering_key:
833
935
  # require "google/cloud/pubsub"
@@ -847,7 +949,7 @@ module Google
847
949
  # subscriber.start
848
950
  #
849
951
  # # Shut down the subscriber when ready to stop receiving messages.
850
- # subscriber.stop.wait!
952
+ # subscriber.stop!
851
953
  #
852
954
  # @example Set the maximum amount of time before redelivery if the subscriber fails to extend the deadline:
853
955
  # require "google/cloud/pubsub"
@@ -866,7 +968,7 @@ module Google
866
968
  # subscriber.start
867
969
  #
868
970
  # # Shut down the subscriber when ready to stop receiving messages.
869
- # subscriber.stop.wait!
971
+ # subscriber.stop!
870
972
  #
871
973
  def listen deadline: nil, message_ordering: nil, streams: nil, inventory: nil, threads: {}, &block
872
974
  ensure_service!
@@ -22,7 +22,18 @@ module Google
22
22
  ##
23
23
  # Configuration for a push delivery endpoint.
24
24
  #
25
- # @example
25
+ # @example Create a push config:
26
+ # require "google/cloud/pubsub"
27
+ #
28
+ # pubsub = Google::Cloud::PubSub.new
29
+ # topic = pubsub.topic "my-topic"
30
+ #
31
+ # push_config = Google::Cloud::PubSub::Subscription::PushConfig.new endpoint: "http://example.net/callback"
32
+ # push_config.set_oidc_token "service-account@example.net", "audience-header-value"
33
+ #
34
+ # sub = topic.subscribe "my-subscription", push_config: push_config
35
+ #
36
+ # @example Read a push config:
26
37
  # require "google/cloud/pubsub"
27
38
  #
28
39
  # pubsub = Google::Cloud::PubSub.new
@@ -32,7 +43,7 @@ module Google
32
43
  # sub.push_config.authentication.email #=> "user@example.com"
33
44
  # sub.push_config.authentication.audience #=> "client-12345"
34
45
  #
35
- # @example Update the push configuration by passing a block:
46
+ # @example Update a push config:
36
47
  # require "google/cloud/pubsub"
37
48
  #
38
49
  # pubsub = Google::Cloud::PubSub.new
@@ -45,14 +56,31 @@ module Google
45
56
  #
46
57
  class PushConfig
47
58
  ##
48
- # @private
49
- def initialize
59
+ # Creates a new push configuration.
60
+ #
61
+ # @param [String] endpoint A URL locating the endpoint to which messages should be pushed. For
62
+ # example, a Webhook endpoint might use `https://example.com/push`.
63
+ # @param [String] email The service account email to be used for generating the OIDC token.
64
+ # The caller must have the `iam.serviceAccounts.actAs` permission for the service account.
65
+ # @param [String] audience The audience to be used when generating OIDC token. The audience claim identifies
66
+ # the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having
67
+ # multiple values (array) for the audience field is not supported. More info about the OIDC JWT token
68
+ # audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the `endpoint`
69
+ # URL will be used.
70
+ #
71
+ def initialize endpoint: nil, email: nil, audience: nil
50
72
  @grpc = Google::Cloud::PubSub::V1::PushConfig.new
73
+
74
+ self.endpoint = endpoint unless endpoint.nil?
75
+
76
+ raise ArgumentError, "audience provided without email. Authentication is invalid" if audience && !email
77
+
78
+ set_oidc_token email, audience if email
51
79
  end
52
80
 
53
81
  ##
54
- # A URL locating the endpoint to which messages should be pushed. For
55
- # example, a Webhook endpoint might use `https://example.com/push`.
82
+ # A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use
83
+ # `https://example.com/push`.
56
84
  #
57
85
  # @return [String]
58
86
  def endpoint
@@ -60,9 +88,8 @@ module Google
60
88
  end
61
89
 
62
90
  ##
63
- # Sets the URL locating the endpoint to which messages should be
64
- # pushed. For example, a Webhook endpoint might use
65
- # `https://example.com/push`.
91
+ # Sets the URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might
92
+ # use `https://example.com/push`.
66
93
  #
67
94
  # @param [String, nil] new_endpoint New URL value
68
95
  def endpoint= new_endpoint
@@ -70,8 +97,7 @@ module Google
70
97
  end
71
98
 
72
99
  ##
73
- # The authentication method used by push endpoints to verify the
74
- # source of push requests.
100
+ # The authentication method used by push endpoints to verify the source of push requests.
75
101
  #
76
102
  # @return [OidcToken, nil] An OIDC JWT token if specified, `nil`
77
103
  # otherwise.
@@ -82,8 +108,7 @@ module Google
82
108
  end
83
109
 
84
110
  ##
85
- # Sets the authentication method used by push endpoints to verify the
86
- # source of push requests.
111
+ # Sets the authentication method used by push endpoints to verify the source of push requests.
87
112
  #
88
113
  # @param [OidcToken, nil] new_auth An authentication value.
89
114
  def authentication= new_auth
@@ -118,13 +143,12 @@ module Google
118
143
  end
119
144
 
120
145
  ##
121
- # The format of the pushed message. This attribute indicates the
122
- # version of the data expected by the endpoint. This controls the
123
- # shape of the pushed message (i.e., its fields and metadata). The
124
- # endpoint version is based on the version of the Pub/Sub API.
146
+ # The format of the pushed message. This attribute indicates the version of the data expected by the endpoint.
147
+ # This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based
148
+ # on the version of the Pub/Sub API.
125
149
  #
126
- # If not present during the Subscription creation, it will default to
127
- # the version of the API used to make such call.
150
+ # If not present during the Subscription creation, it will default to the version of the API used to make such
151
+ # call.
128
152
  #
129
153
  # The possible values for this attribute are:
130
154
  #
@@ -182,7 +206,8 @@ module Google
182
206
  end
183
207
 
184
208
  ##
185
- # Service account email to be used for generating the OIDC token.
209
+ # The service account email to be used for generating the OIDC token. The caller must have the
210
+ # `iam.serviceAccounts.actAs` permission for the service account.
186
211
  #
187
212
  # @return [String]
188
213
  def email
@@ -190,7 +215,8 @@ module Google
190
215
  end
191
216
 
192
217
  ##
193
- # Service account email to be used for generating the OIDC token.
218
+ # Sets the service account email to be used for generating the OIDC token. The caller must have the
219
+ # `iam.serviceAccounts.actAs` permission for the service account.
194
220
  #
195
221
  # @param [String] new_email New service account email value.
196
222
  def email= new_email
@@ -198,15 +224,10 @@ module Google
198
224
  end
199
225
 
200
226
  ##
201
- # Audience to be used when generating OIDC token. The audience claim
202
- # identifies the recipients that the JWT is intended for. The
203
- # audience value is a single case-sensitive string.
204
- #
205
- # Having multiple values (array) for the audience field is not
206
- # supported.
207
- #
208
- # More info about the OIDC JWT token audience here:
209
- # https://tools.ietf.org/html/rfc7519#section-4.1.3
227
+ # The audience to be used when generating OIDC token. The audience claim identifies the recipients that
228
+ # the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values
229
+ # (array) for the audience field is not supported. More info about the OIDC JWT token audience here:
230
+ # https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the `endpoint` URL will be used.
210
231
  #
211
232
  # @return [String]
212
233
  def audience
@@ -214,7 +235,10 @@ module Google
214
235
  end
215
236
 
216
237
  ##
217
- # Sets the audience to be used when generating OIDC token.
238
+ # Sets the audience to be used when generating OIDC token. The audience claim identifies the recipients that
239
+ # the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values
240
+ # (array) for the audience field is not supported. More info about the OIDC JWT token audience here:
241
+ # https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the `endpoint` URL will be used.
218
242
  #
219
243
  # @param [String] new_audience New audience value.
220
244
  def audience= new_audience