Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerAvailabilityOperations" /> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 /// <param name="customerId">The corresponding customer identifier.</param>
 /// <param name="productId">The corresponding product identifier.</param>
 /// <param name="skuId">The corresponding SKU identifier.</param>
 /// <param name="availabilityId">The availability identifier.</param>
 public CustomerAvailabilityOperations(IPartner rootPartnerOperations, string customerId, string productId, string skuId, string availabilityId)
     : base(rootPartnerOperations, new Tuple <string, string, string, string>(customerId, productId, skuId, availabilityId))
 {
     customerId.AssertNotEmpty(nameof(customerId));
     productId.AssertNotEmpty(nameof(productId));
     skuId.AssertNotEmpty(nameof(skuId));
     availabilityId.AssertNotEmpty(nameof(availabilityId));
 }
 /// <summary>
 /// Executes the operations associated with the cmdlet.
 /// </summary>
 public override void ExecuteCmdlet()
 {
     Scheduler.RunTask(async() =>
     {
         IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
         WriteObject(new PSCountryValidationRules(await partner.CountryValidationRules.ByCountry(CountryCode).GetAsync(CancellationToken).ConfigureAwait(false)));
     }, true);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectoryRoleOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="customerId">The customer tenant identifier.</param>
        /// <param name="roleId">The directory role identifier.</param>
        public DirectoryRoleOperations(IPartner rootPartnerOperations, string customerId, string roleId)
            : base(rootPartnerOperations, new Tuple <string, string>(customerId, roleId))
        {
            customerId.AssertNotEmpty(nameof(customerId));
            roleId.AssertNotEmpty(nameof(roleId));

            directoryRoleUserMemberOperations = new Lazy <IUserMemberCollection>(() => new UserMemberCollectionOperations(Partner, customerId, roleId));
        }
Пример #4
0
 /// <summary>
 /// Executes the operations associated with the cmdlet.
 /// </summary>
 public override void ExecuteCmdlet()
 {
     Scheduler.RunTask(async() =>
     {
         IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
         WriteObject(new PSCustomerBillingProfile(await partner.Customers[CustomerId].Profiles.Billing.GetAsync(CancellationToken).ConfigureAwait(false)));
     }, true);
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerSkuByReservationScopeOperations"/> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 /// <param name="customerId">The customer identifier.</param>
 /// <param name="productId">The product identifier.</param>
 /// <param name="skuId">The SKU identifier.</param>
 /// <param name="reservationScope">The reservation scope on which to base the product.</param>
 public CustomerSkuByReservationScopeOperations(IPartner rootPartnerOperations, string customerId, string productId, string skuId, string reservationScope) :
     base(rootPartnerOperations, new Tuple <string, string, string, string>(customerId, productId, skuId, reservationScope))
 {
     customerId.AssertNotEmpty(nameof(customerId));
     productId.AssertNotEmpty(nameof(productId));
     skuId.AssertNotEmpty(nameof(skuId));
     reservationScope.AssertNotEmpty(nameof(reservationScope));
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AvailabilityOperations" /> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 /// <param name="productId">The corresponding product identifier.</param>
 /// <param name="skuId">The corresponding SKU identifier.</param>
 /// <param name="availabilityId">The availability identifier.</param>
 /// <param name="country">The country on which to base the availability.</param>
 public AvailabilityOperations(IPartner rootPartnerOperations, string productId, string skuId, string availabilityId, string country)
     : base(rootPartnerOperations, new Tuple <string, string, string, string>(productId, skuId, availabilityId, country))
 {
     productId.AssertNotEmpty(nameof(productId));
     skuId.AssertNotEmpty(nameof(skuId));
     availabilityId.AssertNotEmpty(nameof(availabilityId));
     country.AssertNotEmpty(nameof(country));
 }
Пример #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PartnerServiceClient" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="endpoint">The address of the resource being accessed.</param>
        public PartnerServiceClient(IPartner rootPartnerOperations, Uri endpoint)
        {
            rootPartnerOperations.AssertNotNull(nameof(rootPartnerOperations));
            endpoint.AssertNotNull(nameof(endpoint));

            Endpoint = endpoint;
            this.rootPartnerOperations = rootPartnerOperations;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DevicesBatchOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="customerId">The customer identifier.</param>
        /// <param name="deviceBatchId">The devices batch identifier.</param>
        public DevicesBatchOperations(IPartner rootPartnerOperations, string customerId, string deviceBatchId)
            : base(rootPartnerOperations, new Tuple <string, string>(customerId, deviceBatchId))
        {
            customerId.AssertNotEmpty(nameof(customerId));
            deviceBatchId.AssertNotEmpty(nameof(deviceBatchId));

            devices = new Lazy <IDeviceCollection>(() => new DeviceCollectionOperations(Partner, Context.Item1, Context.Item2));
        }
Пример #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="productId">The product identifier.</param>
        /// <param name="country">The country on which to base the product.</param>
        public ProductOperations(IPartner rootPartnerOperations, string productId, string country)
            : base(rootPartnerOperations, new Tuple <string, string>(productId, country))
        {
            productId.AssertNotEmpty(nameof(productId));
            country.AssertNotEmpty(nameof(country));

            skus = new Lazy <ISkuCollection>(() => new SkuCollectionOperations(rootPartnerOperations, productId, country));
        }
Пример #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceCostsCollectionOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="customerId">The customer identifier.</param>
        /// <param name="billingPeriod">The service cost billing period.</param>
        public ServiceCostsCollectionOperations(IPartner rootPartnerOperations, string customerId, ServiceCostsBillingPeriod billingPeriod)
            : base(rootPartnerOperations, new Tuple <string, ServiceCostsBillingPeriod>(customerId, billingPeriod))
        {
            customerId.AssertNotEmpty(nameof(customerId));

            lineItems = new Lazy <IServiceCostLineItemsCollection>(() => new ServiceCostLineItemsOperations(Partner, Context));
            summary   = new Lazy <IServiceCostSummary>(() => new ServiceCostSummaryOperations(Partner, Context));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomerProfileCollectionOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="customerId">The customer identifier.</param>
        public CustomerProfileCollectionOperations(IPartner rootPartnerOperations, string customerId)
            : base(rootPartnerOperations, customerId)
        {
            customerId.AssertNotEmpty(nameof(customerId));

            billingProfile = new Lazy <ICustomerProfile <CustomerBillingProfile> >(() => new CustomerBillingProfileOperations(rootPartnerOperations, customerId));
            companyProfile = new Lazy <ICustomerReadonlyProfile <CustomerCompanyProfile> >(() => new CustomerCompanyProfileOperations(rootPartnerOperations, customerId));
        }
 internal Channel(IChannelRecord channelRecord, IPartner partner)
     : base(channelRecord.RecordType, channelRecord.Id)
 {
     Name          = channelRecord.Name;
     Type          = channelRecord.Type;
     CustomerScope = channelRecord.CustomerScope;
     Partner       = partner;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerAvailabilityCollectionByTargetSegmentOperations" /> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 /// <param name="customerId">The customer identifier.</param>
 /// <param name="productId">The product identifier.</param>
 /// <param name="skuId">The sku identifier.</param>
 /// <param name="targetSegment">The target segment used for filtering the availabilities.</param>
 public CustomerAvailabilityCollectionByTargetSegmentOperations(IPartner rootPartnerOperations, string customerId, string productId, string skuId, string targetSegment)
     : base(rootPartnerOperations, new Tuple <string, string, string, string>(customerId, productId, skuId, targetSegment))
 {
     customerId.AssertNotEmpty(nameof(customerId));
     productId.AssertNotEmpty(nameof(productId));
     skuId.AssertNotEmpty(nameof(skuId));
     targetSegment.AssertNotEmpty(nameof(targetSegment));
 }
Пример #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AgreementTemplateOperations"/> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="templateId">The template ID.</param>
        public AgreementTemplateOperations(IPartner rootPartnerOperations, string templateId) :
            base(rootPartnerOperations, new AgreementTemplateContext {
            TemplateId = templateId
        })
        {
            templateId.AssertNotEmpty(nameof(templateId));

            agreementDocument = new Lazy <IAgreementDocument>(() => new AgreementDocumentOperations(rootPartnerOperations, templateId));
        }
 /// <summary>
 /// Executes the operations associated with the cmdlet.
 /// </summary>
 public override void ExecuteCmdlet()
 {
     Scheduler.RunTask(async() =>
     {
         IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
         ResourceCollection <MeterUsageRecord> usageRecords = await partner.Customers[CustomerId].Subscriptions[SubscriptionId].UsageRecords.ByMeter.GetAsync(CancellationToken).ConfigureAwait(false);
         WriteObject(usageRecords.Items.Select(r => new PSMeterUsageRecord(r)), true);
     }, true);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PartnerProfileCollectionOperations" /> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 public PartnerProfileCollectionOperations(IPartner rootPartnerOperations)
     : base(rootPartnerOperations)
 {
     billingProfile           = new Lazy <IBillingProfile>(() => new BillingProfileOperations(Partner));
     legalBusinessProfile     = new Lazy <ILegalBusinessProfile>(() => new LegalBusinessProfileOperations(Partner));
     mpnProfileOperations     = new Lazy <IMpnProfile>(() => new MpnProfileOperations(Partner));
     organizationProfile      = new Lazy <IOrganizationProfile>(() => new OrganizationProfileOperations(Partner));
     supportProfileOperations = new Lazy <ISupportProfile>((Func <ISupportProfile>)(() => (ISupportProfile) new SupportProfileOperations(Partner)));
 }
Пример #17
0
        public void UpdatePartnerStatus(string loginName, PartnerStatus newStatus)
        {
            IPartner partner = GetPartnerByLoginName(loginName);

            DalPartner dal = new DalPartner(this.storageAccount, this.container);

            partner.Status = newStatus;
            dal.Save(partner as Partner);
        }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderProvisioningStatusOperations" /> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 /// <param name="customerId">The customer identifier.</param>
 /// <param name="orderId">The order identifier.</param>
 public OrderProvisioningStatusOperations(
     IPartner rootPartnerOperations,
     string customerId,
     string orderId)
     : base(rootPartnerOperations, new Tuple <string, string>(customerId, orderId))
 {
     customerId.AssertNotEmpty(nameof(customerId));
     orderId.AssertNotEmpty(nameof(orderId));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AvailabilityCollectionByTargetSegmentByReservationScopeOperations"/> class.
 /// </summary>
 /// <param name="rootPartnerOperations">The root partner operations instance.</param>
 /// <param name="productId">The corresponding product identifier.</param>
 /// <param name="skuId">The corresponding SKU identifier.</param>
 /// <param name="country">The country on which to base the product.</param>
 /// /// <param name="targetSegment">The target segment used for filtering the availabilities.</param>
 /// <param name="reservationScope">The reservation scope used for filtering the availabilities.</param>
 public AvailabilityCollectionByTargetSegmentByReservationScopeOperations(IPartner rootPartnerOperations, string productId, string skuId, string country, string targetSegment, string reservationScope) :
     base(rootPartnerOperations, new Tuple <string, string, string, string, string>(productId, skuId, country, targetSegment, reservationScope))
 {
     productId.AssertNotEmpty(nameof(productId));
     skuId.AssertNotEmpty(nameof(skuId));
     country.AssertNotEmpty(nameof(country));
     targetSegment.AssertNotEmpty(nameof(targetSegment));
     reservationScope.AssertNotEmpty(nameof(reservationScope));
 }
Пример #20
0
        public async Task <IResourceCollectionEnumerator <SeekBasedResourceCollection <Customer> > > GetCustomersAsync(int RecordsToFetch = 100)
        {
            IPartner scopedPartnerOperations = ApiCaller.With(RequestContextFactory.Instance.Create(Guid.NewGuid()));
            //var fieldFilter = new SimpleFieldFilter(CustomerSearchField.CompanyName.ToString(), FieldFilterOperation.StartsWith, "Elect");
            //var customersBatch = await scopedPartnerOperations.Customers.QueryAsync(QueryFactory.Instance.BuildIndexedQuery(RecordsToFetch, filter: fieldFilter));
            var customersBatch = await scopedPartnerOperations.Customers.QueryAsync(QueryFactory.Instance.BuildIndexedQuery(RecordsToFetch));

            return(scopedPartnerOperations.Enumerators.Customers.Create(customersBatch));
        }
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);

                WriteObject(new PSLegalBusinessProfile(await partner.Profiles.LegalBusinessProfile.GetAsync(VettingVersion.Current, CancellationToken).ConfigureAwait(false)));
            }, true);
        }
Пример #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SkuOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="productId">The product identifier.</param>
        /// <param name="skuId">The SKU identifier.</param>
        /// <param name="country">The country on which to base the sku.</param>
        public SkuOperations(IPartner rootPartnerOperations, string productId, string skuId, string country)
            : base(rootPartnerOperations, new Tuple <string, string, string>(productId, skuId, country))
        {
            productId.AssertNotEmpty(nameof(productId));
            skuId.AssertNotEmpty(nameof(skuId));
            country.AssertNotEmpty(nameof(country));

            availabilities = new Lazy <IAvailabilityCollection>(() => new AvailabilityCollectionOperations(rootPartnerOperations, productId, skuId, country));
        }
Пример #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomerSkuOperations" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="customerId">The customer identifier.</param>
        /// <param name="productId">The product identifier.</param>
        /// <param name="skuId">The sku identifier.</param>
        public CustomerSkuOperations(IPartner rootPartnerOperations, string customerId, string productId, string skuId)
            : base(rootPartnerOperations, new Tuple <string, string, string>(customerId, productId, skuId))
        {
            customerId.AssertNotEmpty(nameof(customerId));
            productId.AssertNotEmpty(nameof(productId));
            skuId.AssertNotEmpty(nameof(skuId));

            availabilities = new Lazy <IAvailabilityCollection>(() => new CustomerAvailabilityCollectionOperations(Partner, customerId, productId, skuId));
        }
Пример #24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PartnerServiceClient" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="endpoint">The address of the resource being accessed.</param>
        /// <param name="handlers">List of handlers from top to bottom (outer handler is the first in the list).</param>
        public PartnerServiceClient(IPartner rootPartnerOperations, Uri endpoint, params DelegatingHandler[] handlers)
            : base(handlers)
        {
            rootPartnerOperations.AssertNotNull(nameof(rootPartnerOperations));
            endpoint.AssertNotNull(nameof(endpoint));

            Endpoint = endpoint;
            this.rootPartnerOperations = rootPartnerOperations;
        }
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
                ResourceCollection <ServiceCostLineItem> lineItems = await partner.Customers[CustomerId].ServiceCosts.ByBillingPeriod(BillingPeriod).LineItems.GetAsync(CancellationToken).ConfigureAwait(false);

                WriteObject(lineItems.Items.Select(i => new PSServiceCostLineItem(i)), true);
            }, true);
        }
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
                IEnumerable <ValidationCode> codes = await partner.Validations.GetValidationCodesAsync(CancellationToken).ConfigureAwait(false);

                WriteObject(codes.Select(c => new PSValidationCode(c)), true);
            }, true);
        }
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
                ResourceCollection <DeviceBatch> deviceBatch = await partner.Customers[CustomerId].DeviceBatches.GetAsync(CancellationToken).ConfigureAwait(false);

                WriteObject(deviceBatch.Items.Select(b => new PSDeviceBatch(b)), true);
            }, true);
        }
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
                ResourceCollection <CustomerLicensesDeploymentInsights> insights = await partner.Customers[CustomerId].Analytics.Licenses.Deployment.GetAsync(CancellationToken).ConfigureAwait(false);

                WriteObject(insights.Items.Select(i => new PSCustomerLicensesDeploymentInsights(i)), true);
            }, true);
        }
Пример #29
0
        /// <summary>
        /// Executes the operations associated with the cmdlet.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            Scheduler.RunTask(async() =>
            {
                IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false);
                ResourceCollection <OrderLineItemActivationLink> links = await partner.Customers[CustomerId].Orders[OrderId].OrderLineItems[OrderLineItemNumber].ActivationLink.GetAsync(CancellationToken).ConfigureAwait(false);

                WriteObject(links.Items, true);
            }, true);
        }
Пример #30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PartnerServiceClient" /> class.
        /// </summary>
        /// <param name="rootPartnerOperations">The root partner operations instance.</param>
        /// <param name="endpoint">Address of the resource being accessed.</param>
        /// <param name="httpClient">The client used to perform HTTP operations.</param>
        public PartnerServiceClient(IPartner rootPartnerOperations, Uri endpoint, HttpClient httpClient)
            : base(httpClient, false)
        {
            rootPartnerOperations.AssertNotNull(nameof(rootPartnerOperations));
            endpoint.AssertNotNull(nameof(endpoint));
            httpClient.AssertNotNull(nameof(httpClient));

            Endpoint = endpoint;
            this.rootPartnerOperations = rootPartnerOperations;
        }
Пример #31
0
 public HomeController(IPartner service)
 {
     _service = service;
 }
Пример #32
0
 public Partner(IPartner service)
 {
     _service = service;
 }