Touchstone Re 2023 API Reference
UpdateLocation Method
Example 


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

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

Updates an existing Touchstone® Location, including any associated Location Terms.
Syntax
Public Function UpdateLocation( _
   ByVal request As UpdateLocationRequest _
) As UpdateLocationResponse
Dim instance As ExposureManagementServiceClient
Dim request As UpdateLocationRequest
Dim value As UpdateLocationResponse
 
value = instance.UpdateLocation(request)
public UpdateLocationResponse UpdateLocation( 
   UpdateLocationRequest request
)

Parameters

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

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

Return Value

An UpdateLocationResponse containing the Location SID of the updated Location, along with the updated geocode match level for this updated Location.
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 update a Location, perform the following steps:

  1. Get the Location that you want to update by calling the GetLocation() method.
  2. Update the Location with the desired changes.
  3. Pass the updated Location object from the previous step as part of the UpdateLocationRequest object for the UpdateLocation() method.
Example
The following example shows how to update a Touchstone Location using the UpdateLocation() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.Common.Exposure.Data;
using AIR.Services.ExposureManagement.Api;
            
class SnippetUpdateLocationRequest
{
    private static void UpdateLocation(int businessUnitSid, int sqlInstanceSid, int dataSourceSid, int expoureSetSid, int locationSid)
    {
        ExposureManagementServiceClient exposureManagementClient = new ExposureManagementServiceClient();
        GetLocationRequest request = new GetLocationRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.LocationSid = locationSid;
            
        request.ExposureSet = new ExposureSet
        {
            Sid = expoureSetSid,
            DataSourceSid = dataSourceSid
        };
        GetLocationResponse response = exposureManagementClient.GetLocation(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            Location location = response.Location;
            UpdateLocationRequest updateRequest = new UpdateLocationRequest();
            updateRequest.BusinessUnitSid = businessUnitSid;
            updateRequest.SqlInstanceSid = sqlInstanceSid;
            
            location.ID = location.ID + "_" + DateTime.Now.Ticks;
            location.YearBuilt = 2015;
           
            location.Terms.Add(
                    new LocationTerm()
                    {
                        Perils = PerilSetCode.TropicalCyclone,
                        Participation = 1,
                        CededParticipation = 1,
                        Deductible = new LocationCoverageDeductible
                        {
                            DeductibleBuilding = 300,
                            DeductibleBusinessInterruption = 23000,
                            DeductibleContents = 25000,
                            DeductibleOther = 75000
                        },
                        Limit = new LocationCoverageLimit
                        {
                            LimitBuilding = 52000,
                            LimitBusinessInterruption = 62000,
                            LimitContents = 72000,
                        }
                    }
                );
            
            updateRequest.Location = location;
            
            UpdateLocationResponse updateResponse = exposureManagementClient.UpdateLocation(updateRequest);
            
            if (updateResponse.Status.Code == StatusCode.Success)
            {
                Console.WriteLine("Location updated successfully");
            }
        }
    }
}
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