SendSmsRequest

Struct SendSmsRequest 

Source
pub struct SendSmsRequest {
    pub phone_number_set: Vec<String>,
    pub sms_sdk_app_id: String,
    pub template_id: String,
    pub sign_name: Option<String>,
    pub template_param_set: Option<Vec<String>>,
    pub extend_code: Option<String>,
    pub session_context: Option<String>,
    pub sender_id: Option<String>,
}
Expand description

Request structure for sending SMS

Fields§

§phone_number_set: Vec<String>

List of phone numbers to send SMS to Format: +[country code][phone number] Example: +8613800000000 Maximum 200 phone numbers per request

§sms_sdk_app_id: String

SMS SDK App ID You can view it in the SMS console

§template_id: String

Template ID You must use an approved template ID

§sign_name: Option<String>

SMS signature content You must use an approved signature Required for domestic SMS, optional for international SMS

§template_param_set: Option<Vec<String>>

Template parameters The number of parameters must match the template variables

§extend_code: Option<String>

SMS extension code Default is not enabled

§session_context: Option<String>

User session context Server will return this as-is

§sender_id: Option<String>

SenderId for international SMS Required for international SMS with independent SenderId

Implementations§

Source§

impl SendSmsRequest

Source

pub fn new<S: Into<String>>( phone_number_set: Vec<String>, sms_sdk_app_id: S, template_id: S, sign_name: S, template_param_set: Vec<String>, ) -> Self

Create a new SendSmsRequest with required parameters

§Arguments
  • phone_number_set - List of phone numbers
  • sms_sdk_app_id - SMS SDK App ID
  • template_id - Template ID
  • sign_name - SMS signature
  • template_param_set - Template parameters
§Examples
use tencentcloud_sms_sdk::SendSmsRequest;

let request = SendSmsRequest::new(
    vec!["+8613800000000".to_string()],
    "1400000000",
    "123456",
    "YourSignature",
    vec!["123456".to_string()],
);
Source

pub fn new_international<S: Into<String>>( phone_number_set: Vec<String>, sms_sdk_app_id: S, template_id: S, template_param_set: Vec<String>, ) -> Self

Create a new SendSmsRequest for international SMS

Source

pub fn set_sign_name<S: Into<String>>(&mut self, sign_name: S) -> &mut Self

Set the SMS signature

Source

pub fn set_template_param_set(&mut self, params: Vec<String>) -> &mut Self

Set template parameters

Source

pub fn set_extend_code<S: Into<String>>(&mut self, extend_code: S) -> &mut Self

Set extension code

Source

pub fn set_session_context<S: Into<String>>( &mut self, session_context: S, ) -> &mut Self

Set session context

Source

pub fn set_sender_id<S: Into<String>>(&mut self, sender_id: S) -> &mut Self

Set sender ID for international SMS

Source

pub fn validate(&self) -> Result<(), String>

Validate the request parameters

Trait Implementations§

Source§

impl Clone for SendSmsRequest

Source§

fn clone(&self) -> SendSmsRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SendSmsRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for SendSmsRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,