Touchstone Re 2023 API Reference
UpdateLayer Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ExposureManagementServiceClient Class : UpdateLayer Method
Contains an UpdateLayerRequest that identifies the updated properties of the Layer that you want to update, along with the associated Touchstone-generated Contract Sequential Identifier (SID), Business Unit SID and SQL Instance SID.

Note: To maintain, update, or add associated Sublimits, you must provide these identical (including identical Sublimit SIDs), modified (including identical Sublimit SIDs), or new (no Sublimit SIDs) Sublimits in the UpdateLayerRequest. Any existing Sublimits that you do not supply in the UpdateLayerRequest are deleted.

Updates an existing Touchstone® Layer, including any associated Sublimits.
Syntax
Public Function UpdateLayer( _
   ByVal request As UpdateLayerRequest _
) As UpdateLayerResponse
Dim instance As ExposureManagementServiceClient
Dim request As UpdateLayerRequest
Dim value As UpdateLayerResponse
 
value = instance.UpdateLayer(request)
public UpdateLayerResponse UpdateLayer( 
   UpdateLayerRequest request
)

Parameters

request
Contains an UpdateLayerRequest that identifies the updated properties of the Layer that you want to update, along with the associated Touchstone-generated Contract Sequential Identifier (SID), Business Unit SID and SQL Instance SID.

Note: To maintain, update, or add associated Sublimits, you must provide these identical (including identical Sublimit SIDs), modified (including identical Sublimit SIDs), or new (no Sublimit SIDs) Sublimits in the UpdateLayerRequest. Any existing Sublimits that you do not supply in the UpdateLayerRequest are deleted.

Return Value

An UpdateLayerResponse containing the Layer SID of the updated Layer.
Remarks
To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

To find the Contract SID to pass into this method, call the GetContracts() method.

To update a Layer, perform the following steps:

  1. Get the Layer that you want to update by calling the GetLayer() method.
  2. Update the Layer with the desired changes.
  3. Pass the updated Layer object from the previous step as part of the UpdateLayerRequest object for the UpdateLayer() method.
Example
The following example shows how to update a Touchstone Layer using the UpdateLayer() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
            
class SnippetUpdateLayerRequest
{
    private static void UpdateLayer(int businessUnitSid, int sqlInstanceSid, int layerSid, int dataSourceSid, int contractSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
           
        GetLayerRequest request = new GetLayerRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.LayerSid = layerSid;
        request.DataSourceSid = dataSourceSid;
            
        GetLayerResponse response = exposureManagementClient.GetLayer(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            Layer obj = response.Layer;
            
            obj.Sublimits.Add(
                new Sublimit
                {
                    Perils = PerilSetCode.TropicalCyclone | PerilSetCode.Earthquake,
                    Limit = new SublimitBlanketLimit
                    {
                        AttachmentPoint = 70000,
                        TotalLimit = 7000000,
                    },
                    Deductible = new SublimitMaximumDeductible
                    {
                        MaximumDeductible = 77000
                    },
                }
            );
            
            UpdateLayerRequest upd_req = new UpdateLayerRequest();
            upd_req.BusinessUnitSid = businessUnitSid;
            upd_req.SqlInstanceSid = sqlInstanceSid;
            upd_req.ContractSid = contractSid;
            upd_req.Layer = obj;
            
            UpdateLayerResponse upd_res = exposureManagementClient.UpdateLayer(upd_req);
               
            if (upd_res.Status.Code == StatusCode.Success)
            {
                Console.WriteLine("Successfully updated the Layer");
            }
        }
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ExposureManagementServiceClient Class
ExposureManagementServiceClient Members