/// <summary>Snippet for GetCustomerUserAccessInvitation</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomerUserAccessInvitationResourceNames()
 {
     // Create client
     CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = CustomerUserAccessInvitationServiceClient.Create();
     // Initialize request argument(s)
     CustomerUserAccessInvitationName resourceName = CustomerUserAccessInvitationName.FromCustomerInvitation("[CUSTOMER_ID]", "[INVITATION_ID]");
     // Make the request
     CustomerUserAccessInvitation response = customerUserAccessInvitationServiceClient.GetCustomerUserAccessInvitation(resourceName);
 }
コード例 #2
0
 /// <summary>Snippet for GetCustomerUserAccessInvitation</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomerUserAccessInvitation()
 {
     // Create client
     CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = CustomerUserAccessInvitationServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/customerUserAccessInvitations/[INVITATION_ID]";
     // Make the request
     CustomerUserAccessInvitation response = customerUserAccessInvitationServiceClient.GetCustomerUserAccessInvitation(resourceName);
 }
コード例 #3
0
 /// <summary>Snippet for MutateCustomerUserAccessInvitation</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCustomerUserAccessInvitation()
 {
     // Create client
     CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = CustomerUserAccessInvitationServiceClient.Create();
     // Initialize request argument(s)
     string customerId = "";
     CustomerUserAccessInvitationOperation operation = new CustomerUserAccessInvitationOperation();
     // Make the request
     MutateCustomerUserAccessInvitationResponse response = customerUserAccessInvitationServiceClient.MutateCustomerUserAccessInvitation(customerId, operation);
 }
 /// <summary>Snippet for MutateCustomerUserAccessInvitation</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateCustomerUserAccessInvitationRequestObject()
 {
     // Create client
     CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = CustomerUserAccessInvitationServiceClient.Create();
     // Initialize request argument(s)
     MutateCustomerUserAccessInvitationRequest request = new MutateCustomerUserAccessInvitationRequest
     {
         CustomerId = "",
         Operation  = new CustomerUserAccessInvitationOperation(),
     };
     // Make the request
     MutateCustomerUserAccessInvitationResponse response = customerUserAccessInvitationServiceClient.MutateCustomerUserAccessInvitation(request);
 }
        /// <summary>Snippet for GetCustomerUserAccessInvitationAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetCustomerUserAccessInvitationRequestObjectAsync()
        {
            // Create client
            CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = await CustomerUserAccessInvitationServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetCustomerUserAccessInvitationRequest request = new GetCustomerUserAccessInvitationRequest
            {
                ResourceNameAsCustomerUserAccessInvitationName = CustomerUserAccessInvitationName.FromCustomerInvitation("[CUSTOMER_ID]", "[INVITATION_ID]"),
            };
            // Make the request
            CustomerUserAccessInvitation response = await customerUserAccessInvitationServiceClient.GetCustomerUserAccessInvitationAsync(request);
        }
コード例 #6
0
        /// <summary>Snippet for MutateCustomerUserAccessInvitationAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task MutateCustomerUserAccessInvitationRequestObjectAsync()
        {
            // Create client
            CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = await CustomerUserAccessInvitationServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateCustomerUserAccessInvitationRequest request = new MutateCustomerUserAccessInvitationRequest
            {
                CustomerId = "",
                Operation  = new CustomerUserAccessInvitationOperation(),
            };
            // Make the request
            MutateCustomerUserAccessInvitationResponse response = await customerUserAccessInvitationServiceClient.MutateCustomerUserAccessInvitationAsync(request);
        }
コード例 #7
0
        /// <summary>Snippet for GetCustomerUserAccessInvitationAsync</summary>
        public async Task GetCustomerUserAccessInvitationAsync()
        {
            // Snippet: GetCustomerUserAccessInvitationAsync(string, CallSettings)
            // Additional: GetCustomerUserAccessInvitationAsync(string, CancellationToken)
            // Create client
            CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = await CustomerUserAccessInvitationServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER_ID]/customerUserAccessInvitations/[INVITATION_ID]";
            // Make the request
            CustomerUserAccessInvitation response = await customerUserAccessInvitationServiceClient.GetCustomerUserAccessInvitationAsync(resourceName);

            // End snippet
        }
コード例 #8
0
 /// <summary>Snippet for GetCustomerUserAccessInvitation</summary>
 public void GetCustomerUserAccessInvitationRequestObject()
 {
     // Snippet: GetCustomerUserAccessInvitation(GetCustomerUserAccessInvitationRequest, CallSettings)
     // Create client
     CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = CustomerUserAccessInvitationServiceClient.Create();
     // Initialize request argument(s)
     GetCustomerUserAccessInvitationRequest request = new GetCustomerUserAccessInvitationRequest
     {
         ResourceNameAsCustomerUserAccessInvitationName = CustomerUserAccessInvitationName.FromCustomerInvitation("[CUSTOMER_ID]", "[INVITATION_ID]"),
     };
     // Make the request
     CustomerUserAccessInvitation response = customerUserAccessInvitationServiceClient.GetCustomerUserAccessInvitation(request);
     // End snippet
 }
コード例 #9
0
        /// <summary>Snippet for GetCustomerUserAccessInvitationAsync</summary>
        public async Task GetCustomerUserAccessInvitationResourceNamesAsync()
        {
            // Snippet: GetCustomerUserAccessInvitationAsync(CustomerUserAccessInvitationName, CallSettings)
            // Additional: GetCustomerUserAccessInvitationAsync(CustomerUserAccessInvitationName, CancellationToken)
            // Create client
            CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = await CustomerUserAccessInvitationServiceClient.CreateAsync();

            // Initialize request argument(s)
            CustomerUserAccessInvitationName resourceName = CustomerUserAccessInvitationName.FromCustomerInvitation("[CUSTOMER_ID]", "[INVITATION_ID]");
            // Make the request
            CustomerUserAccessInvitation response = await customerUserAccessInvitationServiceClient.GetCustomerUserAccessInvitationAsync(resourceName);

            // End snippet
        }
コード例 #10
0
        /// <summary>Snippet for MutateCustomerUserAccessInvitationAsync</summary>
        public async Task MutateCustomerUserAccessInvitationAsync()
        {
            // Snippet: MutateCustomerUserAccessInvitationAsync(string, CustomerUserAccessInvitationOperation, CallSettings)
            // Additional: MutateCustomerUserAccessInvitationAsync(string, CustomerUserAccessInvitationOperation, CancellationToken)
            // Create client
            CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = await CustomerUserAccessInvitationServiceClient.CreateAsync();

            // Initialize request argument(s)
            string customerId = "";
            CustomerUserAccessInvitationOperation operation = new CustomerUserAccessInvitationOperation();
            // Make the request
            MutateCustomerUserAccessInvitationResponse response = await customerUserAccessInvitationServiceClient.MutateCustomerUserAccessInvitationAsync(customerId, operation);

            // End snippet
        }
コード例 #11
0
        /// <summary>Snippet for MutateCustomerUserAccessInvitationAsync</summary>
        public async Task MutateCustomerUserAccessInvitationRequestObjectAsync()
        {
            // Snippet: MutateCustomerUserAccessInvitationAsync(MutateCustomerUserAccessInvitationRequest, CallSettings)
            // Additional: MutateCustomerUserAccessInvitationAsync(MutateCustomerUserAccessInvitationRequest, CancellationToken)
            // Create client
            CustomerUserAccessInvitationServiceClient customerUserAccessInvitationServiceClient = await CustomerUserAccessInvitationServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateCustomerUserAccessInvitationRequest request = new MutateCustomerUserAccessInvitationRequest
            {
                CustomerId = "",
                Operation  = new CustomerUserAccessInvitationOperation(),
            };
            // Make the request
            MutateCustomerUserAccessInvitationResponse response = await customerUserAccessInvitationServiceClient.MutateCustomerUserAccessInvitationAsync(request);

            // End snippet
        }
コード例 #12
0
        /// <summary>
        /// Runs the code example.
        /// </summary>
        /// <param name="client">The Google Ads client.</param>
        /// <param name="customerId">The Google Ads customer ID for which the call is made.</param>
        /// <param name="emailAddress">Email address of the user to send the invitation to.</param>
        /// <param name="accessRole">The access role for which the user is invited.</param>
        public void Run(GoogleAdsClient client, long customerId, string emailAddress,
                        AccessRole accessRole)
        {
            // Get the CustomerUserAccessInvitationService.
            CustomerUserAccessInvitationServiceClient service = client.GetService(
                Services.V10.CustomerUserAccessInvitationService);

            // [START invite_user_with_access_role]
            MutateCustomerUserAccessInvitationRequest invitationRequest =
                new MutateCustomerUserAccessInvitationRequest()
            {
                CustomerId = customerId.ToString(),
                Operation  = new CustomerUserAccessInvitationOperation()
                {
                    Create = new CustomerUserAccessInvitation()
                    {
                        EmailAddress = emailAddress,
                        AccessRole   = accessRole
                    },
                }
            };

            try
            {
                var response = service.MutateCustomerUserAccessInvitation(invitationRequest);

                Console.WriteLine("Customer user access invitation was sent for customerId = " +
                                  "{0} to email address = {1} and access role = {2}. The invitation resource " +
                                  "name is {3}.", customerId, emailAddress, accessRole,
                                  response.Result.ResourceName);
            }
            catch (GoogleAdsException e)
            {
                Console.WriteLine("Failure:");
                Console.WriteLine($"Message: {e.Message}");
                Console.WriteLine($"Failure: {e.Failure}");
                Console.WriteLine($"Request ID: {e.RequestId}");
                throw;
            }
            // [END invite_user_with_access_role]
        }