public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Route53.Model.ListGeoLocationsRequest(); if (cmdletContext.StartContinentCode != null) { request.StartContinentCode = cmdletContext.StartContinentCode; } if (cmdletContext.StartCountryCode != null) { request.StartCountryCode = cmdletContext.StartCountryCode; } if (cmdletContext.StartSubdivisionCode != null) { request.StartSubdivisionCode = cmdletContext.StartSubdivisionCode; } if (cmdletContext.MaxItem != null) { request.MaxItems = cmdletContext.MaxItem; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
private Amazon.Route53.Model.ListGeoLocationsResponse CallAWSServiceOperation(IAmazonRoute53 client, Amazon.Route53.Model.ListGeoLocationsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Route 53", "ListGeoLocations"); try { #if DESKTOP return(client.ListGeoLocations(request)); #elif CORECLR return(client.ListGeoLocationsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// To retrieve a list of supported geo locations, send a <code>GET</code> request to /// the <code>2013-04-01/geolocations</code> resource. The response to this request includes /// a <code>GeoLocationDetailsList</code> element with zero, one, or multiple <code>GeoLocationDetails</code> /// child elements. The list is sorted by country code, and then subdivision code, followed /// by continents at the end of the list. /// /// /// <para> /// By default, the list of geo locations is displayed on a single page. You can control /// the length of the page that is displayed by using the <code>MaxItems</code> parameter. /// If the list is truncated, <code>IsTruncated</code> will be set to <i>true</i> and /// a combination of <code>NextContinentCode, NextCountryCode, NextSubdivisionCode</code> /// will be populated. You can pass these as parameters to <code>StartContinentCode, StartCountryCode, /// StartSubdivisionCode</code> to control the geo location that the list begins with. /// /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListGeoLocations service method.</param> /// /// <returns>The response from the ListGeoLocations service method, as returned by Route53.</returns> /// <exception cref="Amazon.Route53.Model.InvalidInputException"> /// Some value specified in the request is invalid or the XML document is malformed. /// </exception> public ListGeoLocationsResponse ListGeoLocations(ListGeoLocationsRequest request) { var marshaller = new ListGeoLocationsRequestMarshaller(); var unmarshaller = ListGeoLocationsResponseUnmarshaller.Instance; return Invoke<ListGeoLocationsRequest,ListGeoLocationsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ListGeoLocations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListGeoLocations operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<ListGeoLocationsResponse> ListGeoLocationsAsync(ListGeoLocationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListGeoLocationsRequestMarshaller(); var unmarshaller = ListGeoLocationsResponseUnmarshaller.Instance; return InvokeAsync<ListGeoLocationsRequest,ListGeoLocationsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the ListGeoLocations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListGeoLocations operation on AmazonRoute53Client.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListGeoLocations /// operation.</returns> public IAsyncResult BeginListGeoLocations(ListGeoLocationsRequest request, AsyncCallback callback, object state) { var marshaller = new ListGeoLocationsRequestMarshaller(); var unmarshaller = ListGeoLocationsResponseUnmarshaller.Instance; return BeginInvoke<ListGeoLocationsRequest>(request, marshaller, unmarshaller, callback, state); }