in src/eventgrid/azext_eventgrid/aaz/latest/eventgrid/namespace/topic/event_subscription/_update.py [0:0]
def _update_instance(self, instance):
_instance_value, _builder = self.new_content_builder(
self.ctx.args,
value=instance,
typ=AAZObjectType
)
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("deliveryConfiguration", AAZObjectType, ".delivery_configuration")
properties.set_prop("eventDeliverySchema", AAZStrType, ".event_delivery_schema")
properties.set_prop("filtersConfiguration", AAZObjectType, ".filters_configuration")
delivery_configuration = _builder.get(".properties.deliveryConfiguration")
if delivery_configuration is not None:
delivery_configuration.set_prop("deliveryMode", AAZStrType, ".delivery_mode")
delivery_configuration.set_prop("queue", AAZObjectType, ".queue")
queue = _builder.get(".properties.deliveryConfiguration.queue")
if queue is not None:
queue.set_prop("deadLetterDestinationWithResourceIdentity", AAZObjectType, ".dead_letter_destination_with_resource_identity")
queue.set_prop("eventTimeToLive", AAZStrType, ".event_time_to_live")
queue.set_prop("maxDeliveryCount", AAZIntType, ".max_delivery_count")
queue.set_prop("receiveLockDurationInSeconds", AAZIntType, ".receive_lock_duration_in_seconds")
dead_letter_destination_with_resource_identity = _builder.get(".properties.deliveryConfiguration.queue.deadLetterDestinationWithResourceIdentity")
if dead_letter_destination_with_resource_identity is not None:
dead_letter_destination_with_resource_identity.set_prop("deadLetterDestination", AAZObjectType, ".dead_letter_destination")
dead_letter_destination_with_resource_identity.set_prop("identity", AAZObjectType, ".identity")
dead_letter_destination = _builder.get(".properties.deliveryConfiguration.queue.deadLetterDestinationWithResourceIdentity.deadLetterDestination")
if dead_letter_destination is not None:
dead_letter_destination.set_const("endpointType", "StorageBlob", AAZStrType, ".storage_blob", typ_kwargs={"flags": {"required": True}})
dead_letter_destination.discriminate_by("endpointType", "StorageBlob")
disc_storage_blob = _builder.get(".properties.deliveryConfiguration.queue.deadLetterDestinationWithResourceIdentity.deadLetterDestination{endpointType:StorageBlob}")
if disc_storage_blob is not None:
disc_storage_blob.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
properties = _builder.get(".properties.deliveryConfiguration.queue.deadLetterDestinationWithResourceIdentity.deadLetterDestination{endpointType:StorageBlob}.properties")
if properties is not None:
properties.set_prop("blobContainerName", AAZStrType, ".storage_blob.blob_container_name")
properties.set_prop("resourceId", AAZStrType, ".storage_blob.resource_id")
identity = _builder.get(".properties.deliveryConfiguration.queue.deadLetterDestinationWithResourceIdentity.identity")
if identity is not None:
identity.set_prop("type", AAZStrType, ".type")
identity.set_prop("userAssignedIdentity", AAZStrType, ".user_assigned_identity")
filters_configuration = _builder.get(".properties.filtersConfiguration")
if filters_configuration is not None:
filters_configuration.set_prop("filters", AAZListType, ".filters")
filters_configuration.set_prop("includedEventTypes", AAZListType, ".included_event_types")
filters = _builder.get(".properties.filtersConfiguration.filters")
if filters is not None:
filters.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.filtersConfiguration.filters[]")
if _elements is not None:
_elements.set_prop("key", AAZStrType, ".key")
_elements.set_const("operatorType", "BoolEquals", AAZStrType, ".bool_equals", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberGreaterThan", AAZStrType, ".number_greater_than", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberGreaterThanOrEquals", AAZStrType, ".number_greater_than_or_equals", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberIn", AAZStrType, ".number_in", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberInRange", AAZStrType, ".number_in_range", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberLessThan", AAZStrType, ".number_less_than", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberLessThanOrEquals", AAZStrType, ".number_less_than_or_equals", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberNotIn", AAZStrType, ".number_not_in", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "NumberNotInRange", AAZStrType, ".number_not_in_range", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringBeginsWith", AAZStrType, ".string_begins_with", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringContains", AAZStrType, ".string_contains", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringEndsWith", AAZStrType, ".string_ends_with", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringIn", AAZStrType, ".string_in", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringNotBeginsWith", AAZStrType, ".string_not_begins_with", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringNotContains", AAZStrType, ".string_not_contains", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringNotEndsWith", AAZStrType, ".string_not_ends_with", typ_kwargs={"flags": {"required": True}})
_elements.set_const("operatorType", "StringNotIn", AAZStrType, ".string_not_in", typ_kwargs={"flags": {"required": True}})
_elements.discriminate_by("operatorType", "BoolEquals")
_elements.discriminate_by("operatorType", "NumberGreaterThan")
_elements.discriminate_by("operatorType", "NumberGreaterThanOrEquals")
_elements.discriminate_by("operatorType", "NumberIn")
_elements.discriminate_by("operatorType", "NumberInRange")
_elements.discriminate_by("operatorType", "NumberLessThan")
_elements.discriminate_by("operatorType", "NumberLessThanOrEquals")
_elements.discriminate_by("operatorType", "NumberNotIn")
_elements.discriminate_by("operatorType", "NumberNotInRange")
_elements.discriminate_by("operatorType", "StringBeginsWith")
_elements.discriminate_by("operatorType", "StringContains")
_elements.discriminate_by("operatorType", "StringEndsWith")
_elements.discriminate_by("operatorType", "StringIn")
_elements.discriminate_by("operatorType", "StringNotBeginsWith")
_elements.discriminate_by("operatorType", "StringNotContains")
_elements.discriminate_by("operatorType", "StringNotEndsWith")
_elements.discriminate_by("operatorType", "StringNotIn")
disc_bool_equals = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:BoolEquals}")
if disc_bool_equals is not None:
disc_bool_equals.set_prop("value", AAZBoolType, ".bool_equals.value")
disc_number_greater_than = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberGreaterThan}")
if disc_number_greater_than is not None:
disc_number_greater_than.set_prop("value", AAZFloatType, ".number_greater_than.value")
disc_number_greater_than_or_equals = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberGreaterThanOrEquals}")
if disc_number_greater_than_or_equals is not None:
disc_number_greater_than_or_equals.set_prop("value", AAZFloatType, ".number_greater_than_or_equals.value")
disc_number_in = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberIn}")
if disc_number_in is not None:
disc_number_in.set_prop("values", AAZListType, ".number_in.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberIn}.values")
if values is not None:
values.set_elements(AAZFloatType, ".")
disc_number_in_range = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberInRange}")
if disc_number_in_range is not None:
disc_number_in_range.set_prop("values", AAZListType, ".number_in_range.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberInRange}.values")
if values is not None:
values.set_elements(AAZListType, ".")
_elements = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberInRange}.values[]")
if _elements is not None:
_elements.set_elements(AAZFloatType, ".")
disc_number_less_than = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberLessThan}")
if disc_number_less_than is not None:
disc_number_less_than.set_prop("value", AAZFloatType, ".number_less_than.value")
disc_number_less_than_or_equals = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberLessThanOrEquals}")
if disc_number_less_than_or_equals is not None:
disc_number_less_than_or_equals.set_prop("value", AAZFloatType, ".number_less_than_or_equals.value")
disc_number_not_in = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberNotIn}")
if disc_number_not_in is not None:
disc_number_not_in.set_prop("values", AAZListType, ".number_not_in.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberNotIn}.values")
if values is not None:
values.set_elements(AAZFloatType, ".")
disc_number_not_in_range = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberNotInRange}")
if disc_number_not_in_range is not None:
disc_number_not_in_range.set_prop("values", AAZListType, ".number_not_in_range.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberNotInRange}.values")
if values is not None:
values.set_elements(AAZListType, ".")
_elements = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:NumberNotInRange}.values[]")
if _elements is not None:
_elements.set_elements(AAZFloatType, ".")
disc_string_begins_with = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringBeginsWith}")
if disc_string_begins_with is not None:
disc_string_begins_with.set_prop("values", AAZListType, ".string_begins_with.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringBeginsWith}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_contains = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringContains}")
if disc_string_contains is not None:
disc_string_contains.set_prop("values", AAZListType, ".string_contains.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringContains}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_ends_with = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringEndsWith}")
if disc_string_ends_with is not None:
disc_string_ends_with.set_prop("values", AAZListType, ".string_ends_with.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringEndsWith}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_in = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringIn}")
if disc_string_in is not None:
disc_string_in.set_prop("values", AAZListType, ".string_in.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringIn}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_not_begins_with = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotBeginsWith}")
if disc_string_not_begins_with is not None:
disc_string_not_begins_with.set_prop("values", AAZListType, ".string_not_begins_with.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotBeginsWith}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_not_contains = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotContains}")
if disc_string_not_contains is not None:
disc_string_not_contains.set_prop("values", AAZListType, ".string_not_contains.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotContains}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_not_ends_with = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotEndsWith}")
if disc_string_not_ends_with is not None:
disc_string_not_ends_with.set_prop("values", AAZListType, ".string_not_ends_with.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotEndsWith}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
disc_string_not_in = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotIn}")
if disc_string_not_in is not None:
disc_string_not_in.set_prop("values", AAZListType, ".string_not_in.values")
values = _builder.get(".properties.filtersConfiguration.filters[]{operatorType:StringNotIn}.values")
if values is not None:
values.set_elements(AAZStrType, ".")
included_event_types = _builder.get(".properties.filtersConfiguration.includedEventTypes")
if included_event_types is not None:
included_event_types.set_elements(AAZStrType, ".")
return _instance_value