#[non_exhaustive]pub struct CloudflareAccountCreateRequestAttributes {
pub api_key: String,
pub email: Option<String>,
pub name: String,
pub resources: Option<Vec<String>>,
pub zones: Option<Vec<String>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Attributes object for creating a Cloudflare account.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.api_key: String
The API key (or token) for the Cloudflare account.
email: Option<String>
The email associated with the Cloudflare account. If an API key is provided (and not a token), this field is also required.
name: String
The name of the Cloudflare account.
resources: Option<Vec<String>>
An allowlist of resources to restrict pulling metrics for including 'web', 'dns', 'lb' (load balancer), 'worker'
.
zones: Option<Vec<String>>
An allowlist of zones to restrict pulling metrics for.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CloudflareAccountCreateRequestAttributes
impl CloudflareAccountCreateRequestAttributes
Sourcepub fn new(
api_key: String,
name: String,
) -> CloudflareAccountCreateRequestAttributes
pub fn new( api_key: String, name: String, ) -> CloudflareAccountCreateRequestAttributes
Examples found in repository?
examples/v2_cloudflare-integration_CreateCloudflareAccount.rs (lines 12-15)
10async fn main() {
11 let body = CloudflareAccountCreateRequest::new(CloudflareAccountCreateRequestData::new(
12 CloudflareAccountCreateRequestAttributes::new(
13 "fakekey".to_string(),
14 "examplecloudflareintegration".to_string(),
15 )
16 .email("dev@datadoghq.com".to_string()),
17 CloudflareAccountType::CLOUDFLARE_ACCOUNTS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = CloudflareIntegrationAPI::with_config(configuration);
21 let resp = api.create_cloudflare_account(body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
Sourcepub fn email(self, value: String) -> Self
pub fn email(self, value: String) -> Self
Examples found in repository?
examples/v2_cloudflare-integration_CreateCloudflareAccount.rs (line 16)
10async fn main() {
11 let body = CloudflareAccountCreateRequest::new(CloudflareAccountCreateRequestData::new(
12 CloudflareAccountCreateRequestAttributes::new(
13 "fakekey".to_string(),
14 "examplecloudflareintegration".to_string(),
15 )
16 .email("dev@datadoghq.com".to_string()),
17 CloudflareAccountType::CLOUDFLARE_ACCOUNTS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = CloudflareIntegrationAPI::with_config(configuration);
21 let resp = api.create_cloudflare_account(body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
pub fn resources(self, value: Vec<String>) -> Self
pub fn zones(self, value: Vec<String>) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CloudflareAccountCreateRequestAttributes
impl Clone for CloudflareAccountCreateRequestAttributes
Source§fn clone(&self) -> CloudflareAccountCreateRequestAttributes
fn clone(&self) -> CloudflareAccountCreateRequestAttributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de> Deserialize<'de> for CloudflareAccountCreateRequestAttributes
impl<'de> Deserialize<'de> for CloudflareAccountCreateRequestAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CloudflareAccountCreateRequestAttributes
impl PartialEq for CloudflareAccountCreateRequestAttributes
Source§fn eq(&self, other: &CloudflareAccountCreateRequestAttributes) -> bool
fn eq(&self, other: &CloudflareAccountCreateRequestAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CloudflareAccountCreateRequestAttributes
Auto Trait Implementations§
impl Freeze for CloudflareAccountCreateRequestAttributes
impl RefUnwindSafe for CloudflareAccountCreateRequestAttributes
impl Send for CloudflareAccountCreateRequestAttributes
impl Sync for CloudflareAccountCreateRequestAttributes
impl Unpin for CloudflareAccountCreateRequestAttributes
impl UnwindSafe for CloudflareAccountCreateRequestAttributes
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
Mutably borrows from an owned value. Read more