# Code snippets and samples


## Api

- [CreateOrUpdate](#api_createorupdate)
- [Delete](#api_delete)
- [Get](#api_get)
- [GetEntityTag](#api_getentitytag)
- [ListByService](#api_listbyservice)
- [ListByTags](#api_listbytags)
- [Update](#api_update)

## ApiDiagnostic

- [CreateOrUpdate](#apidiagnostic_createorupdate)
- [Delete](#apidiagnostic_delete)
- [Get](#apidiagnostic_get)
- [GetEntityTag](#apidiagnostic_getentitytag)
- [ListByService](#apidiagnostic_listbyservice)
- [Update](#apidiagnostic_update)

## ApiExport

- [Get](#apiexport_get)

## ApiIssue

- [CreateOrUpdate](#apiissue_createorupdate)
- [Delete](#apiissue_delete)
- [Get](#apiissue_get)
- [GetEntityTag](#apiissue_getentitytag)
- [ListByService](#apiissue_listbyservice)
- [Update](#apiissue_update)

## ApiIssueAttachment

- [CreateOrUpdate](#apiissueattachment_createorupdate)
- [Delete](#apiissueattachment_delete)
- [Get](#apiissueattachment_get)
- [GetEntityTag](#apiissueattachment_getentitytag)
- [ListByService](#apiissueattachment_listbyservice)

## ApiIssueComment

- [CreateOrUpdate](#apiissuecomment_createorupdate)
- [Delete](#apiissuecomment_delete)
- [Get](#apiissuecomment_get)
- [GetEntityTag](#apiissuecomment_getentitytag)
- [ListByService](#apiissuecomment_listbyservice)

## ApiManagementOperations

- [List](#apimanagementoperations_list)

## ApiManagementService

- [ApplyNetworkConfigurationUpdates](#apimanagementservice_applynetworkconfigurationupdates)
- [Backup](#apimanagementservice_backup)
- [CheckNameAvailability](#apimanagementservice_checknameavailability)
- [CreateOrUpdate](#apimanagementservice_createorupdate)
- [Delete](#apimanagementservice_delete)
- [GetByResourceGroup](#apimanagementservice_getbyresourcegroup)
- [GetDomainOwnershipIdentifier](#apimanagementservice_getdomainownershipidentifier)
- [GetSsoToken](#apimanagementservice_getssotoken)
- [List](#apimanagementservice_list)
- [ListByResourceGroup](#apimanagementservice_listbyresourcegroup)
- [Restore](#apimanagementservice_restore)
- [Update](#apimanagementservice_update)

## ApiManagementServiceSkus

- [ListAvailableServiceSkus](#apimanagementserviceskus_listavailableserviceskus)

## ApiManagementSkus

- [List](#apimanagementskus_list)

## ApiOperation

- [CreateOrUpdate](#apioperation_createorupdate)
- [Delete](#apioperation_delete)
- [Get](#apioperation_get)
- [GetEntityTag](#apioperation_getentitytag)
- [ListByApi](#apioperation_listbyapi)
- [Update](#apioperation_update)

## ApiOperationPolicy

- [CreateOrUpdate](#apioperationpolicy_createorupdate)
- [Delete](#apioperationpolicy_delete)
- [Get](#apioperationpolicy_get)
- [GetEntityTag](#apioperationpolicy_getentitytag)
- [ListByOperation](#apioperationpolicy_listbyoperation)

## ApiPolicy

- [CreateOrUpdate](#apipolicy_createorupdate)
- [Delete](#apipolicy_delete)
- [Get](#apipolicy_get)
- [GetEntityTag](#apipolicy_getentitytag)
- [ListByApi](#apipolicy_listbyapi)

## ApiProduct

- [ListByApis](#apiproduct_listbyapis)

## ApiRelease

- [CreateOrUpdate](#apirelease_createorupdate)
- [Delete](#apirelease_delete)
- [Get](#apirelease_get)
- [GetEntityTag](#apirelease_getentitytag)
- [ListByService](#apirelease_listbyservice)
- [Update](#apirelease_update)

## ApiRevision

- [ListByService](#apirevision_listbyservice)

## ApiSchema

- [CreateOrUpdate](#apischema_createorupdate)
- [Delete](#apischema_delete)
- [Get](#apischema_get)
- [GetEntityTag](#apischema_getentitytag)
- [ListByApi](#apischema_listbyapi)

## ApiTagDescription

- [CreateOrUpdate](#apitagdescription_createorupdate)
- [Delete](#apitagdescription_delete)
- [Get](#apitagdescription_get)
- [GetEntityTag](#apitagdescription_getentitytag)
- [ListByService](#apitagdescription_listbyservice)

## ApiVersionSet

- [CreateOrUpdate](#apiversionset_createorupdate)
- [Delete](#apiversionset_delete)
- [Get](#apiversionset_get)
- [GetEntityTag](#apiversionset_getentitytag)
- [ListByService](#apiversionset_listbyservice)
- [Update](#apiversionset_update)

## AuthorizationServer

- [CreateOrUpdate](#authorizationserver_createorupdate)
- [Delete](#authorizationserver_delete)
- [Get](#authorizationserver_get)
- [GetEntityTag](#authorizationserver_getentitytag)
- [ListByService](#authorizationserver_listbyservice)
- [ListSecrets](#authorizationserver_listsecrets)
- [Update](#authorizationserver_update)

## Backend

- [CreateOrUpdate](#backend_createorupdate)
- [Delete](#backend_delete)
- [Get](#backend_get)
- [GetEntityTag](#backend_getentitytag)
- [ListByService](#backend_listbyservice)
- [Reconnect](#backend_reconnect)
- [Update](#backend_update)

## Cache

- [CreateOrUpdate](#cache_createorupdate)
- [Delete](#cache_delete)
- [Get](#cache_get)
- [GetEntityTag](#cache_getentitytag)
- [ListByService](#cache_listbyservice)
- [Update](#cache_update)

## Certificate

- [CreateOrUpdate](#certificate_createorupdate)
- [Delete](#certificate_delete)
- [Get](#certificate_get)
- [GetEntityTag](#certificate_getentitytag)
- [ListByService](#certificate_listbyservice)
- [RefreshSecret](#certificate_refreshsecret)

## ContentItem

- [CreateOrUpdate](#contentitem_createorupdate)
- [Delete](#contentitem_delete)
- [Get](#contentitem_get)
- [GetEntityTag](#contentitem_getentitytag)
- [ListByService](#contentitem_listbyservice)

## ContentType

- [CreateOrUpdate](#contenttype_createorupdate)
- [Delete](#contenttype_delete)
- [Get](#contenttype_get)
- [ListByService](#contenttype_listbyservice)

## DelegationSettings

- [CreateOrUpdate](#delegationsettings_createorupdate)
- [Get](#delegationsettings_get)
- [GetEntityTag](#delegationsettings_getentitytag)
- [ListSecrets](#delegationsettings_listsecrets)
- [Update](#delegationsettings_update)

## DeletedServices

- [GetByName](#deletedservices_getbyname)
- [List](#deletedservices_list)
- [Purge](#deletedservices_purge)

## Diagnostic

- [CreateOrUpdate](#diagnostic_createorupdate)
- [Delete](#diagnostic_delete)
- [Get](#diagnostic_get)
- [GetEntityTag](#diagnostic_getentitytag)
- [ListByService](#diagnostic_listbyservice)
- [Update](#diagnostic_update)

## EmailTemplate

- [CreateOrUpdate](#emailtemplate_createorupdate)
- [Delete](#emailtemplate_delete)
- [Get](#emailtemplate_get)
- [GetEntityTag](#emailtemplate_getentitytag)
- [ListByService](#emailtemplate_listbyservice)
- [Update](#emailtemplate_update)

## Gateway

- [CreateOrUpdate](#gateway_createorupdate)
- [Delete](#gateway_delete)
- [GenerateToken](#gateway_generatetoken)
- [Get](#gateway_get)
- [GetEntityTag](#gateway_getentitytag)
- [ListByService](#gateway_listbyservice)
- [ListKeys](#gateway_listkeys)
- [RegenerateKey](#gateway_regeneratekey)
- [Update](#gateway_update)

## GatewayApi

- [CreateOrUpdate](#gatewayapi_createorupdate)
- [Delete](#gatewayapi_delete)
- [GetEntityTag](#gatewayapi_getentitytag)
- [ListByService](#gatewayapi_listbyservice)

## GatewayCertificateAuthority

- [CreateOrUpdate](#gatewaycertificateauthority_createorupdate)
- [Delete](#gatewaycertificateauthority_delete)
- [Get](#gatewaycertificateauthority_get)
- [GetEntityTag](#gatewaycertificateauthority_getentitytag)
- [ListByService](#gatewaycertificateauthority_listbyservice)

## GatewayHostnameConfiguration

- [CreateOrUpdate](#gatewayhostnameconfiguration_createorupdate)
- [Delete](#gatewayhostnameconfiguration_delete)
- [Get](#gatewayhostnameconfiguration_get)
- [GetEntityTag](#gatewayhostnameconfiguration_getentitytag)
- [ListByService](#gatewayhostnameconfiguration_listbyservice)

## GlobalSchema

- [CreateOrUpdate](#globalschema_createorupdate)
- [Delete](#globalschema_delete)
- [Get](#globalschema_get)
- [GetEntityTag](#globalschema_getentitytag)
- [ListByService](#globalschema_listbyservice)

## Group

- [CreateOrUpdate](#group_createorupdate)
- [Delete](#group_delete)
- [Get](#group_get)
- [GetEntityTag](#group_getentitytag)
- [ListByService](#group_listbyservice)
- [Update](#group_update)

## GroupUser

- [CheckEntityExists](#groupuser_checkentityexists)
- [Create](#groupuser_create)
- [Delete](#groupuser_delete)
- [List](#groupuser_list)

## IdentityProvider

- [CreateOrUpdate](#identityprovider_createorupdate)
- [Delete](#identityprovider_delete)
- [Get](#identityprovider_get)
- [GetEntityTag](#identityprovider_getentitytag)
- [ListByService](#identityprovider_listbyservice)
- [ListSecrets](#identityprovider_listsecrets)
- [Update](#identityprovider_update)

## Issue

- [Get](#issue_get)
- [ListByService](#issue_listbyservice)

## Logger

- [CreateOrUpdate](#logger_createorupdate)
- [Delete](#logger_delete)
- [Get](#logger_get)
- [GetEntityTag](#logger_getentitytag)
- [ListByService](#logger_listbyservice)
- [Update](#logger_update)

## NamedValue

- [CreateOrUpdate](#namedvalue_createorupdate)
- [Delete](#namedvalue_delete)
- [Get](#namedvalue_get)
- [GetEntityTag](#namedvalue_getentitytag)
- [ListByService](#namedvalue_listbyservice)
- [ListValue](#namedvalue_listvalue)
- [RefreshSecret](#namedvalue_refreshsecret)
- [Update](#namedvalue_update)

## NetworkStatus

- [ListByLocation](#networkstatus_listbylocation)
- [ListByService](#networkstatus_listbyservice)

## Notification

- [CreateOrUpdate](#notification_createorupdate)
- [Get](#notification_get)
- [ListByService](#notification_listbyservice)

## NotificationRecipientEmail

- [CheckEntityExists](#notificationrecipientemail_checkentityexists)
- [CreateOrUpdate](#notificationrecipientemail_createorupdate)
- [Delete](#notificationrecipientemail_delete)
- [ListByNotification](#notificationrecipientemail_listbynotification)

## NotificationRecipientUser

- [CheckEntityExists](#notificationrecipientuser_checkentityexists)
- [CreateOrUpdate](#notificationrecipientuser_createorupdate)
- [Delete](#notificationrecipientuser_delete)
- [ListByNotification](#notificationrecipientuser_listbynotification)

## OpenIdConnectProvider

- [CreateOrUpdate](#openidconnectprovider_createorupdate)
- [Delete](#openidconnectprovider_delete)
- [Get](#openidconnectprovider_get)
- [GetEntityTag](#openidconnectprovider_getentitytag)
- [ListByService](#openidconnectprovider_listbyservice)
- [ListSecrets](#openidconnectprovider_listsecrets)
- [Update](#openidconnectprovider_update)

## Operation

- [ListByTags](#operation_listbytags)

## OutboundNetworkDependenciesEndpoints

- [ListByService](#outboundnetworkdependenciesendpoints_listbyservice)

## Policy

- [CreateOrUpdate](#policy_createorupdate)
- [Delete](#policy_delete)
- [Get](#policy_get)
- [GetEntityTag](#policy_getentitytag)
- [ListByService](#policy_listbyservice)

## PolicyDescription

- [ListByService](#policydescription_listbyservice)

## PortalRevision

- [CreateOrUpdate](#portalrevision_createorupdate)
- [Get](#portalrevision_get)
- [GetEntityTag](#portalrevision_getentitytag)
- [ListByService](#portalrevision_listbyservice)
- [Update](#portalrevision_update)

## PortalSettings

- [ListByService](#portalsettings_listbyservice)

## PrivateEndpointConnection

- [CreateOrUpdate](#privateendpointconnection_createorupdate)
- [Delete](#privateendpointconnection_delete)
- [GetByName](#privateendpointconnection_getbyname)
- [GetPrivateLinkResource](#privateendpointconnection_getprivatelinkresource)
- [ListByService](#privateendpointconnection_listbyservice)
- [ListPrivateLinkResources](#privateendpointconnection_listprivatelinkresources)

## Product

- [CreateOrUpdate](#product_createorupdate)
- [Delete](#product_delete)
- [Get](#product_get)
- [GetEntityTag](#product_getentitytag)
- [ListByService](#product_listbyservice)
- [ListByTags](#product_listbytags)
- [Update](#product_update)

## ProductApi

- [CheckEntityExists](#productapi_checkentityexists)
- [CreateOrUpdate](#productapi_createorupdate)
- [Delete](#productapi_delete)
- [ListByProduct](#productapi_listbyproduct)

## ProductGroup

- [CheckEntityExists](#productgroup_checkentityexists)
- [CreateOrUpdate](#productgroup_createorupdate)
- [Delete](#productgroup_delete)
- [ListByProduct](#productgroup_listbyproduct)

## ProductPolicy

- [CreateOrUpdate](#productpolicy_createorupdate)
- [Delete](#productpolicy_delete)
- [Get](#productpolicy_get)
- [GetEntityTag](#productpolicy_getentitytag)
- [ListByProduct](#productpolicy_listbyproduct)

## ProductSubscriptions

- [List](#productsubscriptions_list)

## QuotaByCounterKeys

- [ListByService](#quotabycounterkeys_listbyservice)
- [Update](#quotabycounterkeys_update)

## QuotaByPeriodKeys

- [Get](#quotabyperiodkeys_get)
- [Update](#quotabyperiodkeys_update)

## Region

- [ListByService](#region_listbyservice)

## Reports

- [ListByApi](#reports_listbyapi)
- [ListByGeo](#reports_listbygeo)
- [ListByOperation](#reports_listbyoperation)
- [ListByProduct](#reports_listbyproduct)
- [ListByRequest](#reports_listbyrequest)
- [ListBySubscription](#reports_listbysubscription)
- [ListByTime](#reports_listbytime)
- [ListByUser](#reports_listbyuser)

## ResourceProvider

- [PerformConnectivityCheckAsync](#resourceprovider_performconnectivitycheckasync)

## SignInSettings

- [CreateOrUpdate](#signinsettings_createorupdate)
- [Get](#signinsettings_get)
- [GetEntityTag](#signinsettings_getentitytag)
- [Update](#signinsettings_update)

## SignUpSettings

- [CreateOrUpdate](#signupsettings_createorupdate)
- [Get](#signupsettings_get)
- [GetEntityTag](#signupsettings_getentitytag)
- [Update](#signupsettings_update)

## Subscription

- [CreateOrUpdate](#subscription_createorupdate)
- [Delete](#subscription_delete)
- [Get](#subscription_get)
- [GetEntityTag](#subscription_getentitytag)
- [List](#subscription_list)
- [ListSecrets](#subscription_listsecrets)
- [RegeneratePrimaryKey](#subscription_regenerateprimarykey)
- [RegenerateSecondaryKey](#subscription_regeneratesecondarykey)
- [Update](#subscription_update)

## Tag

- [AssignToApi](#tag_assigntoapi)
- [AssignToOperation](#tag_assigntooperation)
- [AssignToProduct](#tag_assigntoproduct)
- [CreateOrUpdate](#tag_createorupdate)
- [Delete](#tag_delete)
- [DetachFromApi](#tag_detachfromapi)
- [DetachFromOperation](#tag_detachfromoperation)
- [DetachFromProduct](#tag_detachfromproduct)
- [Get](#tag_get)
- [GetByApi](#tag_getbyapi)
- [GetByOperation](#tag_getbyoperation)
- [GetByProduct](#tag_getbyproduct)
- [GetEntityState](#tag_getentitystate)
- [GetEntityStateByApi](#tag_getentitystatebyapi)
- [GetEntityStateByOperation](#tag_getentitystatebyoperation)
- [GetEntityStateByProduct](#tag_getentitystatebyproduct)
- [ListByApi](#tag_listbyapi)
- [ListByOperation](#tag_listbyoperation)
- [ListByProduct](#tag_listbyproduct)
- [ListByService](#tag_listbyservice)
- [Update](#tag_update)

## TagResource

- [ListByService](#tagresource_listbyservice)

## TenantAccess

- [Create](#tenantaccess_create)
- [Get](#tenantaccess_get)
- [GetEntityTag](#tenantaccess_getentitytag)
- [ListByService](#tenantaccess_listbyservice)
- [ListSecrets](#tenantaccess_listsecrets)
- [RegeneratePrimaryKey](#tenantaccess_regenerateprimarykey)
- [RegenerateSecondaryKey](#tenantaccess_regeneratesecondarykey)
- [Update](#tenantaccess_update)

## TenantAccessGit

- [RegeneratePrimaryKey](#tenantaccessgit_regenerateprimarykey)
- [RegenerateSecondaryKey](#tenantaccessgit_regeneratesecondarykey)

## TenantConfiguration

- [Deploy](#tenantconfiguration_deploy)
- [GetSyncState](#tenantconfiguration_getsyncstate)
- [Save](#tenantconfiguration_save)
- [Validate](#tenantconfiguration_validate)

## TenantSettings

- [Get](#tenantsettings_get)
- [ListByService](#tenantsettings_listbyservice)

## User

- [CreateOrUpdate](#user_createorupdate)
- [Delete](#user_delete)
- [GenerateSsoUrl](#user_generatessourl)
- [Get](#user_get)
- [GetEntityTag](#user_getentitytag)
- [GetSharedAccessToken](#user_getsharedaccesstoken)
- [ListByService](#user_listbyservice)
- [Update](#user_update)

## UserConfirmationPassword

- [Send](#userconfirmationpassword_send)

## UserGroup

- [List](#usergroup_list)

## UserIdentities

- [List](#useridentities_list)

## UserSubscription

- [Get](#usersubscription_get)
- [List](#usersubscription_list)
### Api_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector;
import com.azure.resourcemanager.apimanagement.models.ApiType;
import com.azure.resourcemanager.apimanagement.models.AuthenticationSettingsContract;
import com.azure.resourcemanager.apimanagement.models.BearerTokenSendingMethods;
import com.azure.resourcemanager.apimanagement.models.ContentFormat;
import com.azure.resourcemanager.apimanagement.models.OAuth2AuthenticationSettingsContract;
import com.azure.resourcemanager.apimanagement.models.OpenIdAuthenticationSettingsContract;
import com.azure.resourcemanager.apimanagement.models.Protocol;
import com.azure.resourcemanager.apimanagement.models.SoapApiType;
import com.azure.resourcemanager.apimanagement.models.SubscriptionKeyParameterNamesContract;
import java.util.Arrays;

/** Samples for Api CreateOrUpdate. */
public final class ApiCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingSwaggerImport.json
     */
    /**
     * Sample code: ApiManagementCreateApiUsingSwaggerImport.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiUsingSwaggerImport(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("petstore")
            .withExistingService("rg1", "apimService1")
            .withValue("http://petstore.swagger.io/v2/swagger.json")
            .withFormat(ContentFormat.SWAGGER_LINK_JSON)
            .withPath("petstore")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRevisionFromExistingApi.json
     */
    /**
     * Sample code: ApiManagementCreateApiRevisionFromExistingApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiRevisionFromExistingApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("echo-api;rev=3")
            .withExistingService("rg1", "apimService1")
            .withSourceApiId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api")
            .withServiceUrl("http://echoapi.cloudapp.net/apiv3")
            .withPath("echo")
            .withApiRevisionDescription("Creating a Revision of an existing API")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiClone.json
     */
    /**
     * Sample code: ApiManagementCreateApiClone.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiClone(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("echo-api2")
            .withExistingService("rg1", "apimService1")
            .withSourceApiId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/58a4aeac497000007d040001")
            .withDisplayName("Echo API2")
            .withServiceUrl("http://echoapi.cloudapp.net/api")
            .withPath("echo2")
            .withProtocols(Arrays.asList(Protocol.HTTP, Protocol.HTTPS))
            .withDescription("Copy of Existing Echo Api including Operations.")
            .withIsCurrent(true)
            .withSubscriptionRequired(true)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingOai3Import.json
     */
    /**
     * Sample code: ApiManagementCreateApiUsingOai3Import.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiUsingOai3Import(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("petstore")
            .withExistingService("rg1", "apimService1")
            .withValue("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml")
            .withFormat(ContentFormat.OPENAPI_LINK)
            .withPath("petstore")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiWithOpenIdConnect.json
     */
    /**
     * Sample code: ApiManagementCreateApiWithOpenIdConnect.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiWithOpenIdConnect(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("tempgroup")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("Swagger Petstore")
            .withServiceUrl("http://petstore.swagger.io/v2")
            .withPath("petstore")
            .withProtocols(Arrays.asList(Protocol.HTTPS))
            .withDescription(
                "This is a sample server Petstore server.  You can find out more about Swagger at"
                    + " [http://swagger.io](http://swagger.io) or on [irc.freenode.net,"
                    + " #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to"
                    + " test the authorization filters.")
            .withAuthenticationSettings(
                new AuthenticationSettingsContract()
                    .withOpenid(
                        new OpenIdAuthenticationSettingsContract()
                            .withOpenidProviderId("testopenid")
                            .withBearerTokenSendingMethods(
                                Arrays.asList(BearerTokenSendingMethods.AUTHORIZATION_HEADER))))
            .withSubscriptionKeyParameterNames(
                new SubscriptionKeyParameterNamesContract()
                    .withHeaderProperty("Ocp-Apim-Subscription-Key")
                    .withQuery("subscription-key"))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateWebsocketApi.json
     */
    /**
     * Sample code: ApiManagementCreateWebSocketApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateWebSocketApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("tempgroup")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("apiname1463")
            .withServiceUrl("wss://echo.websocket.org")
            .withPath("newapiPath")
            .withProtocols(Arrays.asList(Protocol.WSS, Protocol.WS))
            .withDescription("apidescription5200")
            .withApiType(ApiType.WEBSOCKET)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGraphQLApi.json
     */
    /**
     * Sample code: ApiManagementCreateGraphQLApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGraphQLApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("tempgroup")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("apiname1463")
            .withServiceUrl("https://api.spacex.land/graphql")
            .withPath("graphql-api")
            .withProtocols(Arrays.asList(Protocol.HTTP, Protocol.HTTPS))
            .withDescription("apidescription5200")
            .withApiType(ApiType.GRAPHQL)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSoapPassThroughApiUsingWsdlImport.json
     */
    /**
     * Sample code: ApiManagementCreateSoapPassThroughApiUsingWsdlImport.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateSoapPassThroughApiUsingWsdlImport(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("soapApi")
            .withExistingService("rg1", "apimService1")
            .withValue("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")
            .withFormat(ContentFormat.WSDL_LINK)
            .withWsdlSelector(
                new ApiCreateOrUpdatePropertiesWsdlSelector()
                    .withWsdlServiceName("CurrencyConvertor")
                    .withWsdlEndpointName("CurrencyConvertorSoap"))
            .withSoapApiType(SoapApiType.SOAP)
            .withPath("currency")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingImportOverrideServiceUrl.json
     */
    /**
     * Sample code: ApiManagementCreateApiUsingImportOverrideServiceUrl.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiUsingImportOverrideServiceUrl(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("apidocs")
            .withExistingService("rg1", "apimService1")
            .withValue("http://apimpimportviaurl.azurewebsites.net/api/apidocs/")
            .withFormat(ContentFormat.fromString("swagger-link"))
            .withServiceUrl("http://petstore.swagger.wordnik.com/api")
            .withPath("petstoreapi123")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingWadlImport.json
     */
    /**
     * Sample code: ApiManagementCreateApiUsingWadlImport.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiUsingWadlImport(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("petstore")
            .withExistingService("rg1", "apimService1")
            .withValue(
                "https://developer.cisco.com/media/wae-release-6-2-api-reference/wae-collector-rest-api/application.wadl")
            .withFormat(ContentFormat.WADL_LINK_JSON)
            .withPath("collector")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiNewVersionUsingExistingApi.json
     */
    /**
     * Sample code: ApiManagementCreateApiNewVersionUsingExistingApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiNewVersionUsingExistingApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("echoapiv3")
            .withExistingService("rg1", "apimService1")
            .withSourceApiId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echoPath")
            .withDisplayName("Echo API2")
            .withServiceUrl("http://echoapi.cloudapp.net/api")
            .withPath("echo2")
            .withProtocols(Arrays.asList(Protocol.HTTP, Protocol.HTTPS))
            .withDescription("Create Echo API into a new Version using Existing Version Set and Copy all Operations.")
            .withApiVersion("v4")
            .withIsCurrent(true)
            .withApiVersionSetId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apiVersionSets/aa9c59e6-c0cd-4258-9356-9ca7d2f0b458")
            .withSubscriptionRequired(true)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApi.json
     */
    /**
     * Sample code: ApiManagementCreateApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApi(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("tempgroup")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("apiname1463")
            .withServiceUrl("http://newechoapi.cloudapp.net/api")
            .withPath("newapiPath")
            .withProtocols(Arrays.asList(Protocol.HTTPS, Protocol.HTTP))
            .withDescription("apidescription5200")
            .withAuthenticationSettings(
                new AuthenticationSettingsContract()
                    .withOAuth2(
                        new OAuth2AuthenticationSettingsContract()
                            .withAuthorizationServerId("authorizationServerId2283")
                            .withScope("oauth2scope2580")))
            .withSubscriptionKeyParameterNames(
                new SubscriptionKeyParameterNamesContract().withHeaderProperty("header4520").withQuery("query3037"))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSoapToRestApiUsingWsdlImport.json
     */
    /**
     * Sample code: ApiManagementCreateSoapToRestApiUsingWsdlImport.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateSoapToRestApiUsingWsdlImport(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apis()
            .define("soapApi")
            .withExistingService("rg1", "apimService1")
            .withValue("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")
            .withFormat(ContentFormat.WSDL_LINK)
            .withWsdlSelector(
                new ApiCreateOrUpdatePropertiesWsdlSelector()
                    .withWsdlServiceName("CurrencyConvertor")
                    .withWsdlEndpointName("CurrencyConvertorSoap"))
            .withPath("currency")
            .create();
    }
}
```

### Api_Delete

```java
import com.azure.core.util.Context;

/** Samples for Api Delete. */
public final class ApiDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApi.json
     */
    /**
     * Sample code: ApiManagementDeleteApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApi(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apis().deleteWithResponse("rg1", "apimService1", "echo-api", "*", null, Context.NONE);
    }
}
```

### Api_Get

```java
import com.azure.core.util.Context;

/** Samples for Api Get. */
public final class ApiGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRevision.json
     */
    /**
     * Sample code: ApiManagementGetApiRevisionContract.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiRevisionContract(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apis().getWithResponse("rg1", "apimService1", "echo-api;rev=3", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiContract.json
     */
    /**
     * Sample code: ApiManagementGetApiContract.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiContract(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apis().getWithResponse("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", Context.NONE);
    }
}
```

### Api_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Api GetEntityTag. */
public final class ApiGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApi.json
     */
    /**
     * Sample code: ApiManagementHeadApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApi(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apis().getEntityTagWithResponse("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", Context.NONE);
    }
}
```

### Api_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Api ListByService. */
public final class ApiListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApis.json
     */
    /**
     * Sample code: ApiManagementListApis.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApis(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apis().listByService("rg1", "apimService1", null, null, null, null, null, Context.NONE);
    }
}
```

### Api_ListByTags

```java
import com.azure.core.util.Context;

/** Samples for Api ListByTags. */
public final class ApiListByTagsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApisByTags.json
     */
    /**
     * Sample code: ApiManagementListApisByTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApisByTags(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apis().listByTags("rg1", "apimService1", null, null, null, null, Context.NONE);
    }
}
```

### Api_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ApiContract;

/** Samples for Api Update. */
public final class ApiUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApi.json
     */
    /**
     * Sample code: ApiManagementUpdateApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApi(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiContract resource =
            manager.apis().getWithResponse("rg1", "apimService1", "echo-api", Context.NONE).getValue();
        resource
            .update()
            .withDisplayName("Echo API New")
            .withServiceUrl("http://echoapi.cloudapp.net/api2")
            .withPath("newecho")
            .withIfMatch("*")
            .apply();
    }
}
```

### ApiDiagnostic_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.AlwaysLog;
import com.azure.resourcemanager.apimanagement.models.BodyDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.HttpMessageDiagnostic;
import com.azure.resourcemanager.apimanagement.models.PipelineDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingType;
import java.util.Arrays;

/** Samples for ApiDiagnostic CreateOrUpdate. */
public final class ApiDiagnosticCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiDiagnostic.json
     */
    /**
     * Sample code: ApiManagementCreateApiDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiDiagnostics()
            .define("applicationinsights")
            .withExistingApi("rg1", "apimService1", "57d1f7558aa04f15146d9d8a")
            .withAlwaysLog(AlwaysLog.ALL_ERRORS)
            .withLoggerId("/loggers/applicationinsights")
            .withSampling(new SamplingSettings().withSamplingType(SamplingType.FIXED).withPercentage(50.0))
            .withFrontend(
                new PipelineDiagnosticSettings()
                    .withRequest(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512)))
                    .withResponse(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512))))
            .withBackend(
                new PipelineDiagnosticSettings()
                    .withRequest(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512)))
                    .withResponse(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512))))
            .create();
    }
}
```

### ApiDiagnostic_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiDiagnostic Delete. */
public final class ApiDiagnosticDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiDiagnostic.json
     */
    /**
     * Sample code: ApiManagementDeleteApiDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiDiagnostics()
            .deleteWithResponse(
                "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", "*", Context.NONE);
    }
}
```

### ApiDiagnostic_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiDiagnostic Get. */
public final class ApiDiagnosticGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiDiagnostic.json
     */
    /**
     * Sample code: ApiManagementGetApiDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiDiagnostics()
            .getWithResponse("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", Context.NONE);
    }
}
```

### ApiDiagnostic_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiDiagnostic GetEntityTag. */
public final class ApiDiagnosticGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiDiagnostic.json
     */
    /**
     * Sample code: ApiManagementHeadApiDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiDiagnostics()
            .getEntityTagWithResponse(
                "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "applicationinsights", Context.NONE);
    }
}
```

### ApiDiagnostic_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiDiagnostic ListByService. */
public final class ApiDiagnosticListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiDiagnostics.json
     */
    /**
     * Sample code: ApiManagementListApiDiagnostics.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiDiagnostics(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiDiagnostics().listByService("rg1", "apimService1", "echo-api", null, null, null, Context.NONE);
    }
}
```

### ApiDiagnostic_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AlwaysLog;
import com.azure.resourcemanager.apimanagement.models.BodyDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.DiagnosticContract;
import com.azure.resourcemanager.apimanagement.models.HttpMessageDiagnostic;
import com.azure.resourcemanager.apimanagement.models.PipelineDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingType;
import java.util.Arrays;

/** Samples for ApiDiagnostic Update. */
public final class ApiDiagnosticUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiDiagnostic.json
     */
    /**
     * Sample code: ApiManagementUpdateApiDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApiDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        DiagnosticContract resource =
            manager
                .apiDiagnostics()
                .getWithResponse("rg1", "apimService1", "echo-api", "applicationinsights", Context.NONE)
                .getValue();
        resource
            .update()
            .withAlwaysLog(AlwaysLog.ALL_ERRORS)
            .withLoggerId("/loggers/applicationinsights")
            .withSampling(new SamplingSettings().withSamplingType(SamplingType.FIXED).withPercentage(50.0))
            .withFrontend(
                new PipelineDiagnosticSettings()
                    .withRequest(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512)))
                    .withResponse(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512))))
            .withBackend(
                new PipelineDiagnosticSettings()
                    .withRequest(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512)))
                    .withResponse(
                        new HttpMessageDiagnostic()
                            .withHeaders(Arrays.asList("Content-type"))
                            .withBody(new BodyDiagnosticSettings().withBytes(512))))
            .withIfMatch("*")
            .apply();
    }
}
```

### ApiExport_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ExportApi;
import com.azure.resourcemanager.apimanagement.models.ExportFormat;

/** Samples for ApiExport Get. */
public final class ApiExportGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
     */
    /**
     * Sample code: ApiManagementGetApiExportInOpenApi2dot0.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiExportInOpenApi2dot0(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiExports()
            .getWithResponse(
                "rg1", "apimService1", "echo-api", ExportFormat.SWAGGER_LINK, ExportApi.TRUE, Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
     */
    /**
     * Sample code: ApiManagementGetApiExportInOpenApi3dot0.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiExportInOpenApi3dot0(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiExports()
            .getWithResponse("rg1", "apimService1", "aid9676", ExportFormat.OPENAPI_LINK, ExportApi.TRUE, Context.NONE);
    }
}
```

### ApiIssue_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.State;
import java.time.OffsetDateTime;

/** Samples for ApiIssue CreateOrUpdate. */
public final class ApiIssueCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssue.json
     */
    /**
     * Sample code: ApiManagementCreateApiIssue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiIssue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssues()
            .define("57d2ef278aa04f0ad01d6cdc")
            .withExistingApi("rg1", "apimService1", "57d1f7558aa04f15146d9d8a")
            .withTitle("New API issue")
            .withDescription("New API issue description")
            .withUserId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1")
            .withCreatedDate(OffsetDateTime.parse("2018-02-01T22:21:20.467Z"))
            .withState(State.OPEN)
            .create();
    }
}
```

### ApiIssue_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiIssue Delete. */
public final class ApiIssueDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssue.json
     */
    /**
     * Sample code: ApiManagementDeleteApiIssue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiIssue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssues()
            .deleteWithResponse(
                "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", "*", Context.NONE);
    }
}
```

### ApiIssue_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiIssue Get. */
public final class ApiIssueGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssue.json
     */
    /**
     * Sample code: ApiManagementGetApiIssue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiIssue(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssues()
            .getWithResponse(
                "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", null, Context.NONE);
    }
}
```

### ApiIssue_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiIssue GetEntityTag. */
public final class ApiIssueGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssue.json
     */
    /**
     * Sample code: ApiManagementHeadApiIssue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiIssue(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssues()
            .getEntityTagWithResponse(
                "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", Context.NONE);
    }
}
```

### ApiIssue_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiIssue ListByService. */
public final class ApiIssueListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssues.json
     */
    /**
     * Sample code: ApiManagementListApiIssues.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiIssues(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssues()
            .listByService("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", null, null, null, null, Context.NONE);
    }
}
```

### ApiIssue_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.IssueContract;
import com.azure.resourcemanager.apimanagement.models.State;

/** Samples for ApiIssue Update. */
public final class ApiIssueUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiIssue.json
     */
    /**
     * Sample code: ApiManagementUpdateApiIssue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApiIssue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        IssueContract resource =
            manager
                .apiIssues()
                .getWithResponse(
                    "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc", null, Context.NONE)
                .getValue();
        resource.update().withState(State.CLOSED).withIfMatch("*").apply();
    }
}
```

### ApiIssueAttachment_CreateOrUpdate

```java
/** Samples for ApiIssueAttachment CreateOrUpdate. */
public final class ApiIssueAttachmentCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueAttachment.json
     */
    /**
     * Sample code: ApiManagementCreateApiIssueAttachment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiIssueAttachment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueAttachments()
            .define("57d2ef278aa04f0888cba3f3")
            .withExistingIssue("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc")
            .withTitle("Issue attachment.")
            .withContentFormat("image/jpeg")
            .withContent("IEJhc2U2NA==")
            .create();
    }
}
```

### ApiIssueAttachment_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueAttachment Delete. */
public final class ApiIssueAttachmentDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueAttachment.json
     */
    /**
     * Sample code: ApiManagementDeleteApiIssueAttachment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiIssueAttachment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueAttachments()
            .deleteWithResponse(
                "rg1",
                "apimService1",
                "57d1f7558aa04f15146d9d8a",
                "57d2ef278aa04f0ad01d6cdc",
                "57d2ef278aa04f0888cba3f3",
                "*",
                Context.NONE);
    }
}
```

### ApiIssueAttachment_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueAttachment Get. */
public final class ApiIssueAttachmentGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueAttachment.json
     */
    /**
     * Sample code: ApiManagementGetApiIssueAttachment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiIssueAttachment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueAttachments()
            .getWithResponse(
                "rg1",
                "apimService1",
                "57d2ef278aa04f0888cba3f3",
                "57d2ef278aa04f0ad01d6cdc",
                "57d2ef278aa04f0888cba3f3",
                Context.NONE);
    }
}
```

### ApiIssueAttachment_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueAttachment GetEntityTag. */
public final class ApiIssueAttachmentGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueAttachment.json
     */
    /**
     * Sample code: ApiManagementHeadApiIssueAttachment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiIssueAttachment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueAttachments()
            .getEntityTagWithResponse(
                "rg1",
                "apimService1",
                "57d2ef278aa04f0888cba3f3",
                "57d2ef278aa04f0ad01d6cdc",
                "57d2ef278aa04f0888cba3f3",
                Context.NONE);
    }
}
```

### ApiIssueAttachment_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueAttachment ListByService. */
public final class ApiIssueAttachmentListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueAttachments.json
     */
    /**
     * Sample code: ApiManagementListApiIssueAttachments.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiIssueAttachments(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueAttachments()
            .listByService(
                "rg1",
                "apimService1",
                "57d1f7558aa04f15146d9d8a",
                "57d2ef278aa04f0ad01d6cdc",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### ApiIssueComment_CreateOrUpdate

```java
import java.time.OffsetDateTime;

/** Samples for ApiIssueComment CreateOrUpdate. */
public final class ApiIssueCommentCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueComment.json
     */
    /**
     * Sample code: ApiManagementCreateApiIssueComment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiIssueComment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueComments()
            .define("599e29ab193c3c0bd0b3e2fb")
            .withExistingIssue("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "57d2ef278aa04f0ad01d6cdc")
            .withText("Issue comment.")
            .withCreatedDate(OffsetDateTime.parse("2018-02-01T22:21:20.467Z"))
            .withUserId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1")
            .create();
    }
}
```

### ApiIssueComment_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueComment Delete. */
public final class ApiIssueCommentDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueComment.json
     */
    /**
     * Sample code: ApiManagementDeleteApiIssueComment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiIssueComment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueComments()
            .deleteWithResponse(
                "rg1",
                "apimService1",
                "57d1f7558aa04f15146d9d8a",
                "57d2ef278aa04f0ad01d6cdc",
                "599e29ab193c3c0bd0b3e2fb",
                "*",
                Context.NONE);
    }
}
```

### ApiIssueComment_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueComment Get. */
public final class ApiIssueCommentGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueComment.json
     */
    /**
     * Sample code: ApiManagementGetApiIssueComment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiIssueComment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueComments()
            .getWithResponse(
                "rg1",
                "apimService1",
                "57d2ef278aa04f0888cba3f3",
                "57d2ef278aa04f0ad01d6cdc",
                "599e29ab193c3c0bd0b3e2fb",
                Context.NONE);
    }
}
```

### ApiIssueComment_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueComment GetEntityTag. */
public final class ApiIssueCommentGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueComment.json
     */
    /**
     * Sample code: ApiManagementHeadApiIssueComment.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiIssueComment(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueComments()
            .getEntityTagWithResponse(
                "rg1",
                "apimService1",
                "57d2ef278aa04f0888cba3f3",
                "57d2ef278aa04f0ad01d6cdc",
                "599e29ab193c3c0bd0b3e2fb",
                Context.NONE);
    }
}
```

### ApiIssueComment_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiIssueComment ListByService. */
public final class ApiIssueCommentListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueComments.json
     */
    /**
     * Sample code: ApiManagementListApiIssueComments.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiIssueComments(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiIssueComments()
            .listByService(
                "rg1",
                "apimService1",
                "57d1f7558aa04f15146d9d8a",
                "57d2ef278aa04f0ad01d6cdc",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### ApiManagementOperations_List

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementOperations List. */
public final class ApiManagementOperationsListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOperations.json
     */
    /**
     * Sample code: ApiManagementListOperations.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListOperations(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementOperations().list(Context.NONE);
    }
}
```

### ApiManagementService_ApplyNetworkConfigurationUpdates

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters;

/** Samples for ApiManagementService ApplyNetworkConfigurationUpdates. */
public final class ApiManagementServiceApplyNetworkConfigurationUpdatesSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApplyNetworkConfigurationUpdates.json
     */
    /**
     * Sample code: ApiManagementApplyNetworkConfigurationUpdates.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementApplyNetworkConfigurationUpdates(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .applyNetworkConfigurationUpdates(
                "rg1",
                "apimService1",
                new ApiManagementServiceApplyNetworkConfigurationParameters().withLocation("west us"),
                Context.NONE);
    }
}
```

### ApiManagementService_Backup

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessType;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceBackupRestoreParameters;

/** Samples for ApiManagementService Backup. */
public final class ApiManagementServiceBackupSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithAccessKey.json
     */
    /**
     * Sample code: ApiManagementBackupWithAccessKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementBackupWithAccessKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .backup(
                "rg1",
                "apimService1",
                new ApiManagementServiceBackupRestoreParameters()
                    .withStorageAccount("teststorageaccount")
                    .withContainerName("backupContainer")
                    .withBackupName("apimService1backup_2017_03_19")
                    .withAccessType(AccessType.ACCESS_KEY)
                    .withAccessKey("**************************************************"),
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithUserAssignedManagedIdentity.json
     */
    /**
     * Sample code: ApiManagementBackupWithUserAssignedManagedIdentity.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementBackupWithUserAssignedManagedIdentity(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .backup(
                "rg1",
                "apimService1",
                new ApiManagementServiceBackupRestoreParameters()
                    .withStorageAccount("contosorpstorage")
                    .withContainerName("apim-backups")
                    .withBackupName("backup5")
                    .withAccessType(AccessType.USER_ASSIGNED_MANAGED_IDENTITY)
                    .withClientId("XXXXX-a154-4830-XXXX-46a12da1a1e2"),
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithSystemManagedIdentity.json
     */
    /**
     * Sample code: ApiManagementBackupWithSystemManagedIdentity.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementBackupWithSystemManagedIdentity(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .backup(
                "rg1",
                "apimService1",
                new ApiManagementServiceBackupRestoreParameters()
                    .withStorageAccount("contosorpstorage")
                    .withContainerName("apim-backups")
                    .withBackupName("backup5")
                    .withAccessType(AccessType.SYSTEM_ASSIGNED_MANAGED_IDENTITY),
                Context.NONE);
    }
}
```

### ApiManagementService_CheckNameAvailability

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceCheckNameAvailabilityParameters;

/** Samples for ApiManagementService CheckNameAvailability. */
public final class ApiManagementServiceCheckNameAvailabilitySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceCheckNameAvailability.json
     */
    /**
     * Sample code: ApiManagementServiceCheckNameAvailability.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceCheckNameAvailability(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .checkNameAvailabilityWithResponse(
                new ApiManagementServiceCheckNameAvailabilityParameters().withName("apimService1"), Context.NONE);
    }
}
```

### ApiManagementService_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.AdditionalLocation;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceIdentity;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.ApiVersionConstraint;
import com.azure.resourcemanager.apimanagement.models.ApimIdentityType;
import com.azure.resourcemanager.apimanagement.models.CertificateConfiguration;
import com.azure.resourcemanager.apimanagement.models.CertificateConfigurationStoreName;
import com.azure.resourcemanager.apimanagement.models.HostnameConfiguration;
import com.azure.resourcemanager.apimanagement.models.HostnameType;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import com.azure.resourcemanager.apimanagement.models.UserIdentityProperties;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkConfiguration;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/** Samples for ApiManagementService CreateOrUpdate. */
public final class ApiManagementServiceCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceHavingMsi.json
     */
    /**
     * Sample code: ApiManagementCreateServiceHavingMsi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceHavingMsi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("West US")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.CONSUMPTION).withCapacity(0))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withIdentity(new ApiManagementServiceIdentity().withType(ApimIdentityType.SYSTEM_ASSIGNED))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.json
     */
    /**
     * Sample code: ApiManagementCreateServiceWithSystemCertificates.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceWithSystemCertificates(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("Central US")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.BASIC).withCapacity(1))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withCertificates(
                Arrays
                    .asList(
                        new CertificateConfiguration()
                            .withEncodedCertificate("*******Base64 encoded Certificate******************")
                            .withCertificatePassword("Password")
                            .withStoreName(CertificateConfigurationStoreName.CERTIFICATE_AUTHORITY)))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json
     */
    /**
     * Sample code: ApiManagementCreateMultiRegionServiceWithCustomHostname.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateMultiRegionServiceWithCustomHostname(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("West US")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withHostnameConfigurations(
                Arrays
                    .asList(
                        new HostnameConfiguration()
                            .withType(HostnameType.PROXY)
                            .withHostname("gateway1.msitesting.net")
                            .withEncodedCertificate("****** Base 64 Encoded Certificate ************")
                            .withCertificatePassword("Password")
                            .withDefaultSslBinding(true),
                        new HostnameConfiguration()
                            .withType(HostnameType.MANAGEMENT)
                            .withHostname("mgmt.msitesting.net")
                            .withEncodedCertificate("****** Base 64 Encoded Certificate ************")
                            .withCertificatePassword("Password"),
                        new HostnameConfiguration()
                            .withType(HostnameType.PORTAL)
                            .withHostname("portal1.msitesting.net")
                            .withEncodedCertificate("****** Base 64 Encoded Certificate ************")
                            .withCertificatePassword("Password")))
            .withAdditionalLocations(
                Arrays
                    .asList(
                        new AdditionalLocation()
                            .withLocation("East US")
                            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
                            .withDisableGateway(true)))
            .withVirtualNetworkType(VirtualNetworkType.NONE)
            .withApiVersionConstraint(new ApiVersionConstraint().withMinApiVersion("2019-01-01"))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUndelete.json
     */
    /**
     * Sample code: ApiManagementUndelete.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUndelete(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("South Central US")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.DEVELOPER).withCapacity(1))
            .withPublisherEmail("foo@contoso.com")
            .withPublisherName("foo")
            .withRestore(true)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json
     */
    /**
     * Sample code: ApiManagementCreateServiceWithUserAssignedIdentity.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceWithUserAssignedIdentity(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("West US")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.CONSUMPTION).withCapacity(0))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withIdentity(
                new ApiManagementServiceIdentity()
                    .withType(ApimIdentityType.USER_ASSIGNED)
                    .withUserAssignedIdentities(
                        mapOf(
                            "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1",
                            new UserIdentityProperties())))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceInZones.json
     */
    /**
     * Sample code: ApiManagementCreateServiceInZones.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceInZones(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("North europe")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(2))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withZones(Arrays.asList("1", "2"))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json
     */
    /**
     * Sample code: ApiManagementCreateServiceInVnetWithPublicIP.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceInVnetWithPublicIP(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("East US 2 EUAP")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(2))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withZones(Arrays.asList("1", "2"))
            .withPublicIpAddressId(
                "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet")
            .withVirtualNetworkConfiguration(
                new VirtualNetworkConfiguration()
                    .withSubnetResourceId(
                        "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"))
            .withVirtualNetworkType(VirtualNetworkType.EXTERNAL)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json
     */
    /**
     * Sample code: ApiManagementCreateServiceWithCustomHostnameKeyVault.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceWithCustomHostnameKeyVault(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("North Europe")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
            .withPublisherEmail("apim@autorestsdk.com")
            .withPublisherName("autorestsdk")
            .withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
            .withIdentity(
                new ApiManagementServiceIdentity()
                    .withType(ApimIdentityType.USER_ASSIGNED)
                    .withUserAssignedIdentities(
                        mapOf(
                            "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1",
                            new UserIdentityProperties())))
            .withHostnameConfigurations(
                Arrays
                    .asList(
                        new HostnameConfiguration()
                            .withType(HostnameType.PROXY)
                            .withHostname("gateway1.msitesting.net")
                            .withKeyVaultId("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert")
                            .withIdentityClientId("329419bc-adec-4dce-9568-25a6d486e468")
                            .withDefaultSslBinding(true),
                        new HostnameConfiguration()
                            .withType(HostnameType.MANAGEMENT)
                            .withHostname("mgmt.msitesting.net")
                            .withKeyVaultId("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert")
                            .withIdentityClientId("329419bc-adec-4dce-9568-25a6d486e468"),
                        new HostnameConfiguration()
                            .withType(HostnameType.PORTAL)
                            .withHostname("portal1.msitesting.net")
                            .withKeyVaultId("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert")
                            .withIdentityClientId("329419bc-adec-4dce-9568-25a6d486e468")))
            .withVirtualNetworkType(VirtualNetworkType.NONE)
            .withApiVersionConstraint(new ApiVersionConstraint().withMinApiVersion("2019-01-01"))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateService.json
     */
    /**
     * Sample code: ApiManagementCreateService.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateService(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .define("apimService1")
            .withRegion("South Central US")
            .withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.DEVELOPER).withCapacity(1))
            .withPublisherEmail("foo@contoso.com")
            .withPublisherName("foo")
            .withTags(mapOf("Name", "Contoso", "Test", "User"))
            .create();
    }

    @SuppressWarnings("unchecked")
    private static <T> Map<String, T> mapOf(Object... inputs) {
        Map<String, T> map = new HashMap<>();
        for (int i = 0; i < inputs.length; i += 2) {
            String key = (String) inputs[i];
            T value = (T) inputs[i + 1];
            map.put(key, value);
        }
        return map;
    }
}
```

### ApiManagementService_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementService Delete. */
public final class ApiManagementServiceDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceDeleteService.json
     */
    /**
     * Sample code: ApiManagementServiceDeleteService.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceDeleteService(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().delete("rg1", "apimService1", Context.NONE);
    }
}
```

### ApiManagementService_GetByResourceGroup

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementService GetByResourceGroup. */
public final class ApiManagementServiceGetByResourceGroupSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetMultiRegionInternalVnet.json
     */
    /**
     * Sample code: ApiManagementServiceGetMultiRegionInternalVnet.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetMultiRegionInternalVnet(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().getByResourceGroupWithResponse("rg1", "apimService1", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetServiceHavingMsi.json
     */
    /**
     * Sample code: ApiManagementServiceGetServiceHavingMsi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetServiceHavingMsi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().getByResourceGroupWithResponse("rg1", "apimService1", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetService.json
     */
    /**
     * Sample code: ApiManagementServiceGetService.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetService(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().getByResourceGroupWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### ApiManagementService_GetDomainOwnershipIdentifier

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementService GetDomainOwnershipIdentifier. */
public final class ApiManagementServiceGetDomainOwnershipIdentifierSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetDomainOwnershipIdentifier.json
     */
    /**
     * Sample code: ApiManagementServiceGetDomainOwnershipIdentifier.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetDomainOwnershipIdentifier(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().getDomainOwnershipIdentifierWithResponse(Context.NONE);
    }
}
```

### ApiManagementService_GetSsoToken

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementService GetSsoToken. */
public final class ApiManagementServiceGetSsoTokenSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetSsoToken.json
     */
    /**
     * Sample code: ApiManagementServiceGetSsoToken.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetSsoToken(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().getSsoTokenWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### ApiManagementService_List

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementService List. */
public final class ApiManagementServiceListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscription.json
     */
    /**
     * Sample code: ApiManagementListServiceBySubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListServiceBySubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().list(Context.NONE);
    }
}
```

### ApiManagementService_ListByResourceGroup

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementService ListByResourceGroup. */
public final class ApiManagementServiceListByResourceGroupSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscriptionAndResourceGroup.json
     */
    /**
     * Sample code: ApiManagementListServiceBySubscriptionAndResourceGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListServiceBySubscriptionAndResourceGroup(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().listByResourceGroup("rg1", Context.NONE);
    }
}
```

### ApiManagementService_Restore

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessType;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceBackupRestoreParameters;

/** Samples for ApiManagementService Restore. */
public final class ApiManagementServiceRestoreSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRestoreWithAccessKey.json
     */
    /**
     * Sample code: ApiManagementRestoreService.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementRestoreService(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiManagementServices()
            .restore(
                "rg1",
                "apimService1",
                new ApiManagementServiceBackupRestoreParameters()
                    .withStorageAccount("teststorageaccount")
                    .withContainerName("backupContainer")
                    .withBackupName("apimService1backup_2017_03_19")
                    .withAccessType(AccessType.ACCESS_KEY)
                    .withAccessKey("**************************************************"),
                Context.NONE);
    }
}
```

### ApiManagementService_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AdditionalLocation;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceResource;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkConfiguration;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/** Samples for ApiManagementService Update. */
public final class ApiManagementServiceUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceDisableTls10.json
     */
    /**
     * Sample code: ApiManagementUpdateServiceDisableTls10.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateServiceDisableTls10(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiManagementServiceResource resource =
            manager
                .apiManagementServices()
                .getByResourceGroupWithResponse("rg1", "apimService1", Context.NONE)
                .getValue();
        resource
            .update()
            .withCustomProperties(
                mapOf("Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10", "false"))
            .apply();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceToNewVnetAndAZs.json
     */
    /**
     * Sample code: ApiManagementUpdateServiceToNewVnetAndAvailabilityZones.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateServiceToNewVnetAndAvailabilityZones(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiManagementServiceResource resource =
            manager
                .apiManagementServices()
                .getByResourceGroupWithResponse("rg1", "apimService1", Context.NONE)
                .getValue();
        resource
            .update()
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(3))
            .withZones(Arrays.asList("1", "2", "3"))
            .withPublicIpAddressId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/publicip-apim-japan-east")
            .withVirtualNetworkConfiguration(
                new VirtualNetworkConfiguration()
                    .withSubnetResourceId(
                        "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet-apim-japaneast/subnets/apim2"))
            .withAdditionalLocations(
                Arrays
                    .asList(
                        new AdditionalLocation()
                            .withLocation("Australia East")
                            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(3))
                            .withZones(Arrays.asList("1", "2", "3"))
                            .withPublicIpAddressId(
                                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/apim-australia-east-publicip")
                            .withVirtualNetworkConfiguration(
                                new VirtualNetworkConfiguration()
                                    .withSubnetResourceId(
                                        "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/apimaeavnet/subnets/default"))))
            .withVirtualNetworkType(VirtualNetworkType.EXTERNAL)
            .apply();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServicePublisherDetails.json
     */
    /**
     * Sample code: ApiManagementUpdateServicePublisherDetails.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateServicePublisherDetails(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiManagementServiceResource resource =
            manager
                .apiManagementServices()
                .getByResourceGroupWithResponse("rg1", "apimService1", Context.NONE)
                .getValue();
        resource.update().withPublisherEmail("foobar@live.com").withPublisherName("Contoso Vnext").apply();
    }

    @SuppressWarnings("unchecked")
    private static <T> Map<String, T> mapOf(Object... inputs) {
        Map<String, T> map = new HashMap<>();
        for (int i = 0; i < inputs.length; i += 2) {
            String key = (String) inputs[i];
            T value = (T) inputs[i + 1];
            map.put(key, value);
        }
        return map;
    }
}
```

### ApiManagementServiceSkus_ListAvailableServiceSkus

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementServiceSkus ListAvailableServiceSkus. */
public final class ApiManagementServiceSkusListAvailableServiceSkusSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json
     */
    /**
     * Sample code: ApiManagementListSKUs-Dedicated.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListSKUsDedicated(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServiceSkus().listAvailableServiceSkus("rg1", "apimService1", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json
     */
    /**
     * Sample code: ApiManagementListSKUs-Consumption.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListSKUsConsumption(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServiceSkus().listAvailableServiceSkus("rg1", "apimService1", Context.NONE);
    }
}
```

### ApiManagementSkus_List

```java
import com.azure.core.util.Context;

/** Samples for ApiManagementSkus List. */
public final class ApiManagementSkusListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSku.json
     */
    /**
     * Sample code: Lists all available Resource SKUs.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void listsAllAvailableResourceSKUs(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementSkus().list(Context.NONE);
    }
}
```

### ApiOperation_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.RepresentationContract;
import com.azure.resourcemanager.apimanagement.models.RequestContract;
import com.azure.resourcemanager.apimanagement.models.ResponseContract;
import java.util.Arrays;

/** Samples for ApiOperation CreateOrUpdate. */
public final class ApiOperationCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperation.json
     */
    /**
     * Sample code: ApiManagementCreateApiOperation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiOperation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperations()
            .define("newoperations")
            .withExistingApi("rg1", "apimService1", "PetStoreTemplate2")
            .withDisplayName("createUser2")
            .withMethod("POST")
            .withUrlTemplate("/user1")
            .withTemplateParameters(Arrays.asList())
            .withDescription("This can only be done by the logged in user.")
            .withRequest(
                new RequestContract()
                    .withDescription("Created user object")
                    .withQueryParameters(Arrays.asList())
                    .withHeaders(Arrays.asList())
                    .withRepresentations(
                        Arrays
                            .asList(
                                new RepresentationContract()
                                    .withContentType("application/json")
                                    .withSchemaId("592f6c1d0af5840ca8897f0c")
                                    .withTypeName("User"))))
            .withResponses(
                Arrays
                    .asList(
                        new ResponseContract()
                            .withStatusCode(200)
                            .withDescription("successful operation")
                            .withRepresentations(
                                Arrays
                                    .asList(
                                        new RepresentationContract().withContentType("application/xml"),
                                        new RepresentationContract().withContentType("application/json")))
                            .withHeaders(Arrays.asList())))
            .create();
    }
}
```

### ApiOperation_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiOperation Delete. */
public final class ApiOperationDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperation.json
     */
    /**
     * Sample code: ApiManagementDeleteApiOperation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiOperation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperations()
            .deleteWithResponse(
                "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "*", Context.NONE);
    }
}
```

### ApiOperation_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiOperation Get. */
public final class ApiOperationGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperation.json
     */
    /**
     * Sample code: ApiManagementGetApiOperation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiOperation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperations()
            .getWithResponse(
                "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPetStore.json
     */
    /**
     * Sample code: ApiManagementGetApiOperationPetStore.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiOperationPetStore(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiOperations().getWithResponse("rg1", "apimService1", "swagger-petstore", "loginUser", Context.NONE);
    }
}
```

### ApiOperation_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiOperation GetEntityTag. */
public final class ApiOperationGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperation.json
     */
    /**
     * Sample code: ApiManagementHeadApiOperation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiOperation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperations()
            .getEntityTagWithResponse(
                "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", Context.NONE);
    }
}
```

### ApiOperation_ListByApi

```java
import com.azure.core.util.Context;

/** Samples for ApiOperation ListByApi. */
public final class ApiOperationListByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperations.json
     */
    /**
     * Sample code: ApiManagementListApiOperations.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiOperations(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperations()
            .listByApi("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", null, null, null, null, Context.NONE);
    }
}
```

### ApiOperation_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.OperationContract;
import com.azure.resourcemanager.apimanagement.models.ParameterContract;
import com.azure.resourcemanager.apimanagement.models.RequestContract;
import com.azure.resourcemanager.apimanagement.models.ResponseContract;
import java.util.Arrays;

/** Samples for ApiOperation Update. */
public final class ApiOperationUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiOperation.json
     */
    /**
     * Sample code: ApiManagementUpdateApiOperation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApiOperation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        OperationContract resource =
            manager
                .apiOperations()
                .getWithResponse("rg1", "apimService1", "echo-api", "operationId", Context.NONE)
                .getValue();
        resource
            .update()
            .withDisplayName("Retrieve resource")
            .withMethod("GET")
            .withUrlTemplate("/resource")
            .withTemplateParameters(Arrays.asList())
            .withRequest(
                new RequestContract()
                    .withQueryParameters(
                        Arrays
                            .asList(
                                new ParameterContract()
                                    .withName("param1")
                                    .withDescription(
                                        "A sample parameter that is required and has a default value of \"sample\".")
                                    .withType("string")
                                    .withDefaultValue("sample")
                                    .withRequired(true)
                                    .withValues(Arrays.asList("sample")))))
            .withResponses(
                Arrays
                    .asList(
                        new ResponseContract()
                            .withStatusCode(200)
                            .withDescription("Returned in all cases.")
                            .withRepresentations(Arrays.asList())
                            .withHeaders(Arrays.asList()),
                        new ResponseContract()
                            .withStatusCode(500)
                            .withDescription("Server Error.")
                            .withRepresentations(Arrays.asList())
                            .withHeaders(Arrays.asList())))
            .withIfMatch("*")
            .apply();
    }
}
```

### ApiOperationPolicy_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.PolicyContentFormat;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiOperationPolicy CreateOrUpdate. */
public final class ApiOperationPolicyCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationPolicy.json
     */
    /**
     * Sample code: ApiManagementCreateApiOperationPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiOperationPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperationPolicies()
            .define(PolicyIdName.POLICY)
            .withExistingOperation("rg1", "apimService1", "5600b57e7e8880006a040001", "5600b57e7e8880006a080001")
            .withValue("<policies> <inbound /> <backend>    <forward-request />  </backend>  <outbound /></policies>")
            .withFormat(PolicyContentFormat.XML)
            .withIfMatch("*")
            .create();
    }
}
```

### ApiOperationPolicy_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiOperationPolicy Delete. */
public final class ApiOperationPolicyDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationPolicy.json
     */
    /**
     * Sample code: ApiManagementDeleteApiOperationPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiOperationPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperationPolicies()
            .deleteWithResponse(
                "rg1", "apimService1", "testapi", "testoperation", PolicyIdName.POLICY, "*", Context.NONE);
    }
}
```

### ApiOperationPolicy_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiOperationPolicy Get. */
public final class ApiOperationPolicyGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPolicy.json
     */
    /**
     * Sample code: ApiManagementGetApiOperationPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiOperationPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperationPolicies()
            .getWithResponse(
                "rg1",
                "apimService1",
                "5600b539c53f5b0062040001",
                "5600b53ac53f5b0062080006",
                PolicyIdName.POLICY,
                null,
                Context.NONE);
    }
}
```

### ApiOperationPolicy_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiOperationPolicy GetEntityTag. */
public final class ApiOperationPolicyGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationPolicy.json
     */
    /**
     * Sample code: ApiManagementHeadApiOperationPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiOperationPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperationPolicies()
            .getEntityTagWithResponse(
                "rg1",
                "apimService1",
                "5600b539c53f5b0062040001",
                "5600b53ac53f5b0062080006",
                PolicyIdName.POLICY,
                Context.NONE);
    }
}
```

### ApiOperationPolicy_ListByOperation

```java
import com.azure.core.util.Context;

/** Samples for ApiOperationPolicy ListByOperation. */
public final class ApiOperationPolicyListByOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationPolicies.json
     */
    /**
     * Sample code: ApiManagementListApiOperationPolicies.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiOperationPolicies(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiOperationPolicies()
            .listByOperationWithResponse(
                "rg1", "apimService1", "599e2953193c3c0bd0b3e2fa", "599e29ab193c3c0bd0b3e2fb", Context.NONE);
    }
}
```

### ApiPolicy_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner;
import com.azure.resourcemanager.apimanagement.models.PolicyContentFormat;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiPolicy CreateOrUpdate. */
public final class ApiPolicyCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicyNonXmlEncoded.json
     */
    /**
     * Sample code: ApiManagementCreateApiPolicyNonXmlEncoded.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiPolicyNonXmlEncoded(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiPolicies()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                "5600b57e7e8880006a040001",
                PolicyIdName.POLICY,
                new PolicyContractInner()
                    .withValue(
                        "<policies>\r\n"
                            + "     <inbound>\r\n"
                            + "     <base />\r\n"
                            + "  <set-header name=\"newvalue\" exists-action=\"override\">\r\n"
                            + "   <value>\"@(context.Request.Headers.FirstOrDefault(h => h.Ke==\"Via\"))\" </value>\r\n"
                            + "    </set-header>\r\n"
                            + "  </inbound>\r\n"
                            + "      </policies>")
                    .withFormat(PolicyContentFormat.RAWXML),
                "*",
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicy.json
     */
    /**
     * Sample code: ApiManagementCreateApiPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiPolicies()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                "5600b57e7e8880006a040001",
                PolicyIdName.POLICY,
                new PolicyContractInner()
                    .withValue(
                        "<policies> <inbound /> <backend>    <forward-request />  </backend>  <outbound /></policies>")
                    .withFormat(PolicyContentFormat.XML),
                "*",
                Context.NONE);
    }
}
```

### ApiPolicy_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiPolicy Delete. */
public final class ApiPolicyDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiPolicy.json
     */
    /**
     * Sample code: ApiManagementDeleteApiPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiPolicies()
            .deleteWithResponse("rg1", "apimService1", "loggerId", PolicyIdName.POLICY, "*", Context.NONE);
    }
}
```

### ApiPolicy_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiPolicy Get. */
public final class ApiPolicyGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiPolicy.json
     */
    /**
     * Sample code: ApiManagementGetApiPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiPolicy(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiPolicies()
            .getWithResponse(
                "rg1", "apimService1", "5600b59475ff190048040001", PolicyIdName.POLICY, null, Context.NONE);
    }
}
```

### ApiPolicy_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ApiPolicy GetEntityTag. */
public final class ApiPolicyGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiPolicy.json
     */
    /**
     * Sample code: ApiManagementHeadApiPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiPolicies()
            .getEntityTagWithResponse(
                "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", PolicyIdName.POLICY, Context.NONE);
    }
}
```

### ApiPolicy_ListByApi

```java
import com.azure.core.util.Context;

/** Samples for ApiPolicy ListByApi. */
public final class ApiPolicyListByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiPolicies.json
     */
    /**
     * Sample code: ApiManagementListApiPolicies.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiPolicies(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiPolicies().listByApiWithResponse("rg1", "apimService1", "5600b59475ff190048040001", Context.NONE);
    }
}
```

### ApiProduct_ListByApis

```java
import com.azure.core.util.Context;

/** Samples for ApiProduct ListByApis. */
public final class ApiProductListByApisSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiProducts.json
     */
    /**
     * Sample code: ApiManagementListApiProducts.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiProducts(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiProducts()
            .listByApis("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", null, null, null, Context.NONE);
    }
}
```

### ApiRelease_CreateOrUpdate

```java
/** Samples for ApiRelease CreateOrUpdate. */
public final class ApiReleaseCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRelease.json
     */
    /**
     * Sample code: ApiManagementCreateApiRelease.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiRelease(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiReleases()
            .define("testrev")
            .withExistingApi("rg1", "apimService1", "a1")
            .withApiId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1")
            .withNotes("yahooagain")
            .create();
    }
}
```

### ApiRelease_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiRelease Delete. */
public final class ApiReleaseDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiRelease.json
     */
    /**
     * Sample code: ApiManagementDeleteApiRelease.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiRelease(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiReleases()
            .deleteWithResponse("rg1", "apimService1", "5a5fcc09124a7fa9b89f2f1d", "testrev", "*", Context.NONE);
    }
}
```

### ApiRelease_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiRelease Get. */
public final class ApiReleaseGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRelease.json
     */
    /**
     * Sample code: ApiManagementGetApiRelease.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiRelease(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiReleases().getWithResponse("rg1", "apimService1", "a1", "5a7cb545298324c53224a799", Context.NONE);
    }
}
```

### ApiRelease_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiRelease GetEntityTag. */
public final class ApiReleaseGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiRelease.json
     */
    /**
     * Sample code: ApiManagementHeadApiRelease.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiRelease(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiReleases()
            .getEntityTagWithResponse("rg1", "apimService1", "a1", "5a7cb545298324c53224a799", Context.NONE);
    }
}
```

### ApiRelease_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiRelease ListByService. */
public final class ApiReleaseListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiReleases.json
     */
    /**
     * Sample code: ApiManagementListApiReleases.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiReleases(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiReleases().listByService("rg1", "apimService1", "a1", null, null, null, Context.NONE);
    }
}
```

### ApiRelease_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ApiReleaseContract;

/** Samples for ApiRelease Update. */
public final class ApiReleaseUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiRelease.json
     */
    /**
     * Sample code: ApiManagementUpdateApiRelease.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApiRelease(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiReleaseContract resource =
            manager.apiReleases().getWithResponse("rg1", "apimService1", "a1", "testrev", Context.NONE).getValue();
        resource
            .update()
            .withApiId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1")
            .withNotes("yahooagain")
            .withIfMatch("*")
            .apply();
    }
}
```

### ApiRevision_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiRevision ListByService. */
public final class ApiRevisionListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiRevisions.json
     */
    /**
     * Sample code: ApiManagementListApiRevisions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiRevisions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiRevisions()
            .listByService("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", null, null, null, Context.NONE);
    }
}
```

### ApiSchema_CreateOrUpdate

```java
/** Samples for ApiSchema CreateOrUpdate. */
public final class ApiSchemaCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiSchema.json
     */
    /**
     * Sample code: ApiManagementCreateApiSchema.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiSchema(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiSchemas()
            .define("ec12520d-9d48-4e7b-8f39-698ca2ac63f1")
            .withExistingApi("rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b")
            .withContentType("application/vnd.ms-azure-apim.xsd+xml")
            .withValue(
                "<s:schema elementFormDefault=\"qualified\" targetNamespace=\"http://ws.cdyne.com/WeatherWS/\""
                    + " xmlns:tns=\"http://ws.cdyne.com/WeatherWS/\" xmlns:s=\"http://www.w3.org/2001/XMLSchema\""
                    + " xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\""
                    + " xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\""
                    + " xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\""
                    + " xmlns:tm=\"http://microsoft.com/wsdl/mime/textMatching/\""
                    + " xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\""
                    + " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\""
                    + " xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\""
                    + " xmlns:apim-wsdltns=\"http://ws.cdyne.com/WeatherWS/\">\r\n"
                    + "  <s:element name=\"GetWeatherInformation\">\r\n"
                    + "    <s:complexType />\r\n"
                    + "  </s:element>\r\n"
                    + "  <s:element name=\"GetWeatherInformationResponse\">\r\n"
                    + "    <s:complexType>\r\n"
                    + "      <s:sequence>\r\n"
                    + "        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetWeatherInformationResult\""
                    + " type=\"tns:ArrayOfWeatherDescription\" />\r\n"
                    + "      </s:sequence>\r\n"
                    + "    </s:complexType>\r\n"
                    + "  </s:element>\r\n"
                    + "  <s:complexType name=\"ArrayOfWeatherDescription\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"WeatherDescription\""
                    + " type=\"tns:WeatherDescription\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:complexType name=\"WeatherDescription\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"PictureURL\" type=\"s:string\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:element name=\"GetCityForecastByZIP\">\r\n"
                    + "    <s:complexType>\r\n"
                    + "      <s:sequence>\r\n"
                    + "        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n"
                    + "      </s:sequence>\r\n"
                    + "    </s:complexType>\r\n"
                    + "  </s:element>\r\n"
                    + "  <s:element name=\"GetCityForecastByZIPResponse\">\r\n"
                    + "    <s:complexType>\r\n"
                    + "      <s:sequence>\r\n"
                    + "        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetCityForecastByZIPResult\""
                    + " type=\"tns:ForecastReturn\" />\r\n"
                    + "      </s:sequence>\r\n"
                    + "    </s:complexType>\r\n"
                    + "  </s:element>\r\n"
                    + "  <s:complexType name=\"ForecastReturn\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\""
                    + " />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ForecastResult\""
                    + " type=\"tns:ArrayOfForecast\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:complexType name=\"ArrayOfForecast\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"unbounded\" name=\"Forecast\" nillable=\"true\""
                    + " type=\"tns:Forecast\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:complexType name=\"Forecast\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Date\" type=\"s:dateTime\" />\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Desciption\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Temperatures\" type=\"tns:temp\" />\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"ProbabilityOfPrecipiation\""
                    + " type=\"tns:POP\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:complexType name=\"temp\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"MorningLow\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"DaytimeHigh\" type=\"s:string\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:complexType name=\"POP\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Nighttime\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Daytime\" type=\"s:string\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:element name=\"GetCityWeatherByZIP\">\r\n"
                    + "    <s:complexType>\r\n"
                    + "      <s:sequence>\r\n"
                    + "        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ZIP\" type=\"s:string\" />\r\n"
                    + "      </s:sequence>\r\n"
                    + "    </s:complexType>\r\n"
                    + "  </s:element>\r\n"
                    + "  <s:element name=\"GetCityWeatherByZIPResponse\">\r\n"
                    + "    <s:complexType>\r\n"
                    + "      <s:sequence>\r\n"
                    + "        <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"GetCityWeatherByZIPResult\""
                    + " type=\"tns:WeatherReturn\" />\r\n"
                    + "      </s:sequence>\r\n"
                    + "    </s:complexType>\r\n"
                    + "  </s:element>\r\n"
                    + "  <s:complexType name=\"WeatherReturn\">\r\n"
                    + "    <s:sequence>\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"Success\" type=\"s:boolean\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ResponseText\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"State\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"City\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WeatherStationCity\" type=\"s:string\""
                    + " />\r\n"
                    + "      <s:element minOccurs=\"1\" maxOccurs=\"1\" name=\"WeatherID\" type=\"s:short\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Description\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Temperature\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"RelativeHumidity\" type=\"s:string\""
                    + " />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Wind\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Pressure\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Visibility\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"WindChill\" type=\"s:string\" />\r\n"
                    + "      <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"Remarks\" type=\"s:string\" />\r\n"
                    + "    </s:sequence>\r\n"
                    + "  </s:complexType>\r\n"
                    + "  <s:element name=\"ArrayOfWeatherDescription\" nillable=\"true\""
                    + " type=\"tns:ArrayOfWeatherDescription\" />\r\n"
                    + "  <s:element name=\"ForecastReturn\" nillable=\"true\" type=\"tns:ForecastReturn\" />\r\n"
                    + "  <s:element name=\"WeatherReturn\" type=\"tns:WeatherReturn\" />\r\n"
                    + "</s:schema>")
            .create();
    }
}
```

### ApiSchema_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiSchema Delete. */
public final class ApiSchemaDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiSchema.json
     */
    /**
     * Sample code: ApiManagementDeleteApiSchema.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiSchema(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiSchemas()
            .deleteWithResponse(
                "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", "*", null, Context.NONE);
    }
}
```

### ApiSchema_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiSchema Get. */
public final class ApiSchemaGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiSchema.json
     */
    /**
     * Sample code: ApiManagementGetApiSchema.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiSchema(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiSchemas()
            .getWithResponse(
                "rg1",
                "apimService1",
                "59d6bb8f1f7fab13dc67ec9b",
                "ec12520d-9d48-4e7b-8f39-698ca2ac63f1",
                Context.NONE);
    }
}
```

### ApiSchema_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiSchema GetEntityTag. */
public final class ApiSchemaGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiSchema.json
     */
    /**
     * Sample code: ApiManagementHeadApiSchema.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiSchema(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiSchemas()
            .getEntityTagWithResponse(
                "rg1",
                "apimService1",
                "57d1f7558aa04f15146d9d8a",
                "ec12520d-9d48-4e7b-8f39-698ca2ac63f1",
                Context.NONE);
    }
}
```

### ApiSchema_ListByApi

```java
import com.azure.core.util.Context;

/** Samples for ApiSchema ListByApi. */
public final class ApiSchemaListByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiSchemas.json
     */
    /**
     * Sample code: ApiManagementListApiSchemas.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiSchemas(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiSchemas()
            .listByApi("rg1", "apimService1", "59d5b28d1f7fab116c282650", null, null, null, Context.NONE);
    }
}
```

### ApiTagDescription_CreateOrUpdate

```java
/** Samples for ApiTagDescription CreateOrUpdate. */
public final class ApiTagDescriptionCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTagDescription.json
     */
    /**
     * Sample code: ApiManagementCreateApiTagDescription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiTagDescription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiTagDescriptions()
            .define("tagId1")
            .withExistingApi("rg1", "apimService1", "5931a75ae4bbd512a88c680b")
            .withDescription(
                "Some description that will be displayed for operation's tag if the tag is assigned to operation of the"
                    + " API")
            .withExternalDocsUrl("http://some.url/additionaldoc")
            .withExternalDocsDescription("Description of the external docs resource")
            .create();
    }
}
```

### ApiTagDescription_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiTagDescription Delete. */
public final class ApiTagDescriptionDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTagDescription.json
     */
    /**
     * Sample code: ApiManagementDeleteApiTagDescription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiTagDescription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiTagDescriptions()
            .deleteWithResponse(
                "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", "*", Context.NONE);
    }
}
```

### ApiTagDescription_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiTagDescription Get. */
public final class ApiTagDescriptionGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTagDescription.json
     */
    /**
     * Sample code: ApiManagementGetApiTagDescription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiTagDescription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiTagDescriptions()
            .getWithResponse(
                "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### ApiTagDescription_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiTagDescription GetEntityTag. */
public final class ApiTagDescriptionGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTagDescription.json
     */
    /**
     * Sample code: ApiManagementHeadApiTagDescription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiTagDescription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiTagDescriptions()
            .getEntityTagWithResponse(
                "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### ApiTagDescription_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiTagDescription ListByService. */
public final class ApiTagDescriptionListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTagDescriptions.json
     */
    /**
     * Sample code: ApiManagementListApiTagDescriptions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiTagDescriptions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiTagDescriptions()
            .listByService("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", null, null, null, Context.NONE);
    }
}
```

### ApiVersionSet_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.VersioningScheme;

/** Samples for ApiVersionSet CreateOrUpdate. */
public final class ApiVersionSetCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiVersionSet.json
     */
    /**
     * Sample code: ApiManagementCreateApiVersionSet.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiVersionSet(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .apiVersionSets()
            .define("api1")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("api set 1")
            .withVersioningScheme(VersioningScheme.SEGMENT)
            .withDescription("Version configuration")
            .create();
    }
}
```

### ApiVersionSet_Delete

```java
import com.azure.core.util.Context;

/** Samples for ApiVersionSet Delete. */
public final class ApiVersionSetDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiVersionSet.json
     */
    /**
     * Sample code: ApiManagementDeleteApiVersionSet.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiVersionSet(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiVersionSets().deleteWithResponse("rg1", "apimService1", "a1", "*", Context.NONE);
    }
}
```

### ApiVersionSet_Get

```java
import com.azure.core.util.Context;

/** Samples for ApiVersionSet Get. */
public final class ApiVersionSetGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiVersionSet.json
     */
    /**
     * Sample code: ApiManagementGetApiVersionSet.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiVersionSet(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiVersionSets().getWithResponse("rg1", "apimService1", "vs1", Context.NONE);
    }
}
```

### ApiVersionSet_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ApiVersionSet GetEntityTag. */
public final class ApiVersionSetGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiVersionSet.json
     */
    /**
     * Sample code: ApiManagementHeadApiVersionSet.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiVersionSet(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiVersionSets().getEntityTagWithResponse("rg1", "apimService1", "vs1", Context.NONE);
    }
}
```

### ApiVersionSet_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ApiVersionSet ListByService. */
public final class ApiVersionSetListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiVersionSets.json
     */
    /**
     * Sample code: ApiManagementListApiVersionSets.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiVersionSets(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiVersionSets().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### ApiVersionSet_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ApiVersionSetContract;
import com.azure.resourcemanager.apimanagement.models.VersioningScheme;

/** Samples for ApiVersionSet Update. */
public final class ApiVersionSetUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiVersionSet.json
     */
    /**
     * Sample code: ApiManagementUpdateApiVersionSet.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApiVersionSet(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiVersionSetContract resource =
            manager.apiVersionSets().getWithResponse("rg1", "apimService1", "vs1", Context.NONE).getValue();
        resource
            .update()
            .withDisplayName("api set 1")
            .withVersioningScheme(VersioningScheme.SEGMENT)
            .withDescription("Version configuration")
            .withIfMatch("*")
            .apply();
    }
}
```

### AuthorizationServer_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.AuthorizationMethod;
import com.azure.resourcemanager.apimanagement.models.BearerTokenSendingMethod;
import com.azure.resourcemanager.apimanagement.models.GrantType;
import java.util.Arrays;

/** Samples for AuthorizationServer CreateOrUpdate. */
public final class AuthorizationServerCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAuthorizationServer.json
     */
    /**
     * Sample code: ApiManagementCreateAuthorizationServer.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateAuthorizationServer(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .authorizationServers()
            .define("newauthServer")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("test2")
            .withClientRegistrationEndpoint("https://www.contoso.com/apps")
            .withAuthorizationEndpoint("https://www.contoso.com/oauth2/auth")
            .withGrantTypes(Arrays.asList(GrantType.AUTHORIZATION_CODE, GrantType.IMPLICIT))
            .withClientId("1")
            .withClientSecret("2")
            .withDescription("test server")
            .withAuthorizationMethods(Arrays.asList(AuthorizationMethod.GET))
            .withTokenEndpoint("https://www.contoso.com/oauth2/token")
            .withSupportState(true)
            .withDefaultScope("read write")
            .withBearerTokenSendingMethods(Arrays.asList(BearerTokenSendingMethod.AUTHORIZATION_HEADER))
            .withResourceOwnerUsername("un")
            .withResourceOwnerPassword("pwd")
            .create();
    }
}
```

### AuthorizationServer_Delete

```java
import com.azure.core.util.Context;

/** Samples for AuthorizationServer Delete. */
public final class AuthorizationServerDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteAuthorizationServer.json
     */
    /**
     * Sample code: ApiManagementDeleteAuthorizationServer.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteAuthorizationServer(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.authorizationServers().deleteWithResponse("rg1", "apimService1", "newauthServer2", "*", Context.NONE);
    }
}
```

### AuthorizationServer_Get

```java
import com.azure.core.util.Context;

/** Samples for AuthorizationServer Get. */
public final class AuthorizationServerGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetAuthorizationServer.json
     */
    /**
     * Sample code: ApiManagementGetAuthorizationServer.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetAuthorizationServer(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.authorizationServers().getWithResponse("rg1", "apimService1", "newauthServer2", Context.NONE);
    }
}
```

### AuthorizationServer_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for AuthorizationServer GetEntityTag. */
public final class AuthorizationServerGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadAuthorizationServer.json
     */
    /**
     * Sample code: ApiManagementHeadAuthorizationServer.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadAuthorizationServer(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.authorizationServers().getEntityTagWithResponse("rg1", "apimService1", "newauthServer2", Context.NONE);
    }
}
```

### AuthorizationServer_ListByService

```java
import com.azure.core.util.Context;

/** Samples for AuthorizationServer ListByService. */
public final class AuthorizationServerListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListAuthorizationServers.json
     */
    /**
     * Sample code: ApiManagementListAuthorizationServers.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListAuthorizationServers(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.authorizationServers().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### AuthorizationServer_ListSecrets

```java
import com.azure.core.util.Context;

/** Samples for AuthorizationServer ListSecrets. */
public final class AuthorizationServerListSecretsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementAuthorizationServerListSecrets.json
     */
    /**
     * Sample code: ApiManagementAuthorizationServerListSecrets.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementAuthorizationServerListSecrets(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.authorizationServers().listSecretsWithResponse("rg1", "apimService1", "newauthServer2", Context.NONE);
    }
}
```

### AuthorizationServer_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AuthorizationServerContract;

/** Samples for AuthorizationServer Update. */
public final class AuthorizationServerUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateAuthorizationServer.json
     */
    /**
     * Sample code: ApiManagementUpdateAuthorizationServer.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateAuthorizationServer(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        AuthorizationServerContract resource =
            manager
                .authorizationServers()
                .getWithResponse("rg1", "apimService1", "newauthServer", Context.NONE)
                .getValue();
        resource.update().withClientId("update").withClientSecret("updated").withIfMatch("*").apply();
    }
}
```

### Backend_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.BackendAuthorizationHeaderCredentials;
import com.azure.resourcemanager.apimanagement.models.BackendCredentialsContract;
import com.azure.resourcemanager.apimanagement.models.BackendProperties;
import com.azure.resourcemanager.apimanagement.models.BackendProtocol;
import com.azure.resourcemanager.apimanagement.models.BackendProxyContract;
import com.azure.resourcemanager.apimanagement.models.BackendServiceFabricClusterProperties;
import com.azure.resourcemanager.apimanagement.models.BackendTlsProperties;
import com.azure.resourcemanager.apimanagement.models.X509CertificateName;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/** Samples for Backend CreateOrUpdate. */
public final class BackendCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendServiceFabric.json
     */
    /**
     * Sample code: ApiManagementCreateBackendServiceFabric.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateBackendServiceFabric(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .backends()
            .define("sfbackend")
            .withExistingService("rg1", "apimService1")
            .withUrl("fabric:/mytestapp/mytestservice")
            .withProtocol(BackendProtocol.HTTP)
            .withDescription("Service Fabric Test App 1")
            .withProperties(
                new BackendProperties()
                    .withServiceFabricCluster(
                        new BackendServiceFabricClusterProperties()
                            .withClientCertificateId(
                                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1")
                            .withMaxPartitionResolutionRetries(5)
                            .withManagementEndpoints(Arrays.asList("https://somecluster.com"))
                            .withServerX509Names(
                                Arrays
                                    .asList(
                                        new X509CertificateName()
                                            .withName("ServerCommonName1")
                                            .withIssuerCertificateThumbprint("IssuerCertificateThumbprint1")))))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendProxyBackend.json
     */
    /**
     * Sample code: ApiManagementCreateBackendProxyBackend.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateBackendProxyBackend(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .backends()
            .define("proxybackend")
            .withExistingService("rg1", "apimService1")
            .withUrl("https://backendname2644/")
            .withProtocol(BackendProtocol.HTTP)
            .withDescription("description5308")
            .withCredentials(
                new BackendCredentialsContract()
                    .withQuery(mapOf("sv", Arrays.asList("xx", "bb", "cc")))
                    .withHeaderProperty(mapOf("x-my-1", Arrays.asList("val1", "val2")))
                    .withAuthorization(
                        new BackendAuthorizationHeaderCredentials().withScheme("Basic").withParameter("opensesma")))
            .withProxy(
                new BackendProxyContract()
                    .withUrl("http://192.168.1.1:8080")
                    .withUsername("Contoso\\admin")
                    .withPassword("<password>"))
            .withTls(new BackendTlsProperties().withValidateCertificateChain(true).withValidateCertificateName(true))
            .create();
    }

    @SuppressWarnings("unchecked")
    private static <T> Map<String, T> mapOf(Object... inputs) {
        Map<String, T> map = new HashMap<>();
        for (int i = 0; i < inputs.length; i += 2) {
            String key = (String) inputs[i];
            T value = (T) inputs[i + 1];
            map.put(key, value);
        }
        return map;
    }
}
```

### Backend_Delete

```java
import com.azure.core.util.Context;

/** Samples for Backend Delete. */
public final class BackendDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteBackend.json
     */
    /**
     * Sample code: ApiManagementDeleteBackend.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteBackend(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.backends().deleteWithResponse("rg1", "apimService1", "sfbackend", "*", Context.NONE);
    }
}
```

### Backend_Get

```java
import com.azure.core.util.Context;

/** Samples for Backend Get. */
public final class BackendGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetBackend.json
     */
    /**
     * Sample code: ApiManagementGetBackend.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetBackend(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.backends().getWithResponse("rg1", "apimService1", "sfbackend", Context.NONE);
    }
}
```

### Backend_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Backend GetEntityTag. */
public final class BackendGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadBackend.json
     */
    /**
     * Sample code: ApiManagementHeadBackend.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadBackend(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.backends().getEntityTagWithResponse("rg1", "apimService1", "sfbackend", Context.NONE);
    }
}
```

### Backend_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Backend ListByService. */
public final class BackendListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListBackends.json
     */
    /**
     * Sample code: ApiManagementListBackends.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListBackends(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.backends().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Backend_Reconnect

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.BackendReconnectContract;
import java.time.Duration;

/** Samples for Backend Reconnect. */
public final class BackendReconnectSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackendReconnect.json
     */
    /**
     * Sample code: ApiManagementBackendReconnect.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementBackendReconnect(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .backends()
            .reconnectWithResponse(
                "rg1",
                "apimService1",
                "proxybackend",
                new BackendReconnectContract().withAfter(Duration.parse("PT3S")),
                Context.NONE);
    }
}
```

### Backend_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.BackendContract;
import com.azure.resourcemanager.apimanagement.models.BackendTlsProperties;

/** Samples for Backend Update. */
public final class BackendUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateBackend.json
     */
    /**
     * Sample code: ApiManagementUpdateBackend.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateBackend(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        BackendContract resource =
            manager.backends().getWithResponse("rg1", "apimService1", "proxybackend", Context.NONE).getValue();
        resource
            .update()
            .withDescription("description5308")
            .withTls(new BackendTlsProperties().withValidateCertificateChain(false).withValidateCertificateName(true))
            .withIfMatch("*")
            .apply();
    }
}
```

### Cache_CreateOrUpdate

```java
/** Samples for Cache CreateOrUpdate. */
public final class CacheCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCache.json
     */
    /**
     * Sample code: ApiManagementCreateCache.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateCache(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .caches()
            .define("c1")
            .withExistingService("rg1", "apimService1")
            .withDescription("Redis cache instances in West India")
            .withConnectionString("apim.redis.cache.windows.net:6380,password=xc,ssl=True,abortConnect=False")
            .withUseFromLocation("default")
            .withResourceId(
                "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1")
            .create();
    }
}
```

### Cache_Delete

```java
import com.azure.core.util.Context;

/** Samples for Cache Delete. */
public final class CacheDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCache.json
     */
    /**
     * Sample code: ApiManagementDeleteCache.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteCache(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.caches().deleteWithResponse("rg1", "apimService1", "southindia", "*", Context.NONE);
    }
}
```

### Cache_Get

```java
import com.azure.core.util.Context;

/** Samples for Cache Get. */
public final class CacheGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCache.json
     */
    /**
     * Sample code: ApiManagementGetCache.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetCache(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.caches().getWithResponse("rg1", "apimService1", "c1", Context.NONE);
    }
}
```

### Cache_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Cache GetEntityTag. */
public final class CacheGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCache.json
     */
    /**
     * Sample code: ApiManagementHeadCache.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadCache(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.caches().getEntityTagWithResponse("rg1", "apimService1", "default", Context.NONE);
    }
}
```

### Cache_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Cache ListByService. */
public final class CacheListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCaches.json
     */
    /**
     * Sample code: ApiManagementListCaches.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListCaches(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.caches().listByService("rg1", "apimService1", null, null, Context.NONE);
    }
}
```

### Cache_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.CacheContract;

/** Samples for Cache Update. */
public final class CacheUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateCache.json
     */
    /**
     * Sample code: ApiManagementUpdateCache.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateCache(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        CacheContract resource = manager.caches().getWithResponse("rg1", "apimService1", "c1", Context.NONE).getValue();
        resource.update().withUseFromLocation("westindia").withIfMatch("*").apply();
    }
}
```

### Certificate_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.KeyVaultContractCreateProperties;

/** Samples for Certificate CreateOrUpdate. */
public final class CertificateCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificate.json
     */
    /**
     * Sample code: ApiManagementCreateCertificate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateCertificate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .certificates()
            .define("tempcert")
            .withExistingService("rg1", "apimService1")
            .withData("****************Base 64 Encoded Certificate *******************************")
            .withPassword("****Certificate Password******")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificateWithKeyVault.json
     */
    /**
     * Sample code: ApiManagementCreateCertificateWithKeyVault.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateCertificateWithKeyVault(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .certificates()
            .define("templateCertkv")
            .withExistingService("rg1", "apimService1")
            .withKeyVault(
                new KeyVaultContractCreateProperties()
                    .withSecretIdentifier(
                        "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert")
                    .withIdentityClientId("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"))
            .create();
    }
}
```

### Certificate_Delete

```java
import com.azure.core.util.Context;

/** Samples for Certificate Delete. */
public final class CertificateDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCertificate.json
     */
    /**
     * Sample code: ApiManagementDeleteCertificate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteCertificate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.certificates().deleteWithResponse("rg1", "apimService1", "tempcert", "*", Context.NONE);
    }
}
```

### Certificate_Get

```java
import com.azure.core.util.Context;

/** Samples for Certificate Get. */
public final class CertificateGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificateWithKeyVault.json
     */
    /**
     * Sample code: ApiManagementGetCertificateWithKeyVault.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetCertificateWithKeyVault(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.certificates().getWithResponse("rg1", "apimService1", "templateCertkv", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificate.json
     */
    /**
     * Sample code: ApiManagementGetCertificate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetCertificate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.certificates().getWithResponse("rg1", "apimService1", "templateCert1", Context.NONE);
    }
}
```

### Certificate_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Certificate GetEntityTag. */
public final class CertificateGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCertificate.json
     */
    /**
     * Sample code: ApiManagementHeadCertificate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadCertificate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.certificates().getEntityTagWithResponse("rg1", "apimService1", "templateCert1", Context.NONE);
    }
}
```

### Certificate_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Certificate ListByService. */
public final class CertificateListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCertificates.json
     */
    /**
     * Sample code: ApiManagementListCertificates.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListCertificates(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.certificates().listByService("rg1", "apimService1", null, null, null, null, Context.NONE);
    }
}
```

### Certificate_RefreshSecret

```java
import com.azure.core.util.Context;

/** Samples for Certificate RefreshSecret. */
public final class CertificateRefreshSecretSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshCertificate.json
     */
    /**
     * Sample code: ApiManagementRefreshCertificate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementRefreshCertificate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.certificates().refreshSecretWithResponse("rg1", "apimService1", "templateCertkv", Context.NONE);
    }
}
```

### ContentItem_CreateOrUpdate

```java
import com.azure.core.util.Context;

/** Samples for ContentItem CreateOrUpdate. */
public final class ContentItemCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentTypeContentItem.json
     */
    /**
     * Sample code: ApiManagementCreateContentTypeContentItem.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateContentTypeContentItem(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .contentItems()
            .createOrUpdateWithResponse(
                "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", null, Context.NONE);
    }
}
```

### ContentItem_Delete

```java
import com.azure.core.util.Context;

/** Samples for ContentItem Delete. */
public final class ContentItemDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentTypeContentItem.json
     */
    /**
     * Sample code: ApiManagementDeleteContentTypeContentItem.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteContentTypeContentItem(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .contentItems()
            .deleteWithResponse(
                "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", "*", Context.NONE);
    }
}
```

### ContentItem_Get

```java
import com.azure.core.util.Context;

/** Samples for ContentItem Get. */
public final class ContentItemGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentTypeContentItem.json
     */
    /**
     * Sample code: ApiManagementGetContentTypeContentItem.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetContentTypeContentItem(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .contentItems()
            .getWithResponse("rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", Context.NONE);
    }
}
```

### ContentItem_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for ContentItem GetEntityTag. */
public final class ContentItemGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadContentTypeContentItem.json
     */
    /**
     * Sample code: ApiManagementHeadContentTypeContentItem.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadContentTypeContentItem(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .contentItems()
            .getEntityTagWithResponse(
                "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", Context.NONE);
    }
}
```

### ContentItem_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ContentItem ListByService. */
public final class ContentItemListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypeContentItems.json
     */
    /**
     * Sample code: ApiManagementListContentTypeContentItems.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListContentTypeContentItems(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.contentItems().listByService("rg1", "apimService1", "page", Context.NONE);
    }
}
```

### ContentType_CreateOrUpdate

```java
import com.azure.core.util.Context;

/** Samples for ContentType CreateOrUpdate. */
public final class ContentTypeCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentType.json
     */
    /**
     * Sample code: ApiManagementCreateContentType.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateContentType(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.contentTypes().createOrUpdateWithResponse("rg1", "apimService1", "page", null, Context.NONE);
    }
}
```

### ContentType_Delete

```java
import com.azure.core.util.Context;

/** Samples for ContentType Delete. */
public final class ContentTypeDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentType.json
     */
    /**
     * Sample code: ApiManagementDeleteContentType.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteContentType(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.contentTypes().deleteWithResponse("rg1", "apimService1", "page", "*", Context.NONE);
    }
}
```

### ContentType_Get

```java
import com.azure.core.util.Context;

/** Samples for ContentType Get. */
public final class ContentTypeGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentType.json
     */
    /**
     * Sample code: ApiManagementGetContentType.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetContentType(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.contentTypes().getWithResponse("rg1", "apimService1", "page", Context.NONE);
    }
}
```

### ContentType_ListByService

```java
import com.azure.core.util.Context;

/** Samples for ContentType ListByService. */
public final class ContentTypeListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypes.json
     */
    /**
     * Sample code: ApiManagementListContentTypes.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListContentTypes(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.contentTypes().listByService("rg1", "apimService1", Context.NONE);
    }
}
```

### DelegationSettings_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner;
import com.azure.resourcemanager.apimanagement.models.RegistrationDelegationSettingsProperties;
import com.azure.resourcemanager.apimanagement.models.SubscriptionsDelegationSettingsProperties;

/** Samples for DelegationSettings CreateOrUpdate. */
public final class DelegationSettingsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutDelegation.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsUpdateDelegation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsUpdateDelegation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .delegationSettings()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                new PortalDelegationSettingsInner()
                    .withUrl("http://contoso.com/delegation")
                    .withValidationKey("<validationKey>")
                    .withSubscriptions(new SubscriptionsDelegationSettingsProperties().withEnabled(true))
                    .withUserRegistration(new RegistrationDelegationSettingsProperties().withEnabled(true)),
                "*",
                Context.NONE);
    }
}
```

### DelegationSettings_Get

```java
import com.azure.core.util.Context;

/** Samples for DelegationSettings Get. */
public final class DelegationSettingsGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetDelegation.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsGetDelegation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsGetDelegation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.delegationSettings().getWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### DelegationSettings_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for DelegationSettings GetEntityTag. */
public final class DelegationSettingsGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDelegationSettings.json
     */
    /**
     * Sample code: ApiManagementHeadDelegationSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadDelegationSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.delegationSettings().getEntityTagWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### DelegationSettings_ListSecrets

```java
import com.azure.core.util.Context;

/** Samples for DelegationSettings ListSecrets. */
public final class DelegationSettingsListSecretsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsPortalSettingsValidationKey.json
     */
    /**
     * Sample code: ApiManagementListSecretsPortalSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListSecretsPortalSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.delegationSettings().listSecretsWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### DelegationSettings_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner;
import com.azure.resourcemanager.apimanagement.models.RegistrationDelegationSettingsProperties;
import com.azure.resourcemanager.apimanagement.models.SubscriptionsDelegationSettingsProperties;

/** Samples for DelegationSettings Update. */
public final class DelegationSettingsUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateDelegation.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsUpdateDelegation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsUpdateDelegation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .delegationSettings()
            .updateWithResponse(
                "rg1",
                "apimService1",
                "*",
                new PortalDelegationSettingsInner()
                    .withUrl("http://contoso.com/delegation")
                    .withValidationKey("<validationKey>")
                    .withSubscriptions(new SubscriptionsDelegationSettingsProperties().withEnabled(true))
                    .withUserRegistration(new RegistrationDelegationSettingsProperties().withEnabled(true)),
                Context.NONE);
    }
}
```

### DeletedServices_GetByName

```java
import com.azure.core.util.Context;

/** Samples for DeletedServices GetByName. */
public final class DeletedServicesGetByNameSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDeletedServiceByName.json
     */
    /**
     * Sample code: ApiManagementGetDeletedServiceByName.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetDeletedServiceByName(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.deletedServices().getByNameWithResponse("apimService3", "westus", Context.NONE);
    }
}
```

### DeletedServices_List

```java
import com.azure.core.util.Context;

/** Samples for DeletedServices List. */
public final class DeletedServicesListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesListBySubscription.json
     */
    /**
     * Sample code: ApiManagementDeletedServicesListBySubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeletedServicesListBySubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.deletedServices().list(Context.NONE);
    }
}
```

### DeletedServices_Purge

```java
import com.azure.core.util.Context;

/** Samples for DeletedServices Purge. */
public final class DeletedServicesPurgeSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesPurge.json
     */
    /**
     * Sample code: ApiManagementDeletedServicesPurge.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeletedServicesPurge(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.deletedServices().purge("apimService3", "westus", Context.NONE);
    }
}
```

### Diagnostic_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner;
import com.azure.resourcemanager.apimanagement.models.AlwaysLog;
import com.azure.resourcemanager.apimanagement.models.BodyDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.HttpMessageDiagnostic;
import com.azure.resourcemanager.apimanagement.models.PipelineDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingType;
import java.util.Arrays;

/** Samples for Diagnostic CreateOrUpdate. */
public final class DiagnosticCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateDiagnostic.json
     */
    /**
     * Sample code: ApiManagementCreateDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .diagnostics()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                "applicationinsights",
                new DiagnosticContractInner()
                    .withAlwaysLog(AlwaysLog.ALL_ERRORS)
                    .withLoggerId("/loggers/azuremonitor")
                    .withSampling(new SamplingSettings().withSamplingType(SamplingType.FIXED).withPercentage(50.0))
                    .withFrontend(
                        new PipelineDiagnosticSettings()
                            .withRequest(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512)))
                            .withResponse(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512))))
                    .withBackend(
                        new PipelineDiagnosticSettings()
                            .withRequest(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512)))
                            .withResponse(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512)))),
                null,
                Context.NONE);
    }
}
```

### Diagnostic_Delete

```java
import com.azure.core.util.Context;

/** Samples for Diagnostic Delete. */
public final class DiagnosticDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteDiagnostic.json
     */
    /**
     * Sample code: ApiManagementDeleteDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.diagnostics().deleteWithResponse("rg1", "apimService1", "applicationinsights", "*", Context.NONE);
    }
}
```

### Diagnostic_Get

```java
import com.azure.core.util.Context;

/** Samples for Diagnostic Get. */
public final class DiagnosticGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDiagnostic.json
     */
    /**
     * Sample code: ApiManagementGetDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.diagnostics().getWithResponse("rg1", "apimService1", "applicationinsights", Context.NONE);
    }
}
```

### Diagnostic_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Diagnostic GetEntityTag. */
public final class DiagnosticGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDiagnostic.json
     */
    /**
     * Sample code: ApiManagementHeadDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.diagnostics().getEntityTagWithResponse("rg1", "apimService1", "applicationinsights", Context.NONE);
    }
}
```

### Diagnostic_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Diagnostic ListByService. */
public final class DiagnosticListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListDiagnostics.json
     */
    /**
     * Sample code: ApiManagementListDiagnostics.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListDiagnostics(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.diagnostics().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Diagnostic_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner;
import com.azure.resourcemanager.apimanagement.models.AlwaysLog;
import com.azure.resourcemanager.apimanagement.models.BodyDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.HttpMessageDiagnostic;
import com.azure.resourcemanager.apimanagement.models.PipelineDiagnosticSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingSettings;
import com.azure.resourcemanager.apimanagement.models.SamplingType;
import java.util.Arrays;

/** Samples for Diagnostic Update. */
public final class DiagnosticUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateDiagnostic.json
     */
    /**
     * Sample code: ApiManagementUpdateDiagnostic.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateDiagnostic(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .diagnostics()
            .updateWithResponse(
                "rg1",
                "apimService1",
                "applicationinsights",
                "*",
                new DiagnosticContractInner()
                    .withAlwaysLog(AlwaysLog.ALL_ERRORS)
                    .withLoggerId("/loggers/applicationinsights")
                    .withSampling(new SamplingSettings().withSamplingType(SamplingType.FIXED).withPercentage(50.0))
                    .withFrontend(
                        new PipelineDiagnosticSettings()
                            .withRequest(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512)))
                            .withResponse(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512))))
                    .withBackend(
                        new PipelineDiagnosticSettings()
                            .withRequest(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512)))
                            .withResponse(
                                new HttpMessageDiagnostic()
                                    .withHeaders(Arrays.asList("Content-type"))
                                    .withBody(new BodyDiagnosticSettings().withBytes(512)))),
                Context.NONE);
    }
}
```

### EmailTemplate_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.TemplateName;

/** Samples for EmailTemplate CreateOrUpdate. */
public final class EmailTemplateCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTemplate.json
     */
    /**
     * Sample code: ApiManagementCreateTemplate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateTemplate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .emailTemplates()
            .define(TemplateName.NEW_ISSUE_NOTIFICATION_MESSAGE)
            .withExistingService("rg1", "apimService1")
            .withSubject("Your request for $IssueName was successfully received.")
            .create();
    }
}
```

### EmailTemplate_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.TemplateName;

/** Samples for EmailTemplate Delete. */
public final class EmailTemplateDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTemplate.json
     */
    /**
     * Sample code: ApiManagementDeleteTemplate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteTemplate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .emailTemplates()
            .deleteWithResponse("rg1", "apimService1", TemplateName.NEW_ISSUE_NOTIFICATION_MESSAGE, "*", Context.NONE);
    }
}
```

### EmailTemplate_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.TemplateName;

/** Samples for EmailTemplate Get. */
public final class EmailTemplateGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTemplate.json
     */
    /**
     * Sample code: ApiManagementGetTemplate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetTemplate(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .emailTemplates()
            .getWithResponse("rg1", "apimService1", TemplateName.NEW_ISSUE_NOTIFICATION_MESSAGE, Context.NONE);
    }
}
```

### EmailTemplate_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.TemplateName;

/** Samples for EmailTemplate GetEntityTag. */
public final class EmailTemplateGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadEmailTemplate.json
     */
    /**
     * Sample code: ApiManagementHeadEmailTemplate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadEmailTemplate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .emailTemplates()
            .getEntityTagWithResponse("rg1", "apimService1", TemplateName.NEW_ISSUE_NOTIFICATION_MESSAGE, Context.NONE);
    }
}
```

### EmailTemplate_ListByService

```java
import com.azure.core.util.Context;

/** Samples for EmailTemplate ListByService. */
public final class EmailTemplateListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTemplates.json
     */
    /**
     * Sample code: ApiManagementListTemplates.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListTemplates(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.emailTemplates().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### EmailTemplate_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.EmailTemplateContract;
import com.azure.resourcemanager.apimanagement.models.TemplateName;

/** Samples for EmailTemplate Update. */
public final class EmailTemplateUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTemplate.json
     */
    /**
     * Sample code: ApiManagementUpdateTemplate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateTemplate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        EmailTemplateContract resource =
            manager
                .emailTemplates()
                .getWithResponse("rg1", "apimService1", TemplateName.NEW_ISSUE_NOTIFICATION_MESSAGE, Context.NONE)
                .getValue();
        resource
            .update()
            .withSubject("Your request $IssueName was received")
            .withBody(
                "<!DOCTYPE html >\r\n"
                    + "<html>\r\n"
                    + "  <head />\r\n"
                    + "  <body>\r\n"
                    + "    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n"
                    + "    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n"
                    + "          We are happy to let you know that your request to publish the $AppName application in"
                    + " the gallery has been approved. Your application has been published and can be viewed <a"
                    + " href=\"http://$DevPortalUrl/Applications/Details/$AppId\">here</a>.\r\n"
                    + "        </p>\r\n"
                    + "    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n"
                    + "    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n"
                    + "  </body>\r\n"
                    + "</html>")
            .withIfMatch("*")
            .apply();
    }
}
```

### Gateway_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.ResourceLocationDataContract;

/** Samples for Gateway CreateOrUpdate. */
public final class GatewayCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGateway.json
     */
    /**
     * Sample code: ApiManagementCreateGateway.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGateway(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gateways()
            .define("gw1")
            .withExistingService("rg1", "apimService1")
            .withLocationData(new ResourceLocationDataContract().withName("my location"))
            .withDescription("my gateway 1")
            .create();
    }
}
```

### Gateway_Delete

```java
import com.azure.core.util.Context;

/** Samples for Gateway Delete. */
public final class GatewayDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGateway.json
     */
    /**
     * Sample code: ApiManagementDeleteGateway.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteGateway(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gateways().deleteWithResponse("rg1", "apimService1", "gw1", "*", Context.NONE);
    }
}
```

### Gateway_GenerateToken

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.GatewayTokenRequestContract;
import com.azure.resourcemanager.apimanagement.models.KeyType;
import java.time.OffsetDateTime;

/** Samples for Gateway GenerateToken. */
public final class GatewayGenerateTokenSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayGenerateToken.json
     */
    /**
     * Sample code: ApiManagementGatewayGenerateToken.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGatewayGenerateToken(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gateways()
            .generateTokenWithResponse(
                "rg1",
                "apimService1",
                "gw1",
                new GatewayTokenRequestContract()
                    .withKeyType(KeyType.PRIMARY)
                    .withExpiry(OffsetDateTime.parse("2020-04-21T00:44:24.2845269Z")),
                Context.NONE);
    }
}
```

### Gateway_Get

```java
import com.azure.core.util.Context;

/** Samples for Gateway Get. */
public final class GatewayGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGateway.json
     */
    /**
     * Sample code: ApiManagementGetGateway.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetGateway(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gateways().getWithResponse("rg1", "apimService1", "gw1", Context.NONE);
    }
}
```

### Gateway_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Gateway GetEntityTag. */
public final class GatewayGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGateway.json
     */
    /**
     * Sample code: ApiManagementHeadGateway.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadGateway(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gateways().getEntityTagWithResponse("rg1", "apimService1", "mygateway", Context.NONE);
    }
}
```

### Gateway_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Gateway ListByService. */
public final class GatewayListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGateways.json
     */
    /**
     * Sample code: ApiManagementListGateways.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListGateways(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gateways().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Gateway_ListKeys

```java
import com.azure.core.util.Context;

/** Samples for Gateway ListKeys. */
public final class GatewayListKeysSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayListKeys.json
     */
    /**
     * Sample code: ApiManagementGatewayListKeys.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGatewayListKeys(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gateways().listKeysWithResponse("rg1", "apimService1", "gw1", Context.NONE);
    }
}
```

### Gateway_RegenerateKey

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.GatewayKeyRegenerationRequestContract;
import com.azure.resourcemanager.apimanagement.models.KeyType;

/** Samples for Gateway RegenerateKey. */
public final class GatewayRegenerateKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayRegenerateKey.json
     */
    /**
     * Sample code: ApiManagementGatewayRegenerateKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGatewayRegenerateKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gateways()
            .regenerateKeyWithResponse(
                "rg1",
                "apimService1",
                "gwId",
                new GatewayKeyRegenerationRequestContract().withKeyType(KeyType.PRIMARY),
                Context.NONE);
    }
}
```

### Gateway_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.GatewayContract;
import com.azure.resourcemanager.apimanagement.models.ResourceLocationDataContract;

/** Samples for Gateway Update. */
public final class GatewayUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGateway.json
     */
    /**
     * Sample code: ApiManagementUpdateGateway.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateGateway(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        GatewayContract resource =
            manager.gateways().getWithResponse("rg1", "apimService1", "gw1", Context.NONE).getValue();
        resource
            .update()
            .withLocationData(new ResourceLocationDataContract().withName("my location"))
            .withDescription("my gateway 1")
            .withIfMatch("*")
            .apply();
    }
}
```

### GatewayApi_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AssociationContract;
import com.azure.resourcemanager.apimanagement.models.ProvisioningState;

/** Samples for GatewayApi CreateOrUpdate. */
public final class GatewayApiCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayApi.json
     */
    /**
     * Sample code: ApiManagementCreateGatewayApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGatewayApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayApis()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                "gw1",
                "echo-api",
                new AssociationContract().withProvisioningState(ProvisioningState.CREATED),
                Context.NONE);
    }
}
```

### GatewayApi_Delete

```java
import com.azure.core.util.Context;

/** Samples for GatewayApi Delete. */
public final class GatewayApiDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayApi.json
     */
    /**
     * Sample code: ApiManagementDeleteGatewayApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteGatewayApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gatewayApis().deleteWithResponse("rg1", "apimService1", "gw1", "echo-api", Context.NONE);
    }
}
```

### GatewayApi_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for GatewayApi GetEntityTag. */
public final class GatewayApiGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayApi.json
     */
    /**
     * Sample code: ApiManagementHeadGatewayApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadGatewayApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gatewayApis().getEntityTagWithResponse("rg1", "apimService1", "gw1", "api1", Context.NONE);
    }
}
```

### GatewayApi_ListByService

```java
import com.azure.core.util.Context;

/** Samples for GatewayApi ListByService. */
public final class GatewayApiListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayApis.json
     */
    /**
     * Sample code: ApiManagementListGatewayApis.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListGatewayApis(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gatewayApis().listByService("rg1", "apimService1", "gw1", null, null, null, Context.NONE);
    }
}
```

### GatewayCertificateAuthority_CreateOrUpdate

```java
/** Samples for GatewayCertificateAuthority CreateOrUpdate. */
public final class GatewayCertificateAuthorityCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayCertificateAuthority.json
     */
    /**
     * Sample code: ApiManagementCreateGatewayCertificateAuthority.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGatewayCertificateAuthority(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayCertificateAuthorities()
            .define("cert1")
            .withExistingGateway("rg1", "apimService1", "gw1")
            .withIsTrusted(false)
            .create();
    }
}
```

### GatewayCertificateAuthority_Delete

```java
import com.azure.core.util.Context;

/** Samples for GatewayCertificateAuthority Delete. */
public final class GatewayCertificateAuthorityDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayCertificateAuthority.json
     */
    /**
     * Sample code: ApiManagementDeleteGatewayCertificateAuthority.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteGatewayCertificateAuthority(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayCertificateAuthorities()
            .deleteWithResponse("rg1", "apimService1", "gw1", "default", "*", Context.NONE);
    }
}
```

### GatewayCertificateAuthority_Get

```java
import com.azure.core.util.Context;

/** Samples for GatewayCertificateAuthority Get. */
public final class GatewayCertificateAuthorityGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayCertificateAuthority.json
     */
    /**
     * Sample code: ApiManagementGetGatewayCertificateAuthority.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetGatewayCertificateAuthority(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gatewayCertificateAuthorities().getWithResponse("rg1", "apimService1", "gw1", "cert1", Context.NONE);
    }
}
```

### GatewayCertificateAuthority_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for GatewayCertificateAuthority GetEntityTag. */
public final class GatewayCertificateAuthorityGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayCertificateAuthority.json
     */
    /**
     * Sample code: ApiManagementHeadGatewayCertificateAuthority.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadGatewayCertificateAuthority(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayCertificateAuthorities()
            .getEntityTagWithResponse("rg1", "apimService1", "gw1", "cert1", Context.NONE);
    }
}
```

### GatewayCertificateAuthority_ListByService

```java
import com.azure.core.util.Context;

/** Samples for GatewayCertificateAuthority ListByService. */
public final class GatewayCertificateAuthorityListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayCertificateAuthorities.json
     */
    /**
     * Sample code: ApiManagementListGatewaycertificateAuthorities.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListGatewaycertificateAuthorities(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayCertificateAuthorities()
            .listByService("rg1", "apimService1", "gw1", null, null, null, Context.NONE);
    }
}
```

### GatewayHostnameConfiguration_CreateOrUpdate

```java
/** Samples for GatewayHostnameConfiguration CreateOrUpdate. */
public final class GatewayHostnameConfigurationCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayHostnameConfiguration.json
     */
    /**
     * Sample code: ApiManagementCreateGatewayHostnameConfiguration.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGatewayHostnameConfiguration(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayHostnameConfigurations()
            .define("default")
            .withExistingGateway("rg1", "apimService1", "gw1")
            .withHostname("*")
            .withCertificateId(
                "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1")
            .withNegotiateClientCertificate(false)
            .withTls10Enabled(false)
            .withTls11Enabled(false)
            .withHttp2Enabled(true)
            .create();
    }
}
```

### GatewayHostnameConfiguration_Delete

```java
import com.azure.core.util.Context;

/** Samples for GatewayHostnameConfiguration Delete. */
public final class GatewayHostnameConfigurationDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayHostnameConfiguration.json
     */
    /**
     * Sample code: ApiManagementDeleteGatewayHostnameConfiguration.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteGatewayHostnameConfiguration(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayHostnameConfigurations()
            .deleteWithResponse("rg1", "apimService1", "gw1", "default", "*", Context.NONE);
    }
}
```

### GatewayHostnameConfiguration_Get

```java
import com.azure.core.util.Context;

/** Samples for GatewayHostnameConfiguration Get. */
public final class GatewayHostnameConfigurationGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayHostnameConfiguration.json
     */
    /**
     * Sample code: ApiManagementGetGatewayHostnameConfiguration.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetGatewayHostnameConfiguration(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.gatewayHostnameConfigurations().getWithResponse("rg1", "apimService1", "gw1", "default", Context.NONE);
    }
}
```

### GatewayHostnameConfiguration_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for GatewayHostnameConfiguration GetEntityTag. */
public final class GatewayHostnameConfigurationGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayHostnameConfiguration.json
     */
    /**
     * Sample code: ApiManagementHeadGatewayHostnameConfiguration.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadGatewayHostnameConfiguration(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayHostnameConfigurations()
            .getEntityTagWithResponse("rg1", "apimService1", "gw1", "default", Context.NONE);
    }
}
```

### GatewayHostnameConfiguration_ListByService

```java
import com.azure.core.util.Context;

/** Samples for GatewayHostnameConfiguration ListByService. */
public final class GatewayHostnameConfigurationListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayHostnameConfigurations.json
     */
    /**
     * Sample code: ApiManagementListGatewayHostnameConfigurations.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListGatewayHostnameConfigurations(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .gatewayHostnameConfigurations()
            .listByService("rg1", "apimService1", "gw1", null, null, null, Context.NONE);
    }
}
```

### GlobalSchema_CreateOrUpdate

```java
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.apimanagement.models.SchemaType;
import java.io.IOException;

/** Samples for GlobalSchema CreateOrUpdate. */
public final class GlobalSchemaCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json
     */
    /**
     * Sample code: ApiManagementCreateSchema1.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateSchema1(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .globalSchemas()
            .define("schema1")
            .withExistingService("rg1", "apimService1")
            .withSchemaType(SchemaType.XML)
            .withDescription("sample schema description")
            .withValue(
                "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n"
                    + "           xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n"
                    + "           targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n"
                    + "           elementFormDefault=\"qualified\">\r\n"
                    + " <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n"
                    + " <xsd:complexType name=\"PurchaseOrderType\">\r\n"
                    + "  <xsd:sequence>\r\n"
                    + "   <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n"
                    + "   <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n"
                    + "  </xsd:sequence>\r\n"
                    + "  <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n"
                    + " </xsd:complexType>\r\n\r\n"
                    + " <xsd:complexType name=\"USAddress\">\r\n"
                    + "  <xsd:sequence>\r\n"
                    + "   <xsd:element name=\"name\"   type=\"xsd:string\"/>\r\n"
                    + "   <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n"
                    + "   <xsd:element name=\"city\"   type=\"xsd:string\"/>\r\n"
                    + "   <xsd:element name=\"state\"  type=\"xsd:string\"/>\r\n"
                    + "   <xsd:element name=\"zip\"    type=\"xsd:integer\"/>\r\n"
                    + "  </xsd:sequence>\r\n"
                    + "  <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n"
                    + " </xsd:complexType>\r\n"
                    + "</xsd:schema>")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.json
     */
    /**
     * Sample code: ApiManagementCreateSchema2.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateSchema2(com.azure.resourcemanager.apimanagement.ApiManagementManager manager)
        throws IOException {
        manager
            .globalSchemas()
            .define("schema1")
            .withExistingService("rg1", "apimService1")
            .withSchemaType(SchemaType.JSON)
            .withDescription("sample schema description")
            .withDocument(
                SerializerFactory
                    .createDefaultManagementSerializerAdapter()
                    .deserialize(
                        "{\"type\":\"object\",\"$id\":\"https://example.com/person.schema.json\",\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"properties\":{\"age\":{\"type\":\"integer\",\"description\":\"Age"
                            + " in years which must be equal to or greater than"
                            + " zero.\",\"minimum\":0},\"firstName\":{\"type\":\"string\",\"description\":\"The"
                            + " person's first name.\"},\"lastName\":{\"type\":\"string\",\"description\":\"The"
                            + " person's last name.\"}},\"title\":\"Person\"}",
                        Object.class,
                        SerializerEncoding.JSON))
            .create();
    }
}
```

### GlobalSchema_Delete

```java
import com.azure.core.util.Context;

/** Samples for GlobalSchema Delete. */
public final class GlobalSchemaDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json
     */
    /**
     * Sample code: ApiManagementDeleteSchema.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteSchema(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.globalSchemas().deleteWithResponse("rg1", "apimService1", "schema1", "*", Context.NONE);
    }
}
```

### GlobalSchema_Get

```java
import com.azure.core.util.Context;

/** Samples for GlobalSchema Get. */
public final class GlobalSchemaGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json
     */
    /**
     * Sample code: ApiManagementGetSchema2.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetSchema2(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.globalSchemas().getWithResponse("rg1", "apimService1", "schema2", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json
     */
    /**
     * Sample code: ApiManagementGetSchema1.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetSchema1(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.globalSchemas().getWithResponse("rg1", "apimService1", "schema1", Context.NONE);
    }
}
```

### GlobalSchema_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for GlobalSchema GetEntityTag. */
public final class GlobalSchemaGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json
     */
    /**
     * Sample code: ApiManagementHeadApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApi(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.globalSchemas().getEntityTagWithResponse("rg1", "apimService1", "myschema", Context.NONE);
    }
}
```

### GlobalSchema_ListByService

```java
import com.azure.core.util.Context;

/** Samples for GlobalSchema ListByService. */
public final class GlobalSchemaListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json
     */
    /**
     * Sample code: ApiManagementListSchemas.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListSchemas(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.globalSchemas().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Group_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.GroupType;

/** Samples for Group CreateOrUpdate. */
public final class GroupCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupExternal.json
     */
    /**
     * Sample code: ApiManagementCreateGroupExternal.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGroupExternal(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .groups()
            .define("aadGroup")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("NewGroup (samiraad.onmicrosoft.com)")
            .withDescription("new group to test")
            .withType(GroupType.EXTERNAL)
            .withExternalId("aad://samiraad.onmicrosoft.com/groups/83cf2753-5831-4675-bc0e-2f8dc067c58d")
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroup.json
     */
    /**
     * Sample code: ApiManagementCreateGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGroup(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .groups()
            .define("tempgroup")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("temp group")
            .create();
    }
}
```

### Group_Delete

```java
import com.azure.core.util.Context;

/** Samples for Group Delete. */
public final class GroupDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroup.json
     */
    /**
     * Sample code: ApiManagementDeleteGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteGroup(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.groups().deleteWithResponse("rg1", "apimService1", "aadGroup", "*", Context.NONE);
    }
}
```

### Group_Get

```java
import com.azure.core.util.Context;

/** Samples for Group Get. */
public final class GroupGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGroup.json
     */
    /**
     * Sample code: ApiManagementGetGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetGroup(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.groups().getWithResponse("rg1", "apimService1", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Group_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Group GetEntityTag. */
public final class GroupGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroup.json
     */
    /**
     * Sample code: ApiManagementHeadGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadGroup(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.groups().getEntityTagWithResponse("rg1", "apimService1", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Group_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Group ListByService. */
public final class GroupListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroups.json
     */
    /**
     * Sample code: ApiManagementListGroups.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListGroups(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.groups().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Group_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.GroupContract;

/** Samples for Group Update. */
public final class GroupUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGroup.json
     */
    /**
     * Sample code: ApiManagementUpdateGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateGroup(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        GroupContract resource =
            manager.groups().getWithResponse("rg1", "apimService1", "tempgroup", Context.NONE).getValue();
        resource.update().withDisplayName("temp group").withIfMatch("*").apply();
    }
}
```

### GroupUser_CheckEntityExists

```java
import com.azure.core.util.Context;

/** Samples for GroupUser CheckEntityExists. */
public final class GroupUserCheckEntityExistsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroupUser.json
     */
    /**
     * Sample code: ApiManagementHeadGroupUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadGroupUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .groupUsers()
            .checkEntityExistsWithResponse(
                "rg1", "apimService1", "59306a29e4bbd510dc24e5f9", "5931a75ae4bbd512a88c680b", Context.NONE);
    }
}
```

### GroupUser_Create

```java
import com.azure.core.util.Context;

/** Samples for GroupUser Create. */
public final class GroupUserCreateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupUser.json
     */
    /**
     * Sample code: ApiManagementCreateGroupUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateGroupUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .groupUsers()
            .createWithResponse("rg1", "apimService1", "tempgroup", "59307d350af58404d8a26300", Context.NONE);
    }
}
```

### GroupUser_Delete

```java
import com.azure.core.util.Context;

/** Samples for GroupUser Delete. */
public final class GroupUserDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroupUser.json
     */
    /**
     * Sample code: ApiManagementDeleteGroupUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteGroupUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .groupUsers()
            .deleteWithResponse("rg1", "apimService1", "templategroup", "59307d350af58404d8a26300", Context.NONE);
    }
}
```

### GroupUser_List

```java
import com.azure.core.util.Context;

/** Samples for GroupUser List. */
public final class GroupUserListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroupUsers.json
     */
    /**
     * Sample code: ApiManagementListGroupUsers.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListGroupUsers(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.groupUsers().list("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", null, null, null, Context.NONE);
    }
}
```

### IdentityProvider_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.IdentityProviderType;

/** Samples for IdentityProvider CreateOrUpdate. */
public final class IdentityProviderCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateIdentityProvider.json
     */
    /**
     * Sample code: ApiManagementCreateIdentityProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateIdentityProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .identityProviders()
            .define(IdentityProviderType.FACEBOOK)
            .withExistingService("rg1", "apimService1")
            .withClientId("facebookid")
            .withClientSecret("fakeSecretPlaceholder")
            .create();
    }
}
```

### IdentityProvider_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.IdentityProviderType;

/** Samples for IdentityProvider Delete. */
public final class IdentityProviderDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteIdentityProvider.json
     */
    /**
     * Sample code: ApiManagementDeleteIdentityProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteIdentityProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .identityProviders()
            .deleteWithResponse("rg1", "apimService1", IdentityProviderType.AAD, "*", Context.NONE);
    }
}
```

### IdentityProvider_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.IdentityProviderType;

/** Samples for IdentityProvider Get. */
public final class IdentityProviderGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIdentityProvider.json
     */
    /**
     * Sample code: ApiManagementGetIdentityProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetIdentityProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.identityProviders().getWithResponse("rg1", "apimService1", IdentityProviderType.AAD_B2C, Context.NONE);
    }
}
```

### IdentityProvider_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.IdentityProviderType;

/** Samples for IdentityProvider GetEntityTag. */
public final class IdentityProviderGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadIdentityProvider.json
     */
    /**
     * Sample code: ApiManagementHeadIdentityProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadIdentityProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .identityProviders()
            .getEntityTagWithResponse("rg1", "apimService1", IdentityProviderType.AAD_B2C, Context.NONE);
    }
}
```

### IdentityProvider_ListByService

```java
import com.azure.core.util.Context;

/** Samples for IdentityProvider ListByService. */
public final class IdentityProviderListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIdentityProviders.json
     */
    /**
     * Sample code: ApiManagementListIdentityProviders.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListIdentityProviders(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.identityProviders().listByService("rg1", "apimService1", Context.NONE);
    }
}
```

### IdentityProvider_ListSecrets

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.IdentityProviderType;

/** Samples for IdentityProvider ListSecrets. */
public final class IdentityProviderListSecretsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementIdentityProviderListSecrets.json
     */
    /**
     * Sample code: ApiManagementIdentityProviderListSecrets.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementIdentityProviderListSecrets(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .identityProviders()
            .listSecretsWithResponse("rg1", "apimService1", IdentityProviderType.AAD_B2C, Context.NONE);
    }
}
```

### IdentityProvider_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.IdentityProviderContract;
import com.azure.resourcemanager.apimanagement.models.IdentityProviderType;

/** Samples for IdentityProvider Update. */
public final class IdentityProviderUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateIdentityProvider.json
     */
    /**
     * Sample code: ApiManagementUpdateIdentityProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateIdentityProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        IdentityProviderContract resource =
            manager
                .identityProviders()
                .getWithResponse("rg1", "apimService1", IdentityProviderType.FACEBOOK, Context.NONE)
                .getValue();
        resource
            .update()
            .withClientId("updatedfacebookid")
            .withClientSecret("fakeUpdatedSecretPlaceholder")
            .withIfMatch("*")
            .apply();
    }
}
```

### Issue_Get

```java
import com.azure.core.util.Context;

/** Samples for Issue Get. */
public final class IssueGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIssue.json
     */
    /**
     * Sample code: ApiManagementGetIssue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetIssue(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.issues().getWithResponse("rg1", "apimService1", "57d2ef278aa04f0ad01d6cdc", Context.NONE);
    }
}
```

### Issue_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Issue ListByService. */
public final class IssueListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIssues.json
     */
    /**
     * Sample code: ApiManagementListIssues.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListIssues(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.issues().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Logger_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.LoggerType;
import java.util.HashMap;
import java.util.Map;

/** Samples for Logger CreateOrUpdate. */
public final class LoggerCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAILogger.json
     */
    /**
     * Sample code: ApiManagementCreateAILogger.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateAILogger(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .loggers()
            .define("loggerId")
            .withExistingService("rg1", "apimService1")
            .withLoggerType(LoggerType.APPLICATION_INSIGHTS)
            .withDescription("adding a new logger")
            .withCredentials(mapOf("instrumentationKey", "11................a1"))
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateEHLogger.json
     */
    /**
     * Sample code: ApiManagementCreateEHLogger.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateEHLogger(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .loggers()
            .define("eh1")
            .withExistingService("rg1", "apimService1")
            .withLoggerType(LoggerType.AZURE_EVENT_HUB)
            .withDescription("adding a new logger")
            .withCredentials(
                mapOf(
                    "name",
                    "hydraeventhub",
                    "connectionString",
                    "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="))
            .create();
    }

    @SuppressWarnings("unchecked")
    private static <T> Map<String, T> mapOf(Object... inputs) {
        Map<String, T> map = new HashMap<>();
        for (int i = 0; i < inputs.length; i += 2) {
            String key = (String) inputs[i];
            T value = (T) inputs[i + 1];
            map.put(key, value);
        }
        return map;
    }
}
```

### Logger_Delete

```java
import com.azure.core.util.Context;

/** Samples for Logger Delete. */
public final class LoggerDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteLogger.json
     */
    /**
     * Sample code: ApiManagementDeleteLogger.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteLogger(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.loggers().deleteWithResponse("rg1", "apimService1", "loggerId", "*", Context.NONE);
    }
}
```

### Logger_Get

```java
import com.azure.core.util.Context;

/** Samples for Logger Get. */
public final class LoggerGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetLogger.json
     */
    /**
     * Sample code: ApiManagementGetLogger.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetLogger(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.loggers().getWithResponse("rg1", "apimService1", "templateLogger", Context.NONE);
    }
}
```

### Logger_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Logger GetEntityTag. */
public final class LoggerGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadLogger.json
     */
    /**
     * Sample code: ApiManagementHeadLogger.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadLogger(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.loggers().getEntityTagWithResponse("rg1", "apimService1", "templateLogger", Context.NONE);
    }
}
```

### Logger_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Logger ListByService. */
public final class LoggerListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListLoggers.json
     */
    /**
     * Sample code: ApiManagementListLoggers.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListLoggers(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.loggers().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Logger_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.LoggerContract;
import com.azure.resourcemanager.apimanagement.models.LoggerType;

/** Samples for Logger Update. */
public final class LoggerUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateLogger.json
     */
    /**
     * Sample code: ApiManagementUpdateLogger.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateLogger(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        LoggerContract resource =
            manager.loggers().getWithResponse("rg1", "apimService1", "eh1", Context.NONE).getValue();
        resource
            .update()
            .withLoggerType(LoggerType.AZURE_EVENT_HUB)
            .withDescription("updating description")
            .withIfMatch("*")
            .apply();
    }
}
```

### NamedValue_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.KeyVaultContractCreateProperties;
import java.util.Arrays;

/** Samples for NamedValue CreateOrUpdate. */
public final class NamedValueCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValue.json
     */
    /**
     * Sample code: ApiManagementCreateNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .namedValues()
            .define("testprop2")
            .withExistingService("rg1", "apimService1")
            .withTags(Arrays.asList("foo", "bar"))
            .withDisplayName("prop3name")
            .withValue("propValue")
            .withSecret(false)
            .create();
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValueWithKeyVault.json
     */
    /**
     * Sample code: ApiManagementCreateNamedValueWithKeyVault.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateNamedValueWithKeyVault(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .namedValues()
            .define("testprop6")
            .withExistingService("rg1", "apimService1")
            .withTags(Arrays.asList("foo", "bar"))
            .withDisplayName("prop6namekv")
            .withKeyVault(
                new KeyVaultContractCreateProperties()
                    .withSecretIdentifier("https://contoso.vault.azure.net/secrets/aadSecret")
                    .withIdentityClientId("ceaa6b06-c00f-43ef-99ac-f53d1fe876a0"))
            .withSecret(true)
            .create();
    }
}
```

### NamedValue_Delete

```java
import com.azure.core.util.Context;

/** Samples for NamedValue Delete. */
public final class NamedValueDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNamedValue.json
     */
    /**
     * Sample code: ApiManagementDeleteNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.namedValues().deleteWithResponse("rg1", "apimService1", "testprop2", "*", Context.NONE);
    }
}
```

### NamedValue_Get

```java
import com.azure.core.util.Context;

/** Samples for NamedValue Get. */
public final class NamedValueGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValueWithKeyVault.json
     */
    /**
     * Sample code: ApiManagementGetNamedValueWithKeyVault.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetNamedValueWithKeyVault(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.namedValues().getWithResponse("rg1", "apimService1", "testprop6", Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValue.json
     */
    /**
     * Sample code: ApiManagementGetNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.namedValues().getWithResponse("rg1", "apimService1", "testarmTemplateproperties2", Context.NONE);
    }
}
```

### NamedValue_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for NamedValue GetEntityTag. */
public final class NamedValueGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNamedValue.json
     */
    /**
     * Sample code: ApiManagementHeadNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .namedValues()
            .getEntityTagWithResponse("rg1", "apimService1", "testarmTemplateproperties2", Context.NONE);
    }
}
```

### NamedValue_ListByService

```java
import com.azure.core.util.Context;

/** Samples for NamedValue ListByService. */
public final class NamedValueListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNamedValues.json
     */
    /**
     * Sample code: ApiManagementListNamedValues.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListNamedValues(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.namedValues().listByService("rg1", "apimService1", null, null, null, null, Context.NONE);
    }
}
```

### NamedValue_ListValue

```java
import com.azure.core.util.Context;

/** Samples for NamedValue ListValue. */
public final class NamedValueListValueSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementNamedValueListValue.json
     */
    /**
     * Sample code: ApiManagementNamedValueListValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementNamedValueListValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.namedValues().listValueWithResponse("rg1", "apimService1", "testarmTemplateproperties2", Context.NONE);
    }
}
```

### NamedValue_RefreshSecret

```java
import com.azure.core.util.Context;

/** Samples for NamedValue RefreshSecret. */
public final class NamedValueRefreshSecretSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshNamedValue.json
     */
    /**
     * Sample code: ApiManagementRefreshNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementRefreshNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.namedValues().refreshSecret("rg1", "apimService1", "testprop2", Context.NONE);
    }
}
```

### NamedValue_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NamedValueContract;
import java.util.Arrays;

/** Samples for NamedValue Update. */
public final class NamedValueUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateNamedValue.json
     */
    /**
     * Sample code: ApiManagementUpdateNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        NamedValueContract resource =
            manager.namedValues().getWithResponse("rg1", "apimService1", "testprop2", Context.NONE).getValue();
        resource
            .update()
            .withTags(Arrays.asList("foo", "bar2"))
            .withDisplayName("prop3name")
            .withValue("propValue")
            .withSecret(false)
            .withIfMatch("*")
            .apply();
    }
}
```

### NetworkStatus_ListByLocation

```java
import com.azure.core.util.Context;

/** Samples for NetworkStatus ListByLocation. */
public final class NetworkStatusListByLocationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatusByLocation.json
     */
    /**
     * Sample code: ApiManagementServiceGetNetworkStatusByLocation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetNetworkStatusByLocation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.networkStatus().listByLocationWithResponse("rg1", "apimService1", "North Central US", Context.NONE);
    }
}
```

### NetworkStatus_ListByService

```java
import com.azure.core.util.Context;

/** Samples for NetworkStatus ListByService. */
public final class NetworkStatusListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatus.json
     */
    /**
     * Sample code: ApiManagementServiceGetNetworkStatus.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetNetworkStatus(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.networkStatus().listByServiceWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### Notification_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for Notification CreateOrUpdate. */
public final class NotificationCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotification.json
     */
    /**
     * Sample code: ApiManagementCreateNotification.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateNotification(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notifications()
            .createOrUpdateWithResponse(
                "rg1", "apimService1", NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE, null, Context.NONE);
    }
}
```

### Notification_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for Notification Get. */
public final class NotificationGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNotification.json
     */
    /**
     * Sample code: ApiManagementGetNotification.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetNotification(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notifications()
            .getWithResponse(
                "rg1", "apimService1", NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE, Context.NONE);
    }
}
```

### Notification_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Notification ListByService. */
public final class NotificationListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotifications.json
     */
    /**
     * Sample code: ApiManagementListNotifications.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListNotifications(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.notifications().listByService("rg1", "apimService1", null, null, Context.NONE);
    }
}
```

### NotificationRecipientEmail_CheckEntityExists

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientEmail CheckEntityExists. */
public final class NotificationRecipientEmailCheckEntityExistsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientEmail.json
     */
    /**
     * Sample code: ApiManagementHeadNotificationRecipientEmail.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadNotificationRecipientEmail(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientEmails()
            .checkEntityExistsWithResponse(
                "rg1",
                "apimService1",
                NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE,
                "contoso@live.com",
                Context.NONE);
    }
}
```

### NotificationRecipientEmail_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientEmail CreateOrUpdate. */
public final class NotificationRecipientEmailCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientEmail.json
     */
    /**
     * Sample code: ApiManagementCreateNotificationRecipientEmail.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateNotificationRecipientEmail(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientEmails()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE,
                "foobar@live.com",
                Context.NONE);
    }
}
```

### NotificationRecipientEmail_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientEmail Delete. */
public final class NotificationRecipientEmailDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientEmail.json
     */
    /**
     * Sample code: ApiManagementDeleteNotificationRecipientEmail.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteNotificationRecipientEmail(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientEmails()
            .deleteWithResponse(
                "rg1",
                "apimService1",
                NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE,
                "contoso@live.com",
                Context.NONE);
    }
}
```

### NotificationRecipientEmail_ListByNotification

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientEmail ListByNotification. */
public final class NotificationRecipientEmailListByNotificationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientEmails.json
     */
    /**
     * Sample code: ApiManagementListNotificationRecipientEmails.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListNotificationRecipientEmails(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientEmails()
            .listByNotificationWithResponse(
                "rg1", "apimService1", NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE, Context.NONE);
    }
}
```

### NotificationRecipientUser_CheckEntityExists

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientUser CheckEntityExists. */
public final class NotificationRecipientUserCheckEntityExistsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientUser.json
     */
    /**
     * Sample code: ApiManagementHeadNotificationRecipientUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadNotificationRecipientUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientUsers()
            .checkEntityExistsWithResponse(
                "rg1",
                "apimService1",
                NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE,
                "576823d0a40f7e74ec07d642",
                Context.NONE);
    }
}
```

### NotificationRecipientUser_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientUser CreateOrUpdate. */
public final class NotificationRecipientUserCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientUser.json
     */
    /**
     * Sample code: ApiManagementCreateNotificationRecipientUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateNotificationRecipientUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientUsers()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE,
                "576823d0a40f7e74ec07d642",
                Context.NONE);
    }
}
```

### NotificationRecipientUser_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientUser Delete. */
public final class NotificationRecipientUserDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientUser.json
     */
    /**
     * Sample code: ApiManagementDeleteNotificationRecipientUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteNotificationRecipientUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientUsers()
            .deleteWithResponse(
                "rg1",
                "apimService1",
                NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE,
                "576823d0a40f7e74ec07d642",
                Context.NONE);
    }
}
```

### NotificationRecipientUser_ListByNotification

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.NotificationName;

/** Samples for NotificationRecipientUser ListByNotification. */
public final class NotificationRecipientUserListByNotificationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientUsers.json
     */
    /**
     * Sample code: ApiManagementListNotificationRecipientUsers.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListNotificationRecipientUsers(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .notificationRecipientUsers()
            .listByNotificationWithResponse(
                "rg1", "apimService1", NotificationName.REQUEST_PUBLISHER_NOTIFICATION_MESSAGE, Context.NONE);
    }
}
```

### OpenIdConnectProvider_CreateOrUpdate

```java
/** Samples for OpenIdConnectProvider CreateOrUpdate. */
public final class OpenIdConnectProviderCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateOpenIdConnectProvider.json
     */
    /**
     * Sample code: ApiManagementCreateOpenIdConnectProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateOpenIdConnectProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .openIdConnectProviders()
            .define("templateOpenIdConnect3")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("templateoidprovider3")
            .withMetadataEndpoint("https://oidprovider-template3.net")
            .withClientId("oidprovidertemplate3")
            .withClientSecret("x")
            .create();
    }
}
```

### OpenIdConnectProvider_Delete

```java
import com.azure.core.util.Context;

/** Samples for OpenIdConnectProvider Delete. */
public final class OpenIdConnectProviderDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteOpenIdConnectProvider.json
     */
    /**
     * Sample code: ApiManagementDeleteOpenIdConnectProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteOpenIdConnectProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .openIdConnectProviders()
            .deleteWithResponse("rg1", "apimService1", "templateOpenIdConnect3", "*", Context.NONE);
    }
}
```

### OpenIdConnectProvider_Get

```java
import com.azure.core.util.Context;

/** Samples for OpenIdConnectProvider Get. */
public final class OpenIdConnectProviderGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetOpenIdConnectProvider.json
     */
    /**
     * Sample code: ApiManagementGetOpenIdConnectProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetOpenIdConnectProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.openIdConnectProviders().getWithResponse("rg1", "apimService1", "templateOpenIdConnect2", Context.NONE);
    }
}
```

### OpenIdConnectProvider_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for OpenIdConnectProvider GetEntityTag. */
public final class OpenIdConnectProviderGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadOpenIdConnectProvider.json
     */
    /**
     * Sample code: ApiManagementHeadOpenIdConnectProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadOpenIdConnectProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .openIdConnectProviders()
            .getEntityTagWithResponse("rg1", "apimService1", "templateOpenIdConnect2", Context.NONE);
    }
}
```

### OpenIdConnectProvider_ListByService

```java
import com.azure.core.util.Context;

/** Samples for OpenIdConnectProvider ListByService. */
public final class OpenIdConnectProviderListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOpenIdConnectProviders.json
     */
    /**
     * Sample code: ApiManagementListOpenIdConnectProviders.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListOpenIdConnectProviders(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.openIdConnectProviders().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### OpenIdConnectProvider_ListSecrets

```java
import com.azure.core.util.Context;

/** Samples for OpenIdConnectProvider ListSecrets. */
public final class OpenIdConnectProviderListSecretsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementOpenidConnectProviderListSecrets.json
     */
    /**
     * Sample code: ApiManagementOpenidConnectProviderListSecrets.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementOpenidConnectProviderListSecrets(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .openIdConnectProviders()
            .listSecretsWithResponse("rg1", "apimService1", "templateOpenIdConnect2", Context.NONE);
    }
}
```

### OpenIdConnectProvider_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderContract;

/** Samples for OpenIdConnectProvider Update. */
public final class OpenIdConnectProviderUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateOpenIdConnectProvider.json
     */
    /**
     * Sample code: ApiManagementUpdateOpenIdConnectProvider.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateOpenIdConnectProvider(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        OpenidConnectProviderContract resource =
            manager
                .openIdConnectProviders()
                .getWithResponse("rg1", "apimService1", "templateOpenIdConnect2", Context.NONE)
                .getValue();
        resource.update().withClientSecret("updatedsecret").withIfMatch("*").apply();
    }
}
```

### Operation_ListByTags

```java
import com.azure.core.util.Context;

/** Samples for Operation ListByTags. */
public final class OperationListByTagsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationsByTags.json
     */
    /**
     * Sample code: ApiManagementListApiOperationsByTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiOperationsByTags(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.operations().listByTags("rg1", "apimService1", "a1", null, null, null, null, Context.NONE);
    }
}
```

### OutboundNetworkDependenciesEndpoints_ListByService

```java
import com.azure.core.util.Context;

/** Samples for OutboundNetworkDependenciesEndpoints ListByService. */
public final class OutboundNetworkDependenciesEndpointsListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.json
     */
    /**
     * Sample code: ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementServiceGetOutboundNetworkDependenciesEndpoints(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.outboundNetworkDependenciesEndpoints().listByServiceWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### Policy_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner;
import com.azure.resourcemanager.apimanagement.models.PolicyContentFormat;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for Policy CreateOrUpdate. */
public final class PolicyCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePolicy.json
     */
    /**
     * Sample code: ApiManagementCreatePolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreatePolicy(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .policies()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                PolicyIdName.POLICY,
                new PolicyContractInner()
                    .withValue(
                        "<policies>\r\n"
                            + "  <inbound />\r\n"
                            + "  <backend>\r\n"
                            + "    <forward-request />\r\n"
                            + "  </backend>\r\n"
                            + "  <outbound />\r\n"
                            + "</policies>")
                    .withFormat(PolicyContentFormat.XML),
                null,
                Context.NONE);
    }
}
```

### Policy_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for Policy Delete. */
public final class PolicyDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePolicy.json
     */
    /**
     * Sample code: ApiManagementDeletePolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeletePolicy(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.policies().deleteWithResponse("rg1", "apimService1", PolicyIdName.POLICY, "*", Context.NONE);
    }
}
```

### Policy_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for Policy Get. */
public final class PolicyGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicyFormat.json
     */
    /**
     * Sample code: ApiManagementGetPolicyFormat.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetPolicyFormat(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .policies()
            .getWithResponse("rg1", "apimService1", PolicyIdName.POLICY, PolicyExportFormat.RAWXML, Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicy.json
     */
    /**
     * Sample code: ApiManagementGetPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetPolicy(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.policies().getWithResponse("rg1", "apimService1", PolicyIdName.POLICY, null, Context.NONE);
    }
}
```

### Policy_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for Policy GetEntityTag. */
public final class PolicyGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPolicy.json
     */
    /**
     * Sample code: ApiManagementHeadPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadPolicy(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.policies().getEntityTagWithResponse("rg1", "apimService1", PolicyIdName.POLICY, Context.NONE);
    }
}
```

### Policy_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Policy ListByService. */
public final class PolicyListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicies.json
     */
    /**
     * Sample code: ApiManagementListPolicies.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListPolicies(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.policies().listByServiceWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### PolicyDescription_ListByService

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyScopeContract;

/** Samples for PolicyDescription ListByService. */
public final class PolicyDescriptionListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicyDescriptions.json
     */
    /**
     * Sample code: ApiManagementListPolicyDescriptions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListPolicyDescriptions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .policyDescriptions()
            .listByServiceWithResponse("rg1", "apimService1", PolicyScopeContract.API, Context.NONE);
    }
}
```

### PortalRevision_CreateOrUpdate

```java
/** Samples for PortalRevision CreateOrUpdate. */
public final class PortalRevisionCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePortalRevision.json
     */
    /**
     * Sample code: ApiManagementCreatePortalRevision.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreatePortalRevision(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .portalRevisions()
            .define("20201112101010")
            .withExistingService("rg1", "apimService1")
            .withDescription("portal revision 1")
            .withIsCurrent(true)
            .create();
    }
}
```

### PortalRevision_Get

```java
import com.azure.core.util.Context;

/** Samples for PortalRevision Get. */
public final class PortalRevisionGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPortalRevision.json
     */
    /**
     * Sample code: ApiManagementGetPortalRevision.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetPortalRevision(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.portalRevisions().getWithResponse("rg1", "apimService1", "20201112101010", Context.NONE);
    }
}
```

### PortalRevision_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for PortalRevision GetEntityTag. */
public final class PortalRevisionGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPortalRevision.json
     */
    /**
     * Sample code: ApiManagementHeadPortalRevision.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadPortalRevision(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.portalRevisions().getEntityTagWithResponse("rg1", "apimService1", "20201112101010", Context.NONE);
    }
}
```

### PortalRevision_ListByService

```java
import com.azure.core.util.Context;

/** Samples for PortalRevision ListByService. */
public final class PortalRevisionListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalRevisions.json
     */
    /**
     * Sample code: ApiManagementListPortalRevisions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListPortalRevisions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.portalRevisions().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### PortalRevision_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PortalRevisionContract;

/** Samples for PortalRevision Update. */
public final class PortalRevisionUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdatePortalRevision.json
     */
    /**
     * Sample code: ApiManagementUpdatePortalRevision.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdatePortalRevision(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        PortalRevisionContract resource =
            manager.portalRevisions().getWithResponse("rg1", "apimService1", "20201112101010", Context.NONE).getValue();
        resource.update().withDescription("portal revision update").withIsCurrent(true).withIfMatch("*").apply();
    }
}
```

### PortalSettings_ListByService

```java
import com.azure.core.util.Context;

/** Samples for PortalSettings ListByService. */
public final class PortalSettingsListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalSettings.json
     */
    /**
     * Sample code: ApiManagementListPortalSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListPortalSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.portalSettings().listByServiceWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### PrivateEndpointConnection_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.PrivateEndpointConnectionRequestProperties;
import com.azure.resourcemanager.apimanagement.models.PrivateEndpointServiceConnectionStatus;
import com.azure.resourcemanager.apimanagement.models.PrivateLinkServiceConnectionState;

/** Samples for PrivateEndpointConnection CreateOrUpdate. */
public final class PrivateEndpointConnectionCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApproveOrRejectPrivateEndpointConnection.json
     */
    /**
     * Sample code: ApiManagementApproveOrRejectPrivateEndpointConnection.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementApproveOrRejectPrivateEndpointConnection(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .privateEndpointConnections()
            .define("privateEndpointConnectionName")
            .withExistingService("rg1", "apimService1")
            .withProperties(
                new PrivateEndpointConnectionRequestProperties()
                    .withPrivateLinkServiceConnectionState(
                        new PrivateLinkServiceConnectionState()
                            .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED)
                            .withDescription("The Private Endpoint Connection is approved.")))
            .create();
    }
}
```

### PrivateEndpointConnection_Delete

```java
import com.azure.core.util.Context;

/** Samples for PrivateEndpointConnection Delete. */
public final class PrivateEndpointConnectionDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePrivateEndpointConnection.json
     */
    /**
     * Sample code: ApiManagementDeletePrivateEndpointConnection.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeletePrivateEndpointConnection(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .privateEndpointConnections()
            .delete("rg1", "apimService1", "privateEndpointConnectionName", Context.NONE);
    }
}
```

### PrivateEndpointConnection_GetByName

```java
import com.azure.core.util.Context;

/** Samples for PrivateEndpointConnection GetByName. */
public final class PrivateEndpointConnectionGetByNameSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateEndpointConnection.json
     */
    /**
     * Sample code: ApiManagementGetPrivateEndpointConnection.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetPrivateEndpointConnection(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .privateEndpointConnections()
            .getByNameWithResponse("rg1", "apimService1", "privateEndpointConnectionName", Context.NONE);
    }
}
```

### PrivateEndpointConnection_GetPrivateLinkResource

```java
import com.azure.core.util.Context;

/** Samples for PrivateEndpointConnection GetPrivateLinkResource. */
public final class PrivateEndpointConnectionGetPrivateLinkResourceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateLinkGroupResource.json
     */
    /**
     * Sample code: ApiManagementGetPrivateLinkGroupResource.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetPrivateLinkGroupResource(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .privateEndpointConnections()
            .getPrivateLinkResourceWithResponse("rg1", "apimService1", "privateLinkSubResourceName", Context.NONE);
    }
}
```

### PrivateEndpointConnection_ListByService

```java
import com.azure.core.util.Context;

/** Samples for PrivateEndpointConnection ListByService. */
public final class PrivateEndpointConnectionListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateEndpointConnections.json
     */
    /**
     * Sample code: ApiManagementListPrivateEndpointConnections.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListPrivateEndpointConnections(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.privateEndpointConnections().listByService("rg1", "apimService1", Context.NONE);
    }
}
```

### PrivateEndpointConnection_ListPrivateLinkResources

```java
import com.azure.core.util.Context;

/** Samples for PrivateEndpointConnection ListPrivateLinkResources. */
public final class PrivateEndpointConnectionListPrivateLinkResourcesSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateLinkGroupResources.json
     */
    /**
     * Sample code: ApiManagementListPrivateLinkGroupResources.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListPrivateLinkGroupResources(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.privateEndpointConnections().listPrivateLinkResourcesWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### Product_CreateOrUpdate

```java
/** Samples for Product CreateOrUpdate. */
public final class ProductCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProduct.json
     */
    /**
     * Sample code: ApiManagementCreateProduct.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateProduct(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .products()
            .define("testproduct")
            .withExistingService("rg1", "apimService1")
            .withDisplayName("Test Template ProductName 4")
            .create();
    }
}
```

### Product_Delete

```java
import com.azure.core.util.Context;

/** Samples for Product Delete. */
public final class ProductDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProduct.json
     */
    /**
     * Sample code: ApiManagementDeleteProduct.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteProduct(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.products().deleteWithResponse("rg1", "apimService1", "testproduct", "*", true, Context.NONE);
    }
}
```

### Product_Get

```java
import com.azure.core.util.Context;

/** Samples for Product Get. */
public final class ProductGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProduct.json
     */
    /**
     * Sample code: ApiManagementGetProduct.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetProduct(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.products().getWithResponse("rg1", "apimService1", "unlimited", Context.NONE);
    }
}
```

### Product_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Product GetEntityTag. */
public final class ProductGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProduct.json
     */
    /**
     * Sample code: ApiManagementHeadProduct.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadProduct(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.products().getEntityTagWithResponse("rg1", "apimService1", "unlimited", Context.NONE);
    }
}
```

### Product_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Product ListByService. */
public final class ProductListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProducts.json
     */
    /**
     * Sample code: ApiManagementListProducts.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProducts(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.products().listByService("rg1", "apimService1", null, null, null, null, null, Context.NONE);
    }
}
```

### Product_ListByTags

```java
import com.azure.core.util.Context;

/** Samples for Product ListByTags. */
public final class ProductListByTagsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductsByTags.json
     */
    /**
     * Sample code: ApiManagementListProductsByTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProductsByTags(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.products().listByTags("rg1", "apimService1", null, null, null, null, Context.NONE);
    }
}
```

### Product_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ProductContract;

/** Samples for Product Update. */
public final class ProductUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateProduct.json
     */
    /**
     * Sample code: ApiManagementUpdateProduct.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateProduct(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ProductContract resource =
            manager.products().getWithResponse("rg1", "apimService1", "testproduct", Context.NONE).getValue();
        resource.update().withDisplayName("Test Template ProductName 4").withIfMatch("*").apply();
    }
}
```

### ProductApi_CheckEntityExists

```java
import com.azure.core.util.Context;

/** Samples for ProductApi CheckEntityExists. */
public final class ProductApiCheckEntityExistsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductApi.json
     */
    /**
     * Sample code: ApiManagementHeadProductApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadProductApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productApis()
            .checkEntityExistsWithResponse(
                "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### ProductApi_CreateOrUpdate

```java
import com.azure.core.util.Context;

/** Samples for ProductApi CreateOrUpdate. */
public final class ProductApiCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductApi.json
     */
    /**
     * Sample code: ApiManagementCreateProductApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateProductApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productApis()
            .createOrUpdateWithResponse("rg1", "apimService1", "testproduct", "echo-api", Context.NONE);
    }
}
```

### ProductApi_Delete

```java
import com.azure.core.util.Context;

/** Samples for ProductApi Delete. */
public final class ProductApiDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductApi.json
     */
    /**
     * Sample code: ApiManagementDeleteProductApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteProductApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.productApis().deleteWithResponse("rg1", "apimService1", "testproduct", "echo-api", Context.NONE);
    }
}
```

### ProductApi_ListByProduct

```java
import com.azure.core.util.Context;

/** Samples for ProductApi ListByProduct. */
public final class ProductApiListByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductApis.json
     */
    /**
     * Sample code: ApiManagementListProductApis.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProductApis(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productApis()
            .listByProduct("rg1", "apimService1", "5768181ea40f7eb6c49f6ac7", null, null, null, Context.NONE);
    }
}
```

### ProductGroup_CheckEntityExists

```java
import com.azure.core.util.Context;

/** Samples for ProductGroup CheckEntityExists. */
public final class ProductGroupCheckEntityExistsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductGroup.json
     */
    /**
     * Sample code: ApiManagementHeadProductGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadProductGroup(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productGroups()
            .checkEntityExistsWithResponse(
                "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### ProductGroup_CreateOrUpdate

```java
import com.azure.core.util.Context;

/** Samples for ProductGroup CreateOrUpdate. */
public final class ProductGroupCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductGroup.json
     */
    /**
     * Sample code: ApiManagementCreateProductGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateProductGroup(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productGroups()
            .createOrUpdateWithResponse("rg1", "apimService1", "testproduct", "templateGroup", Context.NONE);
    }
}
```

### ProductGroup_Delete

```java
import com.azure.core.util.Context;

/** Samples for ProductGroup Delete. */
public final class ProductGroupDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductGroup.json
     */
    /**
     * Sample code: ApiManagementDeleteProductGroup.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteProductGroup(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.productGroups().deleteWithResponse("rg1", "apimService1", "testproduct", "templateGroup", Context.NONE);
    }
}
```

### ProductGroup_ListByProduct

```java
import com.azure.core.util.Context;

/** Samples for ProductGroup ListByProduct. */
public final class ProductGroupListByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductGroups.json
     */
    /**
     * Sample code: ApiManagementListProductGroups.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProductGroups(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productGroups()
            .listByProduct("rg1", "apimService1", "5600b57e7e8880006a060002", null, null, null, Context.NONE);
    }
}
```

### ProductPolicy_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner;
import com.azure.resourcemanager.apimanagement.models.PolicyContentFormat;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ProductPolicy CreateOrUpdate. */
public final class ProductPolicyCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductPolicy.json
     */
    /**
     * Sample code: ApiManagementCreateProductPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateProductPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productPolicies()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                "5702e97e5157a50f48dce801",
                PolicyIdName.POLICY,
                new PolicyContractInner()
                    .withValue(
                        "<policies>\r\n"
                            + "  <inbound>\r\n"
                            + "    <rate-limit calls=\"{{call-count}}\" renewal-period=\"15\"></rate-limit>\r\n"
                            + "    <log-to-eventhub logger-id=\"16\">\r\n"
                            + "                      @( string.Join(\",\", DateTime.UtcNow,"
                            + " context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress,"
                            + " context.Operation.Name) ) \r\n"
                            + "                  </log-to-eventhub>\r\n"
                            + "    <quota-by-key calls=\"40\" counter-key=\"cc\" renewal-period=\"3600\""
                            + " increment-count=\"@(context.Request.Method == &quot;POST&quot; ? 1:2)\" />\r\n"
                            + "    <base />\r\n"
                            + "  </inbound>\r\n"
                            + "  <backend>\r\n"
                            + "    <base />\r\n"
                            + "  </backend>\r\n"
                            + "  <outbound>\r\n"
                            + "    <base />\r\n"
                            + "  </outbound>\r\n"
                            + "</policies>")
                    .withFormat(PolicyContentFormat.XML),
                null,
                Context.NONE);
    }
}
```

### ProductPolicy_Delete

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ProductPolicy Delete. */
public final class ProductPolicyDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductPolicy.json
     */
    /**
     * Sample code: ApiManagementDeleteProductPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteProductPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productPolicies()
            .deleteWithResponse("rg1", "apimService1", "testproduct", PolicyIdName.POLICY, "*", Context.NONE);
    }
}
```

### ProductPolicy_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ProductPolicy Get. */
public final class ProductPolicyGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductPolicy.json
     */
    /**
     * Sample code: ApiManagementGetProductPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetProductPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productPolicies()
            .getWithResponse(
                "rg1", "apimService1", "kjoshiarmTemplateProduct4", PolicyIdName.POLICY, null, Context.NONE);
    }
}
```

### ProductPolicy_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.PolicyIdName;

/** Samples for ProductPolicy GetEntityTag. */
public final class ProductPolicyGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductPolicy.json
     */
    /**
     * Sample code: ApiManagementHeadProductPolicy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadProductPolicy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productPolicies()
            .getEntityTagWithResponse("rg1", "apimService1", "unlimited", PolicyIdName.POLICY, Context.NONE);
    }
}
```

### ProductPolicy_ListByProduct

```java
import com.azure.core.util.Context;

/** Samples for ProductPolicy ListByProduct. */
public final class ProductPolicyListByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductPolicies.json
     */
    /**
     * Sample code: ApiManagementListProductPolicies.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProductPolicies(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.productPolicies().listByProductWithResponse("rg1", "apimService1", "armTemplateProduct4", Context.NONE);
    }
}
```

### ProductSubscriptions_List

```java
import com.azure.core.util.Context;

/** Samples for ProductSubscriptions List. */
public final class ProductSubscriptionsListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductSubscriptions.json
     */
    /**
     * Sample code: ApiManagementListProductSubscriptions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProductSubscriptions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .productSubscriptions()
            .list("rg1", "apimService1", "5600b57e7e8880006a060002", null, null, null, Context.NONE);
    }
}
```

### QuotaByCounterKeys_ListByService

```java
import com.azure.core.util.Context;

/** Samples for QuotaByCounterKeys ListByService. */
public final class QuotaByCounterKeysListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeys.json
     */
    /**
     * Sample code: ApiManagementGetQuotaCounterKeys.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetQuotaCounterKeys(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.quotaByCounterKeys().listByServiceWithResponse("rg1", "apimService1", "ba", Context.NONE);
    }
}
```

### QuotaByCounterKeys_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract;

/** Samples for QuotaByCounterKeys Update. */
public final class QuotaByCounterKeysUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKey.json
     */
    /**
     * Sample code: ApiManagementUpdateQuotaCounterKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateQuotaCounterKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .quotaByCounterKeys()
            .updateWithResponse(
                "rg1",
                "apimService1",
                "ba",
                new QuotaCounterValueUpdateContract().withCallsCount(0).withKbTransferred(2.5630078125),
                Context.NONE);
    }
}
```

### QuotaByPeriodKeys_Get

```java
import com.azure.core.util.Context;

/** Samples for QuotaByPeriodKeys Get. */
public final class QuotaByPeriodKeysGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeysByQuotaPeriod.json
     */
    /**
     * Sample code: ApiManagementGetQuotaCounterKeysByQuotaPeriod.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetQuotaCounterKeysByQuotaPeriod(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.quotaByPeriodKeys().getWithResponse("rg1", "apimService1", "ba", "0_P3Y6M4DT12H30M5S", Context.NONE);
    }
}
```

### QuotaByPeriodKeys_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract;

/** Samples for QuotaByPeriodKeys Update. */
public final class QuotaByPeriodKeysUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.json
     */
    /**
     * Sample code: ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateQuotaCounterKeyByQuotaPeriod(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .quotaByPeriodKeys()
            .updateWithResponse(
                "rg1",
                "apimService1",
                "ba",
                "0_P3Y6M4DT12H30M5S",
                new QuotaCounterValueUpdateContract().withCallsCount(0).withKbTransferred(0.0),
                Context.NONE);
    }
}
```

### Region_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Region ListByService. */
public final class RegionListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListRegions.json
     */
    /**
     * Sample code: ApiManagementListRegions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListRegions(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.regions().listByService("rg1", "apimService1", Context.NONE);
    }
}
```

### Reports_ListByApi

```java
import com.azure.core.util.Context;

/** Samples for Reports ListByApi. */
public final class ReportsListByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByApi.json
     */
    /**
     * Sample code: ApiManagementGetReportsByApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByApi(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByApi(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListByGeo

```java
import com.azure.core.util.Context;

/** Samples for Reports ListByGeo. */
public final class ReportsListByGeoSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByGeo.json
     */
    /**
     * Sample code: ApiManagementGetReportsByGeo.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByGeo(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByGeo(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListByOperation

```java
import com.azure.core.util.Context;

/** Samples for Reports ListByOperation. */
public final class ReportsListByOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByOperation.json
     */
    /**
     * Sample code: ApiManagementGetReportsByOperation.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByOperation(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByOperation(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListByProduct

```java
import com.azure.core.util.Context;

/** Samples for Reports ListByProduct. */
public final class ReportsListByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByProduct.json
     */
    /**
     * Sample code: ApiManagementGetReportsByProduct.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByProduct(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByProduct(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListByRequest

```java
import com.azure.core.util.Context;

/** Samples for Reports ListByRequest. */
public final class ReportsListByRequestSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByRequest.json
     */
    /**
     * Sample code: ApiManagementGetReportsByRequest.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByRequest(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByRequest(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListBySubscription

```java
import com.azure.core.util.Context;

/** Samples for Reports ListBySubscription. */
public final class ReportsListBySubscriptionSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsBySubscription.json
     */
    /**
     * Sample code: ApiManagementGetReportsBySubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsBySubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listBySubscription(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListByTime

```java
import com.azure.core.util.Context;
import java.time.Duration;

/** Samples for Reports ListByTime. */
public final class ReportsListByTimeSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByTime.json
     */
    /**
     * Sample code: ApiManagementGetReportsByTime.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByTime(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByTime(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                Duration.parse("PT15M"),
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Reports_ListByUser

```java
import com.azure.core.util.Context;

/** Samples for Reports ListByUser. */
public final class ReportsListByUserSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByUser.json
     */
    /**
     * Sample code: ApiManagementGetReportsByUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetReportsByUser(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .reports()
            .listByUser(
                "rg1",
                "apimService1",
                "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### ResourceProvider_PerformConnectivityCheckAsync

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ConnectivityCheckProtocol;
import com.azure.resourcemanager.apimanagement.models.ConnectivityCheckRequest;
import com.azure.resourcemanager.apimanagement.models.ConnectivityCheckRequestDestination;
import com.azure.resourcemanager.apimanagement.models.ConnectivityCheckRequestProtocolConfiguration;
import com.azure.resourcemanager.apimanagement.models.ConnectivityCheckRequestProtocolConfigurationHttpConfiguration;
import com.azure.resourcemanager.apimanagement.models.ConnectivityCheckRequestSource;
import com.azure.resourcemanager.apimanagement.models.HttpHeader;
import com.azure.resourcemanager.apimanagement.models.Method;
import com.azure.resourcemanager.apimanagement.models.PreferredIpVersion;
import java.util.Arrays;

/** Samples for ResourceProvider PerformConnectivityCheckAsync. */
public final class ResourceProviderPerformConnectivityCheckAsyncSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheck.json
     */
    /**
     * Sample code: TCP Connectivity Check.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void tCPConnectivityCheck(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .resourceProviders()
            .performConnectivityCheckAsync(
                "rg1",
                "apimService1",
                new ConnectivityCheckRequest()
                    .withSource(new ConnectivityCheckRequestSource().withRegion("northeurope"))
                    .withDestination(new ConnectivityCheckRequestDestination().withAddress("8.8.8.8").withPort(53L))
                    .withPreferredIpVersion(PreferredIpVersion.IPV4),
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheckHttpConnect.json
     */
    /**
     * Sample code: HTTP Connectivity Check.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void hTTPConnectivityCheck(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .resourceProviders()
            .performConnectivityCheckAsync(
                "rg1",
                "apimService1",
                new ConnectivityCheckRequest()
                    .withSource(new ConnectivityCheckRequestSource().withRegion("northeurope"))
                    .withDestination(
                        new ConnectivityCheckRequestDestination().withAddress("https://microsoft.com").withPort(3306L))
                    .withProtocol(ConnectivityCheckProtocol.HTTPS)
                    .withProtocolConfiguration(
                        new ConnectivityCheckRequestProtocolConfiguration()
                            .withHttpConfiguration(
                                new ConnectivityCheckRequestProtocolConfigurationHttpConfiguration()
                                    .withMethod(Method.GET)
                                    .withValidStatusCodes(Arrays.asList(200L, 204L))
                                    .withHeaders(
                                        Arrays
                                            .asList(
                                                new HttpHeader()
                                                    .withName("Authorization")
                                                    .withValue("Bearer myPreciousToken"))))),
                Context.NONE);
    }
}
```

### SignInSettings_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner;

/** Samples for SignInSettings CreateOrUpdate. */
public final class SignInSettingsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignIn.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsUpdateSignIn.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsUpdateSignIn(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .signInSettings()
            .createOrUpdateWithResponse(
                "rg1", "apimService1", new PortalSigninSettingsInner().withEnabled(true), "*", Context.NONE);
    }
}
```

### SignInSettings_Get

```java
import com.azure.core.util.Context;

/** Samples for SignInSettings Get. */
public final class SignInSettingsGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignIn.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsGetSignIn.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsGetSignIn(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.signInSettings().getWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### SignInSettings_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for SignInSettings GetEntityTag. */
public final class SignInSettingsGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignInSettings.json
     */
    /**
     * Sample code: ApiManagementHeadSignInSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadSignInSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.signInSettings().getEntityTagWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### SignInSettings_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner;

/** Samples for SignInSettings Update. */
public final class SignInSettingsUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignIn.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsUpdateSignIn.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsUpdateSignIn(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .signInSettings()
            .updateWithResponse(
                "rg1", "apimService1", "*", new PortalSigninSettingsInner().withEnabled(true), Context.NONE);
    }
}
```

### SignUpSettings_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner;
import com.azure.resourcemanager.apimanagement.models.TermsOfServiceProperties;

/** Samples for SignUpSettings CreateOrUpdate. */
public final class SignUpSettingsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignUp.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsUpdateSignUp.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsUpdateSignUp(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .signUpSettings()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                new PortalSignupSettingsInner()
                    .withEnabled(true)
                    .withTermsOfService(
                        new TermsOfServiceProperties()
                            .withText("Terms of service text.")
                            .withEnabled(true)
                            .withConsentRequired(true)),
                "*",
                Context.NONE);
    }
}
```

### SignUpSettings_Get

```java
import com.azure.core.util.Context;

/** Samples for SignUpSettings Get. */
public final class SignUpSettingsGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignUp.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsGetSignUp.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsGetSignUp(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.signUpSettings().getWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### SignUpSettings_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for SignUpSettings GetEntityTag. */
public final class SignUpSettingsGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignUpSettings.json
     */
    /**
     * Sample code: ApiManagementHeadSignUpSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadSignUpSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.signUpSettings().getEntityTagWithResponse("rg1", "apimService1", Context.NONE);
    }
}
```

### SignUpSettings_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner;
import com.azure.resourcemanager.apimanagement.models.TermsOfServiceProperties;

/** Samples for SignUpSettings Update. */
public final class SignUpSettingsUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignUp.json
     */
    /**
     * Sample code: ApiManagementPortalSettingsUpdateSignUp.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementPortalSettingsUpdateSignUp(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .signUpSettings()
            .updateWithResponse(
                "rg1",
                "apimService1",
                "*",
                new PortalSignupSettingsInner()
                    .withEnabled(true)
                    .withTermsOfService(
                        new TermsOfServiceProperties()
                            .withText("Terms of service text.")
                            .withEnabled(true)
                            .withConsentRequired(true)),
                Context.NONE);
    }
}
```

### Subscription_CreateOrUpdate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.SubscriptionCreateParameters;

/** Samples for Subscription CreateOrUpdate. */
public final class SubscriptionCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSubscription.json
     */
    /**
     * Sample code: ApiManagementCreateSubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateSubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .subscriptions()
            .createOrUpdateWithResponse(
                "rg1",
                "apimService1",
                "testsub",
                new SubscriptionCreateParameters()
                    .withOwnerId(
                        "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7")
                    .withScope(
                        "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002")
                    .withDisplayName("testsub"),
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Subscription_Delete

```java
import com.azure.core.util.Context;

/** Samples for Subscription Delete. */
public final class SubscriptionDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteSubscription.json
     */
    /**
     * Sample code: ApiManagementDeleteSubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteSubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.subscriptions().deleteWithResponse("rg1", "apimService1", "testsub", "*", Context.NONE);
    }
}
```

### Subscription_Get

```java
import com.azure.core.util.Context;

/** Samples for Subscription Get. */
public final class SubscriptionGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetSubscription.json
     */
    /**
     * Sample code: ApiManagementGetSubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetSubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.subscriptions().getWithResponse("rg1", "apimService1", "5931a769d8d14f0ad8ce13b8", Context.NONE);
    }
}
```

### Subscription_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for Subscription GetEntityTag. */
public final class SubscriptionGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSubscription.json
     */
    /**
     * Sample code: ApiManagementHeadSubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadSubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .subscriptions()
            .getEntityTagWithResponse("rg1", "apimService1", "5931a769d8d14f0ad8ce13b8", Context.NONE);
    }
}
```

### Subscription_List

```java
import com.azure.core.util.Context;

/** Samples for Subscription List. */
public final class SubscriptionListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSubscriptions.json
     */
    /**
     * Sample code: ApiManagementListSubscriptions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListSubscriptions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.subscriptions().list("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### Subscription_ListSecrets

```java
import com.azure.core.util.Context;

/** Samples for Subscription ListSecrets. */
public final class SubscriptionListSecretsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionListSecrets.json
     */
    /**
     * Sample code: ApiManagementSubscriptionListSecrets.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementSubscriptionListSecrets(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .subscriptions()
            .listSecretsWithResponse("rg1", "apimService1", "5931a769d8d14f0ad8ce13b8", Context.NONE);
    }
}
```

### Subscription_RegeneratePrimaryKey

```java
import com.azure.core.util.Context;

/** Samples for Subscription RegeneratePrimaryKey. */
public final class SubscriptionRegeneratePrimaryKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegeneratePrimaryKey.json
     */
    /**
     * Sample code: ApiManagementSubscriptionRegeneratePrimaryKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementSubscriptionRegeneratePrimaryKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.subscriptions().regeneratePrimaryKeyWithResponse("rg1", "apimService1", "testsub", Context.NONE);
    }
}
```

### Subscription_RegenerateSecondaryKey

```java
import com.azure.core.util.Context;

/** Samples for Subscription RegenerateSecondaryKey. */
public final class SubscriptionRegenerateSecondaryKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegenerateSecondaryKey.json
     */
    /**
     * Sample code: ApiManagementSubscriptionRegenerateSecondaryKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementSubscriptionRegenerateSecondaryKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.subscriptions().regenerateSecondaryKeyWithResponse("rg1", "apimService1", "testsub", Context.NONE);
    }
}
```

### Subscription_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.SubscriptionUpdateParameters;

/** Samples for Subscription Update. */
public final class SubscriptionUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateSubscription.json
     */
    /**
     * Sample code: ApiManagementUpdateSubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateSubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .subscriptions()
            .updateWithResponse(
                "rg1",
                "apimService1",
                "testsub",
                "*",
                new SubscriptionUpdateParameters().withDisplayName("testsub"),
                null,
                null,
                Context.NONE);
    }
}
```

### Tag_AssignToApi

```java
import com.azure.core.util.Context;

/** Samples for Tag AssignToApi. */
public final class TagAssignToApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTag.json
     */
    /**
     * Sample code: ApiManagementCreateApiTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .assignToApiWithResponse("rg1", "apimService1", "5931a75ae4bbd512a88c680b", "tagId1", Context.NONE);
    }
}
```

### Tag_AssignToOperation

```java
import com.azure.core.util.Context;

/** Samples for Tag AssignToOperation. */
public final class TagAssignToOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationTag.json
     */
    /**
     * Sample code: ApiManagementCreateApiOperationTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateApiOperationTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .assignToOperationWithResponse(
                "rg1", "apimService1", "5931a75ae4bbd512a88c680b", "5931a75ae4bbd512a88c680a", "tagId1", Context.NONE);
    }
}
```

### Tag_AssignToProduct

```java
import com.azure.core.util.Context;

/** Samples for Tag AssignToProduct. */
public final class TagAssignToProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductTag.json
     */
    /**
     * Sample code: ApiManagementCreateProductTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateProductTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .assignToProductWithResponse("rg1", "apimService1", "5931a75ae4bbd512a88c680b", "tagId1", Context.NONE);
    }
}
```

### Tag_CreateOrUpdate

```java
/** Samples for Tag CreateOrUpdate. */
public final class TagCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTag.json
     */
    /**
     * Sample code: ApiManagementCreateTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().define("tagId1").withExistingService("rg1", "apimService1").withDisplayName("tag1").create();
    }
}
```

### Tag_Delete

```java
import com.azure.core.util.Context;

/** Samples for Tag Delete. */
public final class TagDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTag.json
     */
    /**
     * Sample code: ApiManagementDeleteTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().deleteWithResponse("rg1", "apimService1", "tagId1", "*", Context.NONE);
    }
}
```

### Tag_DetachFromApi

```java
import com.azure.core.util.Context;

/** Samples for Tag DetachFromApi. */
public final class TagDetachFromApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTag.json
     */
    /**
     * Sample code: ApiManagementDeleteApiTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .detachFromApiWithResponse(
                "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", Context.NONE);
    }
}
```

### Tag_DetachFromOperation

```java
import com.azure.core.util.Context;

/** Samples for Tag DetachFromOperation. */
public final class TagDetachFromOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationTag.json
     */
    /**
     * Sample code: ApiManagementDeleteApiOperationTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteApiOperationTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .detachFromOperationWithResponse(
                "rg1",
                "apimService1",
                "59d5b28d1f7fab116c282650",
                "59d5b28d1f7fab116c282651",
                "59d5b28e1f7fab116402044e",
                Context.NONE);
    }
}
```

### Tag_DetachFromProduct

```java
import com.azure.core.util.Context;

/** Samples for Tag DetachFromProduct. */
public final class TagDetachFromProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductTag.json
     */
    /**
     * Sample code: ApiManagementDeleteProductTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteProductTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .detachFromProductWithResponse(
                "rg1", "apimService1", "59d5b28d1f7fab116c282650", "59d5b28e1f7fab116402044e", Context.NONE);
    }
}
```

### Tag_Get

```java
import com.azure.core.util.Context;

/** Samples for Tag Get. */
public final class TagGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTag.json
     */
    /**
     * Sample code: ApiManagementGetTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().getWithResponse("rg1", "apimService1", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Tag_GetByApi

```java
import com.azure.core.util.Context;

/** Samples for Tag GetByApi. */
public final class TagGetByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTag.json
     */
    /**
     * Sample code: ApiManagementGetApiTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .getByApiWithResponse(
                "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Tag_GetByOperation

```java
import com.azure.core.util.Context;

/** Samples for Tag GetByOperation. */
public final class TagGetByOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationTag.json
     */
    /**
     * Sample code: ApiManagementGetApiOperationTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetApiOperationTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .getByOperationWithResponse(
                "rg1",
                "apimService1",
                "59d6bb8f1f7fab13dc67ec9b",
                "59d6bb8f1f7fab13dc67ec9a",
                "59306a29e4bbd510dc24e5f9",
                Context.NONE);
    }
}
```

### Tag_GetByProduct

```java
import com.azure.core.util.Context;

/** Samples for Tag GetByProduct. */
public final class TagGetByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductTag.json
     */
    /**
     * Sample code: ApiManagementGetProductTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetProductTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .getByProductWithResponse(
                "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Tag_GetEntityState

```java
import com.azure.core.util.Context;

/** Samples for Tag GetEntityState. */
public final class TagGetEntityStateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTag.json
     */
    /**
     * Sample code: ApiManagementHeadTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().getEntityStateWithResponse("rg1", "apimService1", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Tag_GetEntityStateByApi

```java
import com.azure.core.util.Context;

/** Samples for Tag GetEntityStateByApi. */
public final class TagGetEntityStateByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTag.json
     */
    /**
     * Sample code: ApiManagementHeadApiTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .getEntityStateByApiWithResponse(
                "rg1", "apimService1", "59d6bb8f1f7fab13dc67ec9b", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Tag_GetEntityStateByOperation

```java
import com.azure.core.util.Context;

/** Samples for Tag GetEntityStateByOperation. */
public final class TagGetEntityStateByOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationTag.json
     */
    /**
     * Sample code: ApiManagementHeadApiOperationTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadApiOperationTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .getEntityStateByOperationWithResponse(
                "rg1",
                "apimService1",
                "59d6bb8f1f7fab13dc67ec9b",
                "59d6bb8f1f7fab13dc67ec9a",
                "59306a29e4bbd510dc24e5f9",
                Context.NONE);
    }
}
```

### Tag_GetEntityStateByProduct

```java
import com.azure.core.util.Context;

/** Samples for Tag GetEntityStateByProduct. */
public final class TagGetEntityStateByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductTag.json
     */
    /**
     * Sample code: ApiManagementHeadProductTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadProductTag(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .getEntityStateByProductWithResponse(
                "rg1", "apimService1", "59306a29e4bbd510dc24e5f8", "59306a29e4bbd510dc24e5f9", Context.NONE);
    }
}
```

### Tag_ListByApi

```java
import com.azure.core.util.Context;

/** Samples for Tag ListByApi. */
public final class TagListByApiSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTags.json
     */
    /**
     * Sample code: ApiManagementListApiTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiTags(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().listByApi("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", null, null, null, Context.NONE);
    }
}
```

### Tag_ListByOperation

```java
import com.azure.core.util.Context;

/** Samples for Tag ListByOperation. */
public final class TagListByOperationSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationTags.json
     */
    /**
     * Sample code: ApiManagementListApiOperationTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListApiOperationTags(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tags()
            .listByOperation(
                "rg1",
                "apimService1",
                "57d2ef278aa04f0888cba3f3",
                "57d2ef278aa04f0888cba3f6",
                null,
                null,
                null,
                Context.NONE);
    }
}
```

### Tag_ListByProduct

```java
import com.azure.core.util.Context;

/** Samples for Tag ListByProduct. */
public final class TagListByProductSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductTags.json
     */
    /**
     * Sample code: ApiManagementListProductTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListProductTags(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().listByProduct("rg1", "apimService1", "57d2ef278aa04f0888cba3f1", null, null, null, Context.NONE);
    }
}
```

### Tag_ListByService

```java
import com.azure.core.util.Context;

/** Samples for Tag ListByService. */
public final class TagListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTags.json
     */
    /**
     * Sample code: ApiManagementListTags.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListTags(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tags().listByService("rg1", "apimService1", null, null, null, null, Context.NONE);
    }
}
```

### Tag_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.TagContract;

/** Samples for Tag Update. */
public final class TagUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTag.json
     */
    /**
     * Sample code: ApiManagementUpdateTag.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateTag(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        TagContract resource =
            manager.tags().getWithResponse("rg1", "apimService1", "temptag", Context.NONE).getValue();
        resource.update().withDisplayName("temp tag").withIfMatch("*").apply();
    }
}
```

### TagResource_ListByService

```java
import com.azure.core.util.Context;

/** Samples for TagResource ListByService. */
public final class TagResourceListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTagResources.json
     */
    /**
     * Sample code: ApiManagementListTagResources.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListTagResources(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tagResources().listByService("rg1", "apimService1", null, null, null, Context.NONE);
    }
}
```

### TenantAccess_Create

```java
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccess Create. */
public final class TenantAccessCreateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTenantAccess.json
     */
    /**
     * Sample code: ApiManagementCreateTenantAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateTenantAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantAccess()
            .define(AccessIdName.ACCESS)
            .withExistingService("rg1", "apimService1")
            .withEnabled(true)
            .withIfMatch("*")
            .create();
    }
}
```

### TenantAccess_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccess Get. */
public final class TenantAccessGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantAccess.json
     */
    /**
     * Sample code: ApiManagementGetTenantAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetTenantAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantAccess().getWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }

    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantGitAccess.json
     */
    /**
     * Sample code: ApiManagementGetTenantGitAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetTenantGitAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantAccess().getWithResponse("rg1", "apimService1", AccessIdName.GIT_ACCESS, Context.NONE);
    }
}
```

### TenantAccess_GetEntityTag

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccess GetEntityTag. */
public final class TenantAccessGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTenantAccess.json
     */
    /**
     * Sample code: ApiManagementHeadTenantAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadTenantAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantAccess().getEntityTagWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }
}
```

### TenantAccess_ListByService

```java
import com.azure.core.util.Context;

/** Samples for TenantAccess ListByService. */
public final class TenantAccessListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantAccess.json
     */
    /**
     * Sample code: ApiManagementListTenantAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListTenantAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantAccess().listByService("rg1", "apimService1", null, Context.NONE);
    }
}
```

### TenantAccess_ListSecrets

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccess ListSecrets. */
public final class TenantAccessListSecretsSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsTenantAccess.json
     */
    /**
     * Sample code: ApiManagementListSecretsTenantAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListSecretsTenantAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantAccess().listSecretsWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }
}
```

### TenantAccess_RegeneratePrimaryKey

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccess RegeneratePrimaryKey. */
public final class TenantAccessRegeneratePrimaryKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json
     */
    /**
     * Sample code: ApiManagementTenantAccessRegenerateKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantAccessRegenerateKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantAccess()
            .regeneratePrimaryKeyWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }
}
```

### TenantAccess_RegenerateSecondaryKey

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccess RegenerateSecondaryKey. */
public final class TenantAccessRegenerateSecondaryKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json
     */
    /**
     * Sample code: ApiManagementTenantAccessRegenerateKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantAccessRegenerateKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantAccess()
            .regenerateSecondaryKeyWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }
}
```

### TenantAccess_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;
import com.azure.resourcemanager.apimanagement.models.AccessInformationContract;

/** Samples for TenantAccess Update. */
public final class TenantAccessUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTenantAccess.json
     */
    /**
     * Sample code: ApiManagementUpdateTenantAccess.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateTenantAccess(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        AccessInformationContract resource =
            manager.tenantAccess().getWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE).getValue();
        resource.update().withEnabled(true).withIfMatch("*").apply();
    }
}
```

### TenantAccessGit_RegeneratePrimaryKey

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccessGit RegeneratePrimaryKey. */
public final class TenantAccessGitRegeneratePrimaryKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json
     */
    /**
     * Sample code: ApiManagementTenantAccessRegenerateKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantAccessRegenerateKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantAccessGits()
            .regeneratePrimaryKeyWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }
}
```

### TenantAccessGit_RegenerateSecondaryKey

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.AccessIdName;

/** Samples for TenantAccessGit RegenerateSecondaryKey. */
public final class TenantAccessGitRegenerateSecondaryKeySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json
     */
    /**
     * Sample code: ApiManagementTenantAccessRegenerateKey.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantAccessRegenerateKey(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantAccessGits()
            .regenerateSecondaryKeyWithResponse("rg1", "apimService1", AccessIdName.ACCESS, Context.NONE);
    }
}
```

### TenantConfiguration_Deploy

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName;
import com.azure.resourcemanager.apimanagement.models.DeployConfigurationParameters;

/** Samples for TenantConfiguration Deploy. */
public final class TenantConfigurationDeploySamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationDeploy.json
     */
    /**
     * Sample code: ApiManagementTenantConfigurationDeploy.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantConfigurationDeploy(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantConfigurations()
            .deploy(
                "rg1",
                "apimService1",
                ConfigurationIdName.CONFIGURATION,
                new DeployConfigurationParameters().withBranch("master"),
                Context.NONE);
    }
}
```

### TenantConfiguration_GetSyncState

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName;

/** Samples for TenantConfiguration GetSyncState. */
public final class TenantConfigurationGetSyncStateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessSyncState.json
     */
    /**
     * Sample code: ApiManagementTenantAccessSyncState.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantAccessSyncState(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantConfigurations()
            .getSyncStateWithResponse("rg1", "apimService1", ConfigurationIdName.CONFIGURATION, Context.NONE);
    }
}
```

### TenantConfiguration_Save

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName;
import com.azure.resourcemanager.apimanagement.models.SaveConfigurationParameter;

/** Samples for TenantConfiguration Save. */
public final class TenantConfigurationSaveSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationSave.json
     */
    /**
     * Sample code: ApiManagementTenantConfigurationSave.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantConfigurationSave(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantConfigurations()
            .save(
                "rg1",
                "apimService1",
                ConfigurationIdName.CONFIGURATION,
                new SaveConfigurationParameter().withBranch("master"),
                Context.NONE);
    }
}
```

### TenantConfiguration_Validate

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName;
import com.azure.resourcemanager.apimanagement.models.DeployConfigurationParameters;

/** Samples for TenantConfiguration Validate. */
public final class TenantConfigurationValidateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationValidate.json
     */
    /**
     * Sample code: ApiManagementTenantConfigurationValidate.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementTenantConfigurationValidate(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .tenantConfigurations()
            .validate(
                "rg1",
                "apimService1",
                ConfigurationIdName.CONFIGURATION,
                new DeployConfigurationParameters().withBranch("master"),
                Context.NONE);
    }
}
```

### TenantSettings_Get

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.SettingsTypeName;

/** Samples for TenantSettings Get. */
public final class TenantSettingsGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantSettings.json
     */
    /**
     * Sample code: ApiManagementGetTenantSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetTenantSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantSettings().getWithResponse("rg1", "apimService1", SettingsTypeName.PUBLIC, Context.NONE);
    }
}
```

### TenantSettings_ListByService

```java
import com.azure.core.util.Context;

/** Samples for TenantSettings ListByService. */
public final class TenantSettingsListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantSettings.json
     */
    /**
     * Sample code: ApiManagementListTenantSettings.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListTenantSettings(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.tenantSettings().listByService("rg1", "apimService1", null, Context.NONE);
    }
}
```

### User_CreateOrUpdate

```java
import com.azure.resourcemanager.apimanagement.models.Confirmation;

/** Samples for User CreateOrUpdate. */
public final class UserCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateUser.json
     */
    /**
     * Sample code: ApiManagementCreateUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateUser(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .users()
            .define("5931a75ae4bbd512288c680b")
            .withExistingService("rg1", "apimService1")
            .withEmail("foobar@outlook.com")
            .withFirstName("foo")
            .withLastName("bar")
            .withConfirmation(Confirmation.SIGNUP)
            .create();
    }
}
```

### User_Delete

```java
import com.azure.core.util.Context;

/** Samples for User Delete. */
public final class UserDeleteSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteUser.json
     */
    /**
     * Sample code: ApiManagementDeleteUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementDeleteUser(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .users()
            .deleteWithResponse("rg1", "apimService1", "5931a75ae4bbd512288c680b", "*", null, null, null, Context.NONE);
    }
}
```

### User_GenerateSsoUrl

```java
import com.azure.core.util.Context;

/** Samples for User GenerateSsoUrl. */
public final class UserGenerateSsoUrlSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserGenerateSsoUrl.json
     */
    /**
     * Sample code: ApiManagementUserGenerateSsoUrl.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUserGenerateSsoUrl(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.users().generateSsoUrlWithResponse("rg1", "apimService1", "57127d485157a511ace86ae7", Context.NONE);
    }
}
```

### User_Get

```java
import com.azure.core.util.Context;

/** Samples for User Get. */
public final class UserGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUser.json
     */
    /**
     * Sample code: ApiManagementGetUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetUser(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.users().getWithResponse("rg1", "apimService1", "5931a75ae4bbd512a88c680b", Context.NONE);
    }
}
```

### User_GetEntityTag

```java
import com.azure.core.util.Context;

/** Samples for User GetEntityTag. */
public final class UserGetEntityTagSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadUser.json
     */
    /**
     * Sample code: ApiManagementHeadUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementHeadUser(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.users().getEntityTagWithResponse("rg1", "apimService1", "5931a75ae4bbd512a88c680b", Context.NONE);
    }
}
```

### User_GetSharedAccessToken

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.KeyType;
import com.azure.resourcemanager.apimanagement.models.UserTokenParameters;
import java.time.OffsetDateTime;

/** Samples for User GetSharedAccessToken. */
public final class UserGetSharedAccessTokenSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserToken.json
     */
    /**
     * Sample code: ApiManagementUserToken.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUserToken(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .users()
            .getSharedAccessTokenWithResponse(
                "rg1",
                "apimService1",
                "userId1718",
                new UserTokenParameters()
                    .withKeyType(KeyType.PRIMARY)
                    .withExpiry(OffsetDateTime.parse("2019-04-21T00:44:24.2845269Z")),
                Context.NONE);
    }
}
```

### User_ListByService

```java
import com.azure.core.util.Context;

/** Samples for User ListByService. */
public final class UserListByServiceSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUsers.json
     */
    /**
     * Sample code: ApiManagementListUsers.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListUsers(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.users().listByService("rg1", "apimService1", null, null, null, null, Context.NONE);
    }
}
```

### User_Update

```java
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.UserContract;

/** Samples for User Update. */
public final class UserUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateUser.json
     */
    /**
     * Sample code: ApiManagementUpdateUser.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateUser(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        UserContract resource =
            manager.users().getWithResponse("rg1", "apimService1", "5931a75ae4bbd512a88c680b", Context.NONE).getValue();
        resource
            .update()
            .withEmail("foobar@outlook.com")
            .withFirstName("foo")
            .withLastName("bar")
            .withIfMatch("*")
            .apply();
    }
}
```

### UserConfirmationPassword_Send

```java
import com.azure.core.util.Context;

/** Samples for UserConfirmationPassword Send. */
public final class UserConfirmationPasswordSendSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserConfirmationPasswordSend.json
     */
    /**
     * Sample code: ApiManagementUserConfirmationPasswordSend.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUserConfirmationPasswordSend(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .userConfirmationPasswords()
            .sendWithResponse("rg1", "apimService1", "57127d485157a511ace86ae7", null, Context.NONE);
    }
}
```

### UserGroup_List

```java
import com.azure.core.util.Context;

/** Samples for UserGroup List. */
public final class UserGroupListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserGroups.json
     */
    /**
     * Sample code: ApiManagementListUserGroups.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListUserGroups(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.userGroups().list("rg1", "apimService1", "57681833a40f7eb6c49f6acf", null, null, null, Context.NONE);
    }
}
```

### UserIdentities_List

```java
import com.azure.core.util.Context;

/** Samples for UserIdentities List. */
public final class UserIdentitiesListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserIdentities.json
     */
    /**
     * Sample code: ApiManagementListUserIdentities.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListUserIdentities(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.userIdentities().list("rg1", "apimService1", "57f2af53bb17172280f44057", Context.NONE);
    }
}
```

### UserSubscription_Get

```java
import com.azure.core.util.Context;

/** Samples for UserSubscription Get. */
public final class UserSubscriptionGetSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUserSubscription.json
     */
    /**
     * Sample code: ApiManagementGetUserSubscription.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementGetUserSubscription(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .userSubscriptions()
            .getWithResponse("rg1", "apimService1", "1", "5fa9b096f3df14003c070001", Context.NONE);
    }
}
```

### UserSubscription_List

```java
import com.azure.core.util.Context;

/** Samples for UserSubscription List. */
public final class UserSubscriptionListSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserSubscriptions.json
     */
    /**
     * Sample code: ApiManagementListUserSubscriptions.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementListUserSubscriptions(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager
            .userSubscriptions()
            .list("rg1", "apimService1", "57681833a40f7eb6c49f6acf", null, null, null, Context.NONE);
    }
}
```

