putProcurementPortalPreference method

Future<PutProcurementPortalPreferenceResponse> putProcurementPortalPreference({
  1. required List<Contact> contacts,
  2. required bool einvoiceDeliveryEnabled,
  3. required String procurementPortalPreferenceArn,
  4. required bool purchaseOrderRetrievalEnabled,
  5. String? clientToken,
  6. EinvoiceDeliveryPreference? einvoiceDeliveryPreference,
  7. String? procurementPortalInstanceEndpoint,
  8. String? procurementPortalSharedSecret,
  9. ProcurementPortalPreferenceSelector? selector,
  10. TestEnvPreferenceInput? testEnvPreference,
})

This feature API is subject to changing at any time. For more information, see the Amazon Web Services Service Terms (Betas and Previews).

Updates an existing procurement portal preference configuration. This operation can modify settings for e-invoice delivery and purchase order retrieval.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter contacts : Updated list of contact information for portal administrators and technical contacts.

Parameter einvoiceDeliveryEnabled : Updated flag indicating whether e-invoice delivery is enabled for this procurement portal preference.

Parameter procurementPortalPreferenceArn : The Amazon Resource Name (ARN) of the procurement portal preference to update.

Parameter purchaseOrderRetrievalEnabled : Updated flag indicating whether purchase order retrieval is enabled for this procurement portal preference.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure idempotency of the request.

Parameter einvoiceDeliveryPreference : Updated e-invoice delivery configuration including document types, attachment types, and customization settings for the portal.

Parameter procurementPortalInstanceEndpoint : The updated endpoint URL where e-invoices will be delivered to the procurement portal. Must be a valid HTTPS URL.

Parameter procurementPortalSharedSecret : The updated shared secret or authentication credential for the procurement portal. This value must be encrypted at rest.

Parameter testEnvPreference : Updated configuration settings for the test environment of the procurement portal.

Implementation

Future<PutProcurementPortalPreferenceResponse>
    putProcurementPortalPreference({
  required List<Contact> contacts,
  required bool einvoiceDeliveryEnabled,
  required String procurementPortalPreferenceArn,
  required bool purchaseOrderRetrievalEnabled,
  String? clientToken,
  EinvoiceDeliveryPreference? einvoiceDeliveryPreference,
  String? procurementPortalInstanceEndpoint,
  String? procurementPortalSharedSecret,
  ProcurementPortalPreferenceSelector? selector,
  TestEnvPreferenceInput? testEnvPreference,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Invoicing.PutProcurementPortalPreference'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Contacts': contacts,
      'EinvoiceDeliveryEnabled': einvoiceDeliveryEnabled,
      'ProcurementPortalPreferenceArn': procurementPortalPreferenceArn,
      'PurchaseOrderRetrievalEnabled': purchaseOrderRetrievalEnabled,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (einvoiceDeliveryPreference != null)
        'EinvoiceDeliveryPreference': einvoiceDeliveryPreference,
      if (procurementPortalInstanceEndpoint != null)
        'ProcurementPortalInstanceEndpoint':
            procurementPortalInstanceEndpoint,
      if (procurementPortalSharedSecret != null)
        'ProcurementPortalSharedSecret': procurementPortalSharedSecret,
      if (selector != null) 'Selector': selector,
      if (testEnvPreference != null) 'TestEnvPreference': testEnvPreference,
    },
  );

  return PutProcurementPortalPreferenceResponse.fromJson(jsonResponse.body);
}