/// <summary> /// Retrieves the agreements for a particular resource version of a listing. /// </summary> /// <param name="request"></param> /// <returns></returns> public GetAppCatalogListingAgreementsResponse GetAppCatalogListingAgreements(GetAppCatalogListingAgreementsRequest request) { var uri = new Uri($"{GetEndPoint(CoreServices.AppCatalogListings, this.Region)}/{request.ListingId}/resourceVersions/{request.ResourceVersion}/agreements"); using (var webResponse = this.RestClient.Get(uri)) using (var stream = webResponse.GetResponseStream()) using (var reader = new StreamReader(stream)) { var response = reader.ReadToEnd(); return(new GetAppCatalogListingAgreementsResponse() { AppCatalogListingResourceVersionAgreements = this.JsonSerializer.Deserialize <AppCatalogListingResourceVersionAgreements>(response), ETag = webResponse.Headers.Get("etag"), OpcRequestId = webResponse.Headers.Get("opc-request-id") }); } }
protected override void ProcessRecord() { base.ProcessRecord(); GetAppCatalogListingAgreementsRequest request; try { request = new GetAppCatalogListingAgreementsRequest { ListingId = ListingId, ResourceVersion = ResourceVersion }; response = client.GetAppCatalogListingAgreements(request).GetAwaiter().GetResult(); WriteOutput(response, response.AppCatalogListingResourceVersionAgreements); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }