/// <summary>Snippet for ChangeOffer</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ChangeOfferRequestObject()
        {
            // Create client
            CloudChannelServiceClient cloudChannelServiceClient = CloudChannelServiceClient.Create();
            // Initialize request argument(s)
            ChangeOfferRequest request = new ChangeOfferRequest
            {
                Name             = "",
                OfferAsOfferName = OfferName.FromAccountOffer("[ACCOUNT]", "[OFFER]"),
                Parameters       = { new Parameter(), },
                PurchaseOrderId  = "",
                RequestId        = "",
            };
            // Make the request
            Operation <Entitlement, OperationMetadata> response = cloudChannelServiceClient.ChangeOffer(request);

            // Poll until the returned long-running operation is complete
            Operation <Entitlement, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Entitlement result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Entitlement, OperationMetadata> retrievedResponse = cloudChannelServiceClient.PollOnceChangeOffer(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Entitlement retrievedResult = retrievedResponse.Result;
            }
        }
        public void GetEntitlementRequestObject()
        {
            moq::Mock <CloudChannelService.CloudChannelServiceClient> mockGrpcClient = new moq::Mock <CloudChannelService.CloudChannelServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetEntitlementRequest request = new GetEntitlementRequest
            {
                EntitlementName = EntitlementName.FromAccountCustomerEntitlement("[ACCOUNT]", "[CUSTOMER]", "[ENTITLEMENT]"),
            };
            Entitlement expectedResponse = new Entitlement
            {
                EntitlementName    = EntitlementName.FromAccountCustomerEntitlement("[ACCOUNT]", "[CUSTOMER]", "[ENTITLEMENT]"),
                CreateTime         = new wkt::Timestamp(),
                UpdateTime         = new wkt::Timestamp(),
                OfferAsOfferName   = OfferName.FromAccountOffer("[ACCOUNT]", "[OFFER]"),
                CommitmentSettings = new CommitmentSettings(),
                ProvisioningState  = Entitlement.Types.ProvisioningState.Unspecified,
                ProvisionedService = new ProvisionedService(),
                SuspensionReasons  =
                {
                    Entitlement.Types.SuspensionReason.TrialEnded,
                },
                PurchaseOrderId = "purchase_order_id4111e034",
                TrialSettings   = new TrialSettings(),
                AssociationInfo = new AssociationInfo(),
                Parameters      = { new Parameter(), },
            };

            mockGrpcClient.Setup(x => x.GetEntitlement(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CloudChannelServiceClient client = new CloudChannelServiceClientImpl(mockGrpcClient.Object, null);
            Entitlement response             = client.GetEntitlement(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Example #3
0
 public async Task <ResourceResponse <Microsoft.Azure.Documents.DocumentCollection> > CreateAsync(
     OfferName offerName,
     IndexingPolicy indexingPolicy = null)
 {
     // DISCUSS: create enum for S1,S2,S3 now that it isn't going to grow. Support this, but
     // mark obsolete for the future.
     throw new NotImplementedException();
 }
Example #4
0
 public async Task <ResourceResponse <Microsoft.Azure.Documents.DocumentCollection> > UpdateThroughput(
     OfferName offerName)
 {
     throw new NotImplementedException();
 }