@@ -30,15 +30,15 @@ const MAX_BYTES: u32 = 1e7 as u32; // 10MB
3030/// A `Publisher` sends messages to a specific topic. It manages message batching
3131/// and sending in a background task.
3232///
33- /// Publishers are created via a [`PublisherFactory `](crate::client::PublisherFactory ).
33+ /// Publishers are created via a [`Client `](crate::client::Client ).
3434///
3535/// ```
3636/// # async fn sample() -> anyhow::Result<()> {
3737/// # use google_cloud_pubsub::*;
38- /// # use client::PublisherFactory ;
38+ /// # use client::Client ;
3939/// # use model::PubsubMessage;
40- /// let factory = PublisherFactory ::builder().build().await?;
41- /// let publisher = factory .publisher("projects/my-project/topics/my-topic").build();
40+ /// let client = Client ::builder().build().await?;
41+ /// let publisher = client .publisher("projects/my-project/topics/my-topic").build();
4242/// let message_id = publisher.publish(PubsubMessage::new().set_data("Hello, World"));
4343/// # Ok(()) }
4444/// ```
@@ -122,17 +122,17 @@ impl Publisher {
122122
123123/// Creates `Publisher`s.
124124///
125- /// Publishers are created via a [`PublisherFactory `][crate::client::PublisherFactory ].
125+ /// Publishers are created via a [`Client `][crate::client::Client ].
126126///
127127/// # Example
128128///
129129/// ```
130130/// # async fn sample() -> anyhow::Result<()> {
131131/// # use google_cloud_pubsub::*;
132- /// # use builder::publisher::PublisherFactoryBuilder ;
133- /// # use client::PublisherFactory ;
134- /// let factory = PublisherFactory ::builder().build().await?;
135- /// let publisher = factory .publisher("projects/my-project/topics/topic").build();
132+ /// # use builder::publisher::ClientBuilder ;
133+ /// # use client::Client ;
134+ /// let client = Client ::builder().build().await?;
135+ /// let publisher = client .publisher("projects/my-project/topics/topic").build();
136136/// # Ok(()) }
137137/// ```
138138#[ derive( Clone , Debug ) ]
@@ -159,10 +159,10 @@ impl PublisherBuilder {
159159 ///
160160 /// # Example
161161 /// ```
162- /// # use google_cloud_pubsub::client::PublisherFactory ;
162+ /// # use google_cloud_pubsub::client::Client ;
163163 /// # async fn sample() -> anyhow::Result<()> {
164- /// # let factory = PublisherFactory ::builder().build().await?;
165- /// let publisher = factory .publisher("projects/my-project/topics/my-topic")
164+ /// # let client = Client ::builder().build().await?;
165+ /// let publisher = client .publisher("projects/my-project/topics/my-topic")
166166 /// .set_message_count_threshold(100)
167167 /// .build();
168168 /// # Ok(()) }
@@ -178,11 +178,11 @@ impl PublisherBuilder {
178178 ///
179179 /// # Example
180180 /// ```
181- /// # use google_cloud_pubsub::client::PublisherFactory ;
181+ /// # use google_cloud_pubsub::client::Client ;
182182 /// # use std::time::Duration;
183183 /// # async fn sample() -> anyhow::Result<()> {
184- /// # let factory = PublisherFactory ::builder().build().await?;
185- /// let publisher = factory .publisher("projects/my-project/topics/my-topic")
184+ /// # let client = Client ::builder().build().await?;
185+ /// let publisher = client .publisher("projects/my-project/topics/my-topic")
186186 /// .set_delay_threshold(Duration::from_millis(50))
187187 /// .build();
188188 /// # Ok(()) }
@@ -431,7 +431,7 @@ impl Batch {
431431#[ cfg( test) ]
432432mod tests {
433433 use super :: * ;
434- use crate :: { client:: PublisherFactory , publisher:: options:: BatchingOptions } ;
434+ use crate :: { client:: Client , publisher:: options:: BatchingOptions } ;
435435 use crate :: {
436436 generated:: gapic_dataplane:: client:: Publisher as GapicPublisher ,
437437 model:: { PublishResponse , PubsubMessage } ,
@@ -792,16 +792,16 @@ mod tests {
792792
793793 #[ tokio:: test]
794794 async fn builder ( ) -> anyhow:: Result < ( ) > {
795- let factory = PublisherFactory :: builder ( ) . build ( ) . await ?;
796- let builder = factory . publisher ( "projects/my-project/topics/my-topic" . to_string ( ) ) ;
795+ let client = Client :: builder ( ) . build ( ) . await ?;
796+ let builder = client . publisher ( "projects/my-project/topics/my-topic" . to_string ( ) ) ;
797797 let publisher = builder. set_message_count_threshold ( 1_u32 ) . build ( ) ;
798798 assert_eq ! ( publisher. batching_options. message_count_threshold, 1_u32 ) ;
799799 Ok ( ( ) )
800800 }
801801
802802 #[ tokio:: test]
803803 async fn default_batching ( ) -> anyhow:: Result < ( ) > {
804- let client = PublisherFactory :: builder ( ) . build ( ) . await ?;
804+ let client = Client :: builder ( ) . build ( ) . await ?;
805805 let publisher = client
806806 . publisher ( "projects/my-project/topics/my-topic" . to_string ( ) )
807807 . build ( ) ;
@@ -829,7 +829,7 @@ mod tests {
829829 . set_message_count_threshold ( MAX_MESSAGES + 1 )
830830 . set_byte_threshold ( MAX_BYTES + 1 ) ;
831831
832- let client = PublisherFactory :: builder ( ) . build ( ) . await ?;
832+ let client = Client :: builder ( ) . build ( ) . await ?;
833833 let publisher = client
834834 . publisher ( "projects/my-project/topics/my-topic" . to_string ( ) )
835835 . set_delay_threshold ( oversized_options. delay_threshold )
0 commit comments