#[non_exhaustive]pub struct ValidateMessageRequest {
pub parent: String,
pub message: Bytes,
pub encoding: Encoding,
pub schema_spec: Option<SchemaSpec>,
/* private fields */
}Expand description
Request for the ValidateMessage method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringRequired. The name of the project in which to validate schemas.
Format is projects/{project-id}.
message: BytesMessage to validate against the provided schema_spec.
encoding: EncodingThe encoding expected for messages
schema_spec: Option<SchemaSpec>Implementations§
Source§impl ValidateMessageRequest
impl ValidateMessageRequest
pub fn new() -> Self
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_message<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_message<T: Into<Bytes>>(self, v: T) -> Self
Sourcepub fn set_encoding<T: Into<Encoding>>(self, v: T) -> Self
pub fn set_encoding<T: Into<Encoding>>(self, v: T) -> Self
Sourcepub fn set_schema_spec<T: Into<Option<SchemaSpec>>>(self, v: T) -> Self
pub fn set_schema_spec<T: Into<Option<SchemaSpec>>>(self, v: T) -> Self
Sets the value of schema_spec.
Note that all the setters affecting schema_spec are mutually
exclusive.
§Example
use google_cloud_pubsub::model::validate_message_request::SchemaSpec;
let x = ValidateMessageRequest::new().set_schema_spec(Some(SchemaSpec::Name("example".to_string())));Sourcepub fn name(&self) -> Option<&String>
pub fn name(&self) -> Option<&String>
The value of schema_spec
if it holds a Name, None if the field is not set or
holds a different branch.
Sourcepub fn set_name<T: Into<String>>(self, v: T) -> Self
pub fn set_name<T: Into<String>>(self, v: T) -> Self
Sets the value of schema_spec
to hold a Name.
Note that all the setters affecting schema_spec are
mutually exclusive.
§Example
let x = ValidateMessageRequest::new().set_name("example");
assert!(x.name().is_some());
assert!(x.schema().is_none());Sourcepub fn schema(&self) -> Option<&Box<Schema>>
pub fn schema(&self) -> Option<&Box<Schema>>
The value of schema_spec
if it holds a Schema, None if the field is not set or
holds a different branch.
Sourcepub fn set_schema<T: Into<Box<Schema>>>(self, v: T) -> Self
pub fn set_schema<T: Into<Box<Schema>>>(self, v: T) -> Self
Sets the value of schema_spec
to hold a Schema.
Note that all the setters affecting schema_spec are
mutually exclusive.
§Example
use google_cloud_pubsub::model::Schema;
let x = ValidateMessageRequest::new().set_schema(Schema::default()/* use setters */);
assert!(x.schema().is_some());
assert!(x.name().is_none());Trait Implementations§
Source§impl Clone for ValidateMessageRequest
impl Clone for ValidateMessageRequest
Source§fn clone(&self) -> ValidateMessageRequest
fn clone(&self) -> ValidateMessageRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidateMessageRequest
impl Debug for ValidateMessageRequest
Source§impl Default for ValidateMessageRequest
impl Default for ValidateMessageRequest
Source§fn default() -> ValidateMessageRequest
fn default() -> ValidateMessageRequest
Source§impl Message for ValidateMessageRequest
impl Message for ValidateMessageRequest
Source§impl PartialEq for ValidateMessageRequest
impl PartialEq for ValidateMessageRequest
impl StructuralPartialEq for ValidateMessageRequest
Auto Trait Implementations§
impl !Freeze for ValidateMessageRequest
impl RefUnwindSafe for ValidateMessageRequest
impl Send for ValidateMessageRequest
impl Sync for ValidateMessageRequest
impl Unpin for ValidateMessageRequest
impl UnwindSafe for ValidateMessageRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request