def Patch(self, perimeter_ref, description=None, title=None, perimeter_type=None, resources=None, restricted_services=None, unrestricted_services=None, levels=None, ingress_allowed_services=None, vpc_allowed_services=None, bridge_allowed_services=None, enable_ingress_service_restriction=None, enable_vpc_service_restriction=None, enable_bridge_service_restriction=None, apply_to_dry_run_config=False, clear_dry_run=False):
    "Patch a service perimeter.\n\n    Args:\n      perimeter_ref: resources.Resource, reference to the perimeter to patch\n      description: str, description of the zone or None if not updating\n      title: str, title of the zone or None if not updating\n      perimeter_type: PerimeterTypeValueValuesEnum type enum value for the level\n        or None if not updating\n      resources: list of str, the names of resources (for now, just\n        'projects/...') in the zone or None if not updating.\n      restricted_services: list of str, the names of services\n        ('example.googleapis.com') that *are* restricted by the access zone or\n        None if not updating.\n      unrestricted_services: list of str, the names of services\n        ('example.googleapis.com') that *are not* restricted by the access zone\n        or None if not updating.\n      levels: list of Resource, the access levels (in the same policy) that must\n        be satisfied for calls into this zone or None if not updating.\n      ingress_allowed_services: list of str, the names of services\n        ('example.googleapis.com') that *are* allowed to use Access Levels to\n        make a cross access zone boundary call, or None if not updating.\n      vpc_allowed_services: list of str, the names of services\n        ('example.googleapis.com') that *are* allowed to be made within the\n        access zone, or None if not updating.\n      bridge_allowed_services: list of str, the names of services\n        ('example.googleapis.com') that *are* allowed to use the bridge access\n        zone, or None if not updating.\n      enable_ingress_service_restriction: bool, whether to restrict the set of\n        APIs callable outside the access zone via Access Levels, or None if not\n        updating.\n      enable_vpc_service_restriction: bool, whether to restrict the set of APIs\n        callable within the access zone, or None if not updating.\n      enable_bridge_service_restriction: bool, whether to restrict the set of\n        APIs callable using the bridge access zone, or None if not updating.\n      apply_to_dry_run_config: When true, the configuration will be place in the\n        'spec' field instead of the 'status' field of the Service Perimeter.\n      clear_dry_run: When true, the ServicePerimeterConfig field for dry-run\n        (i.e. 'spec') will be cleared and dryRun will be set to False.\n\n    Returns:\n      ServicePerimeter, the updated Service Perimeter.\n    "
    m = self.messages
    perimeter = m.ServicePerimeter()
    update_mask = []
    if (description is not None):
        update_mask.append('description')
        perimeter.description = description
    if (title is not None):
        update_mask.append('title')
        perimeter.title = title
    if (perimeter_type is not None):
        update_mask.append('perimeterType')
        perimeter.perimeterType = perimeter_type
    if (not clear_dry_run):
        mask_prefix = ('status' if (not apply_to_dry_run_config) else 'spec')
        (config, config_mask_additions) = _CreateServicePerimeterConfig(m, mask_prefix, self.include_unrestricted_services, resources, restricted_services, unrestricted_services, levels, ingress_allowed_services, vpc_allowed_services, bridge_allowed_services, enable_ingress_service_restriction, enable_vpc_service_restriction, enable_bridge_service_restriction)
        if (not apply_to_dry_run_config):
            perimeter.status = config
        else:
            perimeter.dryRun = True
            perimeter.spec = config
        update_mask += config_mask_additions
        if (apply_to_dry_run_config and config_mask_additions):
            update_mask.append('dryRun')
    else:
        update_mask.append('spec')
        update_mask.append('dryRun')
        perimeter.spec = None
        perimeter.dryRun = False
    update_mask.sort()
    if (not update_mask):
        log.warning('The update specified results in an identical resource. Skipping request.')
        return perimeter
    request_type = m.AccesscontextmanagerAccessPoliciesServicePerimetersPatchRequest
    request = request_type(servicePerimeter=perimeter, name=perimeter_ref.RelativeName(), updateMask=','.join(update_mask))
    operation = self.client.accessPolicies_servicePerimeters.Patch(request)
    poller = util.OperationPoller(self.client.accessPolicies_servicePerimeters, self.client.operations, perimeter_ref)
    operation_ref = core_resources.REGISTRY.Parse(operation.name, collection='accesscontextmanager.operations')
    return waiter.WaitFor(poller, operation_ref, 'Waiting for PATCH operation [{}]'.format(operation_ref.Name()))
Patch a service perimeter.

Args:
  perimeter_ref: resources.Resource, reference to the perimeter to patch
  description: str, description of the zone or None if not updating
  title: str, title of the zone or None if not updating
  perimeter_type: PerimeterTypeValueValuesEnum type enum value for the level
    or None if not updating
  resources: list of str, the names of resources (for now, just
    'projects/...') in the zone or None if not updating.
  restricted_services: list of str, the names of services
    ('example.googleapis.com') that *are* restricted by the access zone or
    None if not updating.
  unrestricted_services: list of str, the names of services
    ('example.googleapis.com') that *are not* restricted by the access zone
    or None if not updating.
  levels: list of Resource, the access levels (in the same policy) that must
    be satisfied for calls into this zone or None if not updating.
  ingress_allowed_services: list of str, the names of services
    ('example.googleapis.com') that *are* allowed to use Access Levels to
    make a cross access zone boundary call, or None if not updating.
  vpc_allowed_services: list of str, the names of services
    ('example.googleapis.com') that *are* allowed to be made within the
    access zone, or None if not updating.
  bridge_allowed_services: list of str, the names of services
    ('example.googleapis.com') that *are* allowed to use the bridge access
    zone, or None if not updating.
  enable_ingress_service_restriction: bool, whether to restrict the set of
    APIs callable outside the access zone via Access Levels, or None if not
    updating.
  enable_vpc_service_restriction: bool, whether to restrict the set of APIs
    callable within the access zone, or None if not updating.
  enable_bridge_service_restriction: bool, whether to restrict the set of
    APIs callable using the bridge access zone, or None if not updating.
  apply_to_dry_run_config: When true, the configuration will be place in the
    'spec' field instead of the 'status' field of the Service Perimeter.
  clear_dry_run: When true, the ServicePerimeterConfig field for dry-run
    (i.e. 'spec') will be cleared and dryRun will be set to False.

Returns:
  ServicePerimeter, the updated Service Perimeter.
def Patch(self, perimeter_ref, description=None, title=None, perimeter_type=None, resources=None, restricted_services=None, unrestricted_services=None, levels=None, ingress_allowed_services=None, vpc_allowed_services=None, bridge_allowed_services=None, enable_ingress_service_restriction=None, enable_vpc_service_restriction=None, enable_bridge_service_restriction=None, apply_to_dry_run_config=False, clear_dry_run=False):
    "Patch a service perimeter.\n\n    Args:\n      perimeter_ref: resources.Resource, reference to the perimeter to patch\n      description: str, description of the zone or None if not updating\n      title: str, title of the zone or None if not updating\n      perimeter_type: PerimeterTypeValueValuesEnum type enum value for the level\n        or None if not updating\n      resources: list of str, the names of resources (for now, just\n        'projects/...') in the zone or None if not updating.\n      restricted_services: list of str, the names of services\n        ('example.googleapis.com') that *are* restricted by the access zone or\n        None if not updating.\n      unrestricted_services: list of str, the names of services\n        ('example.googleapis.com') that *are not* restricted by the access zone\n        or None if not updating.\n      levels: list of Resource, the access levels (in the same policy) that must\n        be satisfied for calls into this zone or None if not updating.\n      ingress_allowed_services: list of str, the names of services\n        ('example.googleapis.com') that *are* allowed to use Access Levels to\n        make a cross access zone boundary call, or None if not updating.\n      vpc_allowed_services: list of str, the names of services\n        ('example.googleapis.com') that *are* allowed to be made within the\n        access zone, or None if not updating.\n      bridge_allowed_services: list of str, the names of services\n        ('example.googleapis.com') that *are* allowed to use the bridge access\n        zone, or None if not updating.\n      enable_ingress_service_restriction: bool, whether to restrict the set of\n        APIs callable outside the access zone via Access Levels, or None if not\n        updating.\n      enable_vpc_service_restriction: bool, whether to restrict the set of APIs\n        callable within the access zone, or None if not updating.\n      enable_bridge_service_restriction: bool, whether to restrict the set of\n        APIs callable using the bridge access zone, or None if not updating.\n      apply_to_dry_run_config: When true, the configuration will be place in the\n        'spec' field instead of the 'status' field of the Service Perimeter.\n      clear_dry_run: When true, the ServicePerimeterConfig field for dry-run\n        (i.e. 'spec') will be cleared and dryRun will be set to False.\n\n    Returns:\n      ServicePerimeter, the updated Service Perimeter.\n    "
    m = self.messages
    perimeter = m.ServicePerimeter()
    update_mask = []
    if (description is not None):
        update_mask.append('description')
        perimeter.description = description
    if (title is not None):
        update_mask.append('title')
        perimeter.title = title
    if (perimeter_type is not None):
        update_mask.append('perimeterType')
        perimeter.perimeterType = perimeter_type
    if (not clear_dry_run):
        mask_prefix = ('status' if (not apply_to_dry_run_config) else 'spec')
        (config, config_mask_additions) = _CreateServicePerimeterConfig(m, mask_prefix, self.include_unrestricted_services, resources, restricted_services, unrestricted_services, levels, ingress_allowed_services, vpc_allowed_services, bridge_allowed_services, enable_ingress_service_restriction, enable_vpc_service_restriction, enable_bridge_service_restriction)
        if (not apply_to_dry_run_config):
            perimeter.status = config
        else:
            perimeter.dryRun = True
            perimeter.spec = config
        update_mask += config_mask_additions
        if (apply_to_dry_run_config and config_mask_additions):
            update_mask.append('dryRun')
    else:
        update_mask.append('spec')
        update_mask.append('dryRun')
        perimeter.spec = None
        perimeter.dryRun = False
    update_mask.sort()
    if (not update_mask):
        log.warning('The update specified results in an identical resource. Skipping request.')
        return perimeter
    request_type = m.AccesscontextmanagerAccessPoliciesServicePerimetersPatchRequest
    request = request_type(servicePerimeter=perimeter, name=perimeter_ref.RelativeName(), updateMask=','.join(update_mask))
    operation = self.client.accessPolicies_servicePerimeters.Patch(request)
    poller = util.OperationPoller(self.client.accessPolicies_servicePerimeters, self.client.operations, perimeter_ref)
    operation_ref = core_resources.REGISTRY.Parse(operation.name, collection='accesscontextmanager.operations')
    return waiter.WaitFor(poller, operation_ref, 'Waiting for PATCH operation [{}]'.format(operation_ref.Name()))