updatePortal method

Future<UpdatePortalResponse> updatePortal({
  1. required String portalContactEmail,
  2. required String portalId,
  3. required String portalName,
  4. required String roleArn,
  5. Alarms? alarms,
  6. String? clientToken,
  7. String? notificationSenderEmail,
  8. String? portalDescription,
  9. Image? portalLogoImage,
  10. PortalType? portalType,
  11. Map<String, PortalTypeEntry>? portalTypeConfiguration,
})
Updates an IoT SiteWise Monitor portal.

May throw ConflictingOperationException. May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter portalContactEmail : The Amazon Web Services administrator's contact email address.

Parameter portalId : The ID of the portal to update.

Parameter portalName : A new friendly name for the portal.

Parameter roleArn : The ARN of a service role that allows the portal's users to access your IoT SiteWise resources on your behalf. For more information, see Using service roles for IoT SiteWise Monitor in the IoT SiteWise User Guide.

Parameter alarms : Contains the configuration information of an alarm created in an IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see Monitoring with alarms in the IoT SiteWise Application Guide.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Parameter notificationSenderEmail : The email address that sends alarm notifications.

Parameter portalDescription : A new description for the portal.

Parameter portalType : Define the type of portal. The value for IoT SiteWise Monitor (Classic) is SITEWISE_PORTAL_V1. The value for IoT SiteWise Monitor (AI-aware) is SITEWISE_PORTAL_V2.

Parameter portalTypeConfiguration : The configuration entry associated with the specific portal type. The value for IoT SiteWise Monitor (Classic) is SITEWISE_PORTAL_V1. The value for IoT SiteWise Monitor (AI-aware) is SITEWISE_PORTAL_V2.

Implementation

Future<UpdatePortalResponse> updatePortal({
  required String portalContactEmail,
  required String portalId,
  required String portalName,
  required String roleArn,
  Alarms? alarms,
  String? clientToken,
  String? notificationSenderEmail,
  String? portalDescription,
  Image? portalLogoImage,
  PortalType? portalType,
  Map<String, PortalTypeEntry>? portalTypeConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'portalContactEmail': portalContactEmail,
    'portalName': portalName,
    'roleArn': roleArn,
    if (alarms != null) 'alarms': alarms,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (notificationSenderEmail != null)
      'notificationSenderEmail': notificationSenderEmail,
    if (portalDescription != null) 'portalDescription': portalDescription,
    if (portalLogoImage != null) 'portalLogoImage': portalLogoImage,
    if (portalType != null) 'portalType': portalType.value,
    if (portalTypeConfiguration != null)
      'portalTypeConfiguration': portalTypeConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/portals/${Uri.encodeComponent(portalId)}',
    hostPrefix: 'monitor.',
    exceptionFnMap: _exceptionFns,
  );
  return UpdatePortalResponse.fromJson(response);
}