예제 #1
0
        private void btnSubscriberUpdate_Click(object sender, EventArgs e)
        {
            var sub = SubscriberHelper.GetSubscribers().Where(x => x.ToString().Equals(lbSubscribers.SelectedItem)).FirstOrDefault();

            var form = new SubscriberUpdate(sub);

            form.FormClosed += delegate { LoadSubscribers(); };
            form.ShowDialog();
        }
예제 #2
0
        public async Task UpdateSubscriber()
        {
            const string requestLocation =
                "/v0/developmentEvents/subscribers/amzn1.ask-subscriber.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
            var management = new ManagementApi("xxx", new ActionHandler(async req =>
            {
                Assert.Equal(HttpMethod.Put, req.Method);
                Assert.Equal(requestLocation, req.RequestUri.PathAndQuery);
                var raw     = await req.Content.ReadAsStringAsync();
                var request = JsonConvert.DeserializeObject <SubscriberUpdate>(raw);
                Assert.True(Utility.CompareJson(request, "CreateSubscriberRequest.json", "vendorId"));
            }, HttpStatusCode.NoContent));

            var subscriptionRequest = new SubscriberUpdate
            {
                Name     = "Example Development Event Subscriber",
                Endpoint = new SubscriptionEndpoint(
                    "arn:aws:sns:us-east-2:000011122233:ExampleSNSTopic",
                    "arn:aws:iam::000011122233:role/ExampleIAMRole")
            };

            await management.SkillDevelopment.Subscriber.Update("amzn1.ask-subscriber.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", subscriptionRequest);
        }
예제 #3
0
        /// <summary>
        /// Update This updates the entity with the given properties. Only those properties which should be updated can be provided. The &#39;id&#39; and &#39;version&#39; are required to identify the entity.
        /// </summary>
        /// <exception cref="TrustPayments.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="spaceId"></param>
        /// <param name="entity">The customer with all the properties which should be updated. The id and the version are required properties.</param>
        /// <returns>ApiResponse of Subscriber</returns>
        public ApiResponse <Subscriber> UpdateWithHttpInfo(long?spaceId, SubscriberUpdate entity)
        {
            // verify the required parameter 'spaceId' is set
            if (spaceId == null)
            {
                throw new ApiException(400, "Missing required parameter 'spaceId' when calling SubscriberService->Update");
            }
            // verify the required parameter 'entity' is set
            if (entity == null)
            {
                throw new ApiException(400, "Missing required parameter 'entity' when calling SubscriberService->Update");
            }

            var    localVarPath         = "/subscriber/update";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json;charset=utf-8"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json;charset=utf-8"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (spaceId != null)
            {
                localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "spaceId", spaceId));                  // query parameter
            }
            if (entity != null && entity.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(entity); // http body (model) parameter
            }
            else
            {
                localVarPostBody = entity; // byte array
            }


            this.Configuration.ApiClient.ResetTimeout();
            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath,
                                                                                                 Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                 localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("Update", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Subscriber>(localVarStatusCode,
                                                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                (Subscriber)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Subscriber))));
        }
예제 #4
0
        /// <summary>
        /// Update This updates the entity with the given properties. Only those properties which should be updated can be provided. The &#39;id&#39; and &#39;version&#39; are required to identify the entity.
        /// </summary>
        /// <exception cref="TrustPayments.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="spaceId"></param>
        /// <param name="entity">The customer with all the properties which should be updated. The id and the version are required properties.</param>
        /// <returns>Subscriber</returns>
        public Subscriber Update(long?spaceId, SubscriberUpdate entity)
        {
            ApiResponse <Subscriber> localVarResponse = UpdateWithHttpInfo(spaceId, entity);

            return(localVarResponse.Data);
        }
예제 #5
0
        public async Task Update(string subscriberId, SubscriberUpdate subscriberDetails)
        {
            var response = await Client.UpdateSubscriber(subscriberId, subscriberDetails);

            await response.CodeOrError(HttpStatusCode.NoContent);
        }