@@ -203,6 +203,16 @@ public partial class BillingManagementClient : ServiceClient<BillingManagementCl
203203 /// </summary>
204204 public virtual ITransactionsByBillingAccountOperations TransactionsByBillingAccount { get ; private set ; }
205205
206+ /// <summary>
207+ /// Gets the ITransactionsByBillingProfileOperations.
208+ /// </summary>
209+ public virtual ITransactionsByBillingProfileOperations TransactionsByBillingProfile { get ; private set ; }
210+
211+ /// <summary>
212+ /// Gets the ITransactionsByInvoiceSectionOperations.
213+ /// </summary>
214+ public virtual ITransactionsByInvoiceSectionOperations TransactionsByInvoiceSection { get ; private set ; }
215+
206216 /// <summary>
207217 /// Gets the IPolicyOperations.
208218 /// </summary>
@@ -273,6 +283,11 @@ public partial class BillingManagementClient : ServiceClient<BillingManagementCl
273283 /// </summary>
274284 public virtual IBillingProfileBillingRoleAssignmentOperations BillingProfileBillingRoleAssignment { get ; private set ; }
275285
286+ /// <summary>
287+ /// Gets the IAgreementsOperations.
288+ /// </summary>
289+ public virtual IAgreementsOperations Agreements { get ; private set ; }
290+
276291 /// <summary>
277292 /// Initializes a new instance of the BillingManagementClient class.
278293 /// </summary>
@@ -539,6 +554,8 @@ private void Initialize()
539554 ProductsByInvoiceSection = new ProductsByInvoiceSectionOperations ( this ) ;
540555 Products = new ProductsOperations ( this ) ;
541556 TransactionsByBillingAccount = new TransactionsByBillingAccountOperations ( this ) ;
557+ TransactionsByBillingProfile = new TransactionsByBillingProfileOperations ( this ) ;
558+ TransactionsByInvoiceSection = new TransactionsByInvoiceSectionOperations ( this ) ;
542559 Policy = new PolicyOperations ( this ) ;
543560 BillingProperty = new BillingPropertyOperations ( this ) ;
544561 Transfers = new TransfersOperations ( this ) ;
@@ -553,6 +570,7 @@ private void Initialize()
553570 BillingAccountBillingRoleAssignment = new BillingAccountBillingRoleAssignmentOperations ( this ) ;
554571 InvoiceSectionBillingRoleAssignment = new InvoiceSectionBillingRoleAssignmentOperations ( this ) ;
555572 BillingProfileBillingRoleAssignment = new BillingProfileBillingRoleAssignmentOperations ( this ) ;
573+ Agreements = new AgreementsOperations ( this ) ;
556574 BaseUri = new System . Uri ( "https://management.azure.com" ) ;
557575 ApiVersion = "2018-11-01-preview" ;
558576 AcceptLanguage = "en-US" ;
@@ -588,229 +606,6 @@ private void Initialize()
588606 DeserializationSettings . Converters . Add ( new TransformationJsonConverter ( ) ) ;
589607 DeserializationSettings . Converters . Add ( new CloudErrorJsonConverter ( ) ) ;
590608 }
591- /// <summary>
592- /// Lists the transactions by billingProfileName for given start date and end
593- /// date.
594- /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" />
595- /// </summary>
596- /// <param name='billingAccountName'>
597- /// billing Account Id.
598- /// </param>
599- /// <param name='billingProfileName'>
600- /// Billing Profile Id.
601- /// </param>
602- /// <param name='startDate'>
603- /// Start date
604- /// </param>
605- /// <param name='endDate'>
606- /// End date
607- /// </param>
608- /// <param name='filter'>
609- /// May be used to filter by transaction kind. The filter supports 'eq', 'lt',
610- /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or
611- /// 'not'. Tag filter is a key value pair string where key and value is
612- /// separated by a colon (:).
613- /// </param>
614- /// <param name='customHeaders'>
615- /// Headers that will be added to request.
616- /// </param>
617- /// <param name='cancellationToken'>
618- /// The cancellation token.
619- /// </param>
620- /// <exception cref="ErrorResponseException">
621- /// Thrown when the operation returned an invalid status code
622- /// </exception>
623- /// <exception cref="SerializationException">
624- /// Thrown when unable to deserialize the response
625- /// </exception>
626- /// <exception cref="ValidationException">
627- /// Thrown when a required parameter is null
628- /// </exception>
629- /// <exception cref="System.ArgumentNullException">
630- /// Thrown when a required parameter is null
631- /// </exception>
632- /// <return>
633- /// A response object containing the response body and response headers.
634- /// </return>
635- public async Task < AzureOperationResponse < TransactionsListResult > > TransactionsByBillingProfileWithHttpMessagesAsync ( string billingAccountName , string billingProfileName , string startDate , string endDate , string filter = default ( string ) , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
636- {
637- if ( billingAccountName == null )
638- {
639- throw new ValidationException ( ValidationRules . CannotBeNull , "billingAccountName" ) ;
640- }
641- if ( billingProfileName == null )
642- {
643- throw new ValidationException ( ValidationRules . CannotBeNull , "billingProfileName" ) ;
644- }
645- if ( ApiVersion == null )
646- {
647- throw new ValidationException ( ValidationRules . CannotBeNull , "this.ApiVersion" ) ;
648- }
649- if ( startDate == null )
650- {
651- throw new ValidationException ( ValidationRules . CannotBeNull , "startDate" ) ;
652- }
653- if ( endDate == null )
654- {
655- throw new ValidationException ( ValidationRules . CannotBeNull , "endDate" ) ;
656- }
657- // Tracing
658- bool _shouldTrace = ServiceClientTracing . IsEnabled ;
659- string _invocationId = null ;
660- if ( _shouldTrace )
661- {
662- _invocationId = ServiceClientTracing . NextInvocationId . ToString ( ) ;
663- Dictionary < string , object > tracingParameters = new Dictionary < string , object > ( ) ;
664- tracingParameters . Add ( "billingAccountName" , billingAccountName ) ;
665- tracingParameters . Add ( "billingProfileName" , billingProfileName ) ;
666- tracingParameters . Add ( "startDate" , startDate ) ;
667- tracingParameters . Add ( "endDate" , endDate ) ;
668- tracingParameters . Add ( "filter" , filter ) ;
669- tracingParameters . Add ( "cancellationToken" , cancellationToken ) ;
670- ServiceClientTracing . Enter ( _invocationId , this , "TransactionsByBillingProfile" , tracingParameters ) ;
671- }
672- // Construct URL
673- var _baseUrl = BaseUri . AbsoluteUri ;
674- var _url = new System . Uri ( new System . Uri ( _baseUrl + ( _baseUrl . EndsWith ( "/" ) ? "" : "/" ) ) , "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/transactions" ) . ToString ( ) ;
675- _url = _url . Replace ( "{billingAccountName}" , System . Uri . EscapeDataString ( billingAccountName ) ) ;
676- _url = _url . Replace ( "{billingProfileName}" , System . Uri . EscapeDataString ( billingProfileName ) ) ;
677- List < string > _queryParameters = new List < string > ( ) ;
678- if ( ApiVersion != null )
679- {
680- _queryParameters . Add ( string . Format ( "api-version={0}" , System . Uri . EscapeDataString ( ApiVersion ) ) ) ;
681- }
682- if ( startDate != null )
683- {
684- _queryParameters . Add ( string . Format ( "startDate={0}" , System . Uri . EscapeDataString ( startDate ) ) ) ;
685- }
686- if ( endDate != null )
687- {
688- _queryParameters . Add ( string . Format ( "endDate={0}" , System . Uri . EscapeDataString ( endDate ) ) ) ;
689- }
690- if ( filter != null )
691- {
692- _queryParameters . Add ( string . Format ( "$filter={0}" , System . Uri . EscapeDataString ( filter ) ) ) ;
693- }
694- if ( _queryParameters . Count > 0 )
695- {
696- _url += ( _url . Contains ( "?" ) ? "&" : "?" ) + string . Join ( "&" , _queryParameters ) ;
697- }
698- // Create HTTP transport objects
699- var _httpRequest = new HttpRequestMessage ( ) ;
700- HttpResponseMessage _httpResponse = null ;
701- _httpRequest . Method = new HttpMethod ( "GET" ) ;
702- _httpRequest . RequestUri = new System . Uri ( _url ) ;
703- // Set Headers
704- if ( GenerateClientRequestId != null && GenerateClientRequestId . Value )
705- {
706- _httpRequest . Headers . TryAddWithoutValidation ( "x-ms-client-request-id" , System . Guid . NewGuid ( ) . ToString ( ) ) ;
707- }
708- if ( AcceptLanguage != null )
709- {
710- if ( _httpRequest . Headers . Contains ( "accept-language" ) )
711- {
712- _httpRequest . Headers . Remove ( "accept-language" ) ;
713- }
714- _httpRequest . Headers . TryAddWithoutValidation ( "accept-language" , AcceptLanguage ) ;
715- }
716-
717-
718- if ( customHeaders != null )
719- {
720- foreach ( var _header in customHeaders )
721- {
722- if ( _httpRequest . Headers . Contains ( _header . Key ) )
723- {
724- _httpRequest . Headers . Remove ( _header . Key ) ;
725- }
726- _httpRequest . Headers . TryAddWithoutValidation ( _header . Key , _header . Value ) ;
727- }
728- }
729-
730- // Serialize Request
731- string _requestContent = null ;
732- // Set Credentials
733- if ( Credentials != null )
734- {
735- cancellationToken . ThrowIfCancellationRequested ( ) ;
736- await Credentials . ProcessHttpRequestAsync ( _httpRequest , cancellationToken ) . ConfigureAwait ( false ) ;
737- }
738- // Send Request
739- if ( _shouldTrace )
740- {
741- ServiceClientTracing . SendRequest ( _invocationId , _httpRequest ) ;
742- }
743- cancellationToken . ThrowIfCancellationRequested ( ) ;
744- _httpResponse = await HttpClient . SendAsync ( _httpRequest , cancellationToken ) . ConfigureAwait ( false ) ;
745- if ( _shouldTrace )
746- {
747- ServiceClientTracing . ReceiveResponse ( _invocationId , _httpResponse ) ;
748- }
749- HttpStatusCode _statusCode = _httpResponse . StatusCode ;
750- cancellationToken . ThrowIfCancellationRequested ( ) ;
751- string _responseContent = null ;
752- if ( ( int ) _statusCode != 200 )
753- {
754- var ex = new ErrorResponseException ( string . Format ( "Operation returned an invalid status code '{0}'" , _statusCode ) ) ;
755- try
756- {
757- _responseContent = await _httpResponse . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
758- ErrorResponse _errorBody = SafeJsonConvert . DeserializeObject < ErrorResponse > ( _responseContent , DeserializationSettings ) ;
759- if ( _errorBody != null )
760- {
761- ex . Body = _errorBody ;
762- }
763- }
764- catch ( JsonException )
765- {
766- // Ignore the exception
767- }
768- ex . Request = new HttpRequestMessageWrapper ( _httpRequest , _requestContent ) ;
769- ex . Response = new HttpResponseMessageWrapper ( _httpResponse , _responseContent ) ;
770- if ( _shouldTrace )
771- {
772- ServiceClientTracing . Error ( _invocationId , ex ) ;
773- }
774- _httpRequest . Dispose ( ) ;
775- if ( _httpResponse != null )
776- {
777- _httpResponse . Dispose ( ) ;
778- }
779- throw ex ;
780- }
781- // Create Result
782- var _result = new AzureOperationResponse < TransactionsListResult > ( ) ;
783- _result . Request = _httpRequest ;
784- _result . Response = _httpResponse ;
785- if ( _httpResponse . Headers . Contains ( "x-ms-request-id" ) )
786- {
787- _result . RequestId = _httpResponse . Headers . GetValues ( "x-ms-request-id" ) . FirstOrDefault ( ) ;
788- }
789- // Deserialize Response
790- if ( ( int ) _statusCode == 200 )
791- {
792- _responseContent = await _httpResponse . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
793- try
794- {
795- _result . Body = SafeJsonConvert . DeserializeObject < TransactionsListResult > ( _responseContent , DeserializationSettings ) ;
796- }
797- catch ( JsonException ex )
798- {
799- _httpRequest . Dispose ( ) ;
800- if ( _httpResponse != null )
801- {
802- _httpResponse . Dispose ( ) ;
803- }
804- throw new SerializationException ( "Unable to deserialize the response." , _responseContent , ex ) ;
805- }
806- }
807- if ( _shouldTrace )
808- {
809- ServiceClientTracing . Exit ( _invocationId , _result ) ;
810- }
811- return _result ;
812- }
813-
814609 /// <summary>
815610 /// Cancel product by product id
816611 /// </summary>
0 commit comments