pub struct DataFile {
pub file_path: String,
pub content_type: String,
pub payload: Bytes,
}
Expand description
Represents a single file which contains unstructured data. Examples include image files, audio files, and cloud function source code.
Fields§
§file_path: String
Relative path of the data file from the project root in the SDK file
structure.
Allowed file paths:
- Images: resources/images/{multiple directories}?/{ImageName}.{extension}
- Audio: resources/audio/{multiple directories}?/{AudioFileName}.{extension}
- Inline Cloud Function Code: webhooks/{WebhookName}.zip
Allowed extensions:
- Images: png
, jpg
, jpeg
- Audio: mp3
, mpeg
- Inline Cloud Functions: zip
content_type: String
Required. The content type of this asset. Example: text/html
. The content
type must comply with the specification
(http://www.w3.org/Protocols/rfc1341/4_Content-Type.html).
Cloud functions must be in zip format and the content type should
be application/zip;zip_type=cloud_function
. The zip_type parameter
indicates that the zip is for a cloud function.
payload: Bytes
Content of the data file. Examples would be raw bytes of images, audio files, or cloud function zip format. There is 10 MB strict limit on the payload size.
Trait Implementations§
source§impl Message for DataFile
impl Message for DataFile
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for DataFile
impl PartialEq for DataFile
impl StructuralPartialEq for DataFile
Auto Trait Implementations§
impl !Freeze for DataFile
impl RefUnwindSafe for DataFile
impl Send for DataFile
impl Sync for DataFile
impl Unpin for DataFile
impl UnwindSafe for DataFile
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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