AccountMethods

Struct AccountMethods 

Source
pub struct AccountMethods<'a, C>
where C: 'a,
{ /* private fields */ }
Expand description

A builder providing access to all methods supported on account resources. It is not used directly, but through the Adsense hub.

§Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate google_adsense2 as adsense2;

use adsense2::{Adsense, FieldMask, hyper_rustls, hyper_util, yup_oauth2};

let secret: yup_oauth2::ApplicationSecret = Default::default();
let connector = hyper_rustls::HttpsConnectorBuilder::new()
    .with_native_roots()
    .unwrap()
    .https_only()
    .enable_http2()
    .build();

let executor = hyper_util::rt::TokioExecutor::new();
let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
    secret,
    yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
    yup_oauth2::client::CustomHyperClientBuilder::from(
        hyper_util::client::legacy::Client::builder(executor).build(connector),
    ),
).build().await.unwrap();

let client = hyper_util::client::legacy::Client::builder(
    hyper_util::rt::TokioExecutor::new()
)
.build(
    hyper_rustls::HttpsConnectorBuilder::new()
        .with_native_roots()
        .unwrap()
        .https_or_http()
        .enable_http2()
        .build()
);
let mut hub = Adsense::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `adclients_adunits_create(...)`, `adclients_adunits_get(...)`, `adclients_adunits_get_adcode(...)`, `adclients_adunits_list(...)`, `adclients_adunits_list_linked_custom_channels(...)`, `adclients_adunits_patch(...)`, `adclients_customchannels_create(...)`, `adclients_customchannels_delete(...)`, `adclients_customchannels_get(...)`, `adclients_customchannels_list(...)`, `adclients_customchannels_list_linked_ad_units(...)`, `adclients_customchannels_patch(...)`, `adclients_get(...)`, `adclients_get_adcode(...)`, `adclients_list(...)`, `adclients_urlchannels_get(...)`, `adclients_urlchannels_list(...)`, `alerts_list(...)`, `get(...)`, `get_ad_blocking_recovery_tag(...)`, `list(...)`, `list_child_accounts(...)`, `payments_list(...)`, `policy_issues_get(...)`, `policy_issues_list(...)`, `reports_generate(...)`, `reports_generate_csv(...)`, `reports_get_saved(...)`, `reports_saved_generate(...)`, `reports_saved_generate_csv(...)`, `reports_saved_list(...)`, `sites_get(...)` and `sites_list(...)`
// to build up your call.
let rb = hub.accounts();

Implementations§

Source§

impl<'a, C> AccountMethods<'a, C>

Source

pub fn adclients_adunits_create( &self, request: AdUnit, parent: &str, ) -> AccountAdclientAdunitCreateCall<'a, C>

Create a builder to help you perform the following task:

Creates an ad unit. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your account manager if you need to use this method. Note that ad units can only be created for ad clients with an “AFC” product code. For more info see the AdClient resource. For now, this method can only be used to create DISPLAY ad units. See: https://support.google.com/adsense/answer/9183566

§Arguments
  • request - No description provided.
  • parent - Required. Ad client to create an ad unit under. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_adunits_get( &self, name: &str, ) -> AccountAdclientAdunitGetCall<'a, C>

Create a builder to help you perform the following task:

Gets an ad unit from a specified account and ad client.

§Arguments
  • name - Required. AdUnit to get information about. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit}
Source

pub fn adclients_adunits_get_adcode( &self, name: &str, ) -> AccountAdclientAdunitGetAdcodeCall<'a, C>

Create a builder to help you perform the following task:

Gets the ad unit code for a given ad unit. For more information, see About the AdSense code and Where to place the ad code in your HTML.

§Arguments
  • name - Required. Name of the adunit for which to get the adcode. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit}
Source

pub fn adclients_adunits_list( &self, parent: &str, ) -> AccountAdclientAdunitListCall<'a, C>

Create a builder to help you perform the following task:

Lists all ad units under a specified account and ad client.

§Arguments
  • parent - Required. The ad client which owns the collection of ad units. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_adunits_list_linked_custom_channels( &self, parent: &str, ) -> AccountAdclientAdunitListLinkedCustomChannelCall<'a, C>

Create a builder to help you perform the following task:

Lists all the custom channels available for an ad unit.

§Arguments
  • parent - Required. The ad unit which owns the collection of custom channels. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit}
Source

pub fn adclients_adunits_patch( &self, request: AdUnit, name: &str, ) -> AccountAdclientAdunitPatchCall<'a, C>

Create a builder to help you perform the following task:

Updates an ad unit. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your account manager if you need to use this method. For now, this method can only be used to update DISPLAY ad units. See: https://support.google.com/adsense/answer/9183566

§Arguments
  • request - No description provided.
  • name - Output only. Resource name of the ad unit. Format: accounts/{account}/adclients/{adclient}/adunits/{adunit}
Source

pub fn adclients_customchannels_create( &self, request: CustomChannel, parent: &str, ) -> AccountAdclientCustomchannelCreateCall<'a, C>

Create a builder to help you perform the following task:

Creates a custom channel. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your account manager if you need to use this method.

§Arguments
  • request - No description provided.
  • parent - Required. The ad client to create a custom channel under. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_customchannels_delete( &self, name: &str, ) -> AccountAdclientCustomchannelDeleteCall<'a, C>

Create a builder to help you perform the following task:

Deletes a custom channel. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your account manager if you need to use this method.

§Arguments
  • name - Required. Name of the custom channel to delete. Format: accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
Source

pub fn adclients_customchannels_get( &self, name: &str, ) -> AccountAdclientCustomchannelGetCall<'a, C>

Create a builder to help you perform the following task:

Gets information about the selected custom channel.

§Arguments
  • name - Required. Name of the custom channel. Format: accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
Source

pub fn adclients_customchannels_list( &self, parent: &str, ) -> AccountAdclientCustomchannelListCall<'a, C>

Create a builder to help you perform the following task:

Lists all the custom channels available in an ad client.

§Arguments
  • parent - Required. The ad client which owns the collection of custom channels. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_customchannels_list_linked_ad_units( &self, parent: &str, ) -> AccountAdclientCustomchannelListLinkedAdUnitCall<'a, C>

Create a builder to help you perform the following task:

Lists all the ad units available for a custom channel.

§Arguments
  • parent - Required. The custom channel which owns the collection of ad units. Format: accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
Source

pub fn adclients_customchannels_patch( &self, request: CustomChannel, name: &str, ) -> AccountAdclientCustomchannelPatchCall<'a, C>

Create a builder to help you perform the following task:

Updates a custom channel. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your account manager if you need to use this method.

§Arguments
  • request - No description provided.
  • name - Output only. Resource name of the custom channel. Format: accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
Source

pub fn adclients_urlchannels_get( &self, name: &str, ) -> AccountAdclientUrlchannelGetCall<'a, C>

Create a builder to help you perform the following task:

Gets information about the selected url channel.

§Arguments
  • name - Required. The name of the url channel to retrieve. Format: accounts/{account}/adclients/{adclient}/urlchannels/{urlchannel}
Source

pub fn adclients_urlchannels_list( &self, parent: &str, ) -> AccountAdclientUrlchannelListCall<'a, C>

Create a builder to help you perform the following task:

Lists active url channels.

§Arguments
  • parent - Required. The ad client which owns the collection of url channels. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_get(&self, name: &str) -> AccountAdclientGetCall<'a, C>

Create a builder to help you perform the following task:

Gets the ad client from the given resource name.

§Arguments
  • name - Required. The name of the ad client to retrieve. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_get_adcode( &self, name: &str, ) -> AccountAdclientGetAdcodeCall<'a, C>

Create a builder to help you perform the following task:

Gets the AdSense code for a given ad client. This returns what was previously known as the ‘auto ad code’. This is only supported for ad clients with a product_code of AFC. For more information, see About the AdSense code.

§Arguments
  • name - Required. Name of the ad client for which to get the adcode. Format: accounts/{account}/adclients/{adclient}
Source

pub fn adclients_list(&self, parent: &str) -> AccountAdclientListCall<'a, C>

Create a builder to help you perform the following task:

Lists all the ad clients available in an account.

§Arguments
  • parent - Required. The account which owns the collection of ad clients. Format: accounts/{account}
Source

pub fn alerts_list(&self, parent: &str) -> AccountAlertListCall<'a, C>

Create a builder to help you perform the following task:

Lists all the alerts available in an account.

§Arguments
  • parent - Required. The account which owns the collection of alerts. Format: accounts/{account}
Source

pub fn payments_list(&self, parent: &str) -> AccountPaymentListCall<'a, C>

Create a builder to help you perform the following task:

Lists all the payments available for an account.

§Arguments
  • parent - Required. The account which owns the collection of payments. Format: accounts/{account}
Source

pub fn policy_issues_get(&self, name: &str) -> AccountPolicyIssueGetCall<'a, C>

Create a builder to help you perform the following task:

Gets information about the selected policy issue.

§Arguments
  • name - Required. Name of the policy issue. Format: accounts/{account}/policyIssues/{policy_issue}
Source

pub fn policy_issues_list( &self, parent: &str, ) -> AccountPolicyIssueListCall<'a, C>

Create a builder to help you perform the following task:

Lists all the policy issues where the specified account is involved, both directly and through any AFP child accounts.

§Arguments
  • parent - Required. The account for which policy issues are being retrieved. Format: accounts/{account}
Source

pub fn reports_saved_generate( &self, name: &str, ) -> AccountReportSavedGenerateCall<'a, C>

Create a builder to help you perform the following task:

Generates a saved report.

§Arguments
  • name - Required. Name of the saved report. Format: accounts/{account}/reports/{report}
Source

pub fn reports_saved_generate_csv( &self, name: &str, ) -> AccountReportSavedGenerateCsvCall<'a, C>

Create a builder to help you perform the following task:

Generates a csv formatted saved report.

§Arguments
  • name - Required. Name of the saved report. Format: accounts/{account}/reports/{report}
Source

pub fn reports_saved_list( &self, parent: &str, ) -> AccountReportSavedListCall<'a, C>

Create a builder to help you perform the following task:

Lists saved reports.

§Arguments
  • parent - Required. The account which owns the collection of reports. Format: accounts/{account}
Source

pub fn reports_generate( &self, account: &str, ) -> AccountReportGenerateCall<'a, C>

Create a builder to help you perform the following task:

Generates an ad hoc report.

§Arguments
  • account - Required. The account which owns the collection of reports. Format: accounts/{account}
Source

pub fn reports_generate_csv( &self, account: &str, ) -> AccountReportGenerateCsvCall<'a, C>

Create a builder to help you perform the following task:

Generates a csv formatted ad hoc report.

§Arguments
  • account - Required. The account which owns the collection of reports. Format: accounts/{account}
Source

pub fn reports_get_saved(&self, name: &str) -> AccountReportGetSavedCall<'a, C>

Create a builder to help you perform the following task:

Gets the saved report from the given resource name.

§Arguments
  • name - Required. The name of the saved report to retrieve. Format: accounts/{account}/reports/{report}
Source

pub fn sites_get(&self, name: &str) -> AccountSiteGetCall<'a, C>

Create a builder to help you perform the following task:

Gets information about the selected site.

§Arguments
  • name - Required. Name of the site. Format: accounts/{account}/sites/{site}
Source

pub fn sites_list(&self, parent: &str) -> AccountSiteListCall<'a, C>

Create a builder to help you perform the following task:

Lists all the sites available in an account.

§Arguments
  • parent - Required. The account which owns the collection of sites. Format: accounts/{account}
Source

pub fn get(&self, name: &str) -> AccountGetCall<'a, C>

Create a builder to help you perform the following task:

Gets information about the selected AdSense account.

§Arguments
  • name - Required. Account to get information about. Format: accounts/{account}
Source

pub fn get_ad_blocking_recovery_tag( &self, name: &str, ) -> AccountGetAdBlockingRecoveryTagCall<'a, C>

Create a builder to help you perform the following task:

Gets the ad blocking recovery tag of an account.

§Arguments
  • name - Required. The name of the account to get the tag for. Format: accounts/{account}
Source

pub fn list(&self) -> AccountListCall<'a, C>

Create a builder to help you perform the following task:

Lists all accounts available to this user.

Source

pub fn list_child_accounts( &self, parent: &str, ) -> AccountListChildAccountCall<'a, C>

Create a builder to help you perform the following task:

Lists all accounts directly managed by the given AdSense account.

§Arguments
  • parent - Required. The parent account, which owns the child accounts. Format: accounts/{account}

Trait Implementations§

Source§

impl<'a, C> MethodsBuilder for AccountMethods<'a, C>

Auto Trait Implementations§

§

impl<'a, C> Freeze for AccountMethods<'a, C>

§

impl<'a, C> !RefUnwindSafe for AccountMethods<'a, C>

§

impl<'a, C> Send for AccountMethods<'a, C>
where C: Sync,

§

impl<'a, C> Sync for AccountMethods<'a, C>
where C: Sync,

§

impl<'a, C> Unpin for AccountMethods<'a, C>

§

impl<'a, C> !UnwindSafe for AccountMethods<'a, C>

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> 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, 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