Skip to content

Commit 337da58

Browse files
authored
mgmt premium, add service-name to api-specs.json for sample generation (#48490)
* fix api-specs.json * generate samples for domainregistration * generate samples for policy * generate samples for containerregistrytasks * Revert "generate samples for containerregistrytasks" This reverts commit 53d8840.
1 parent 9c54774 commit 337da58

91 files changed

Lines changed: 3730 additions & 12 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for DomainRegistrationProvider ListOperations.
9+
*/
10+
public final class DomainRegistrationProviderListOperationsSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/ListOperations.json
15+
*/
16+
/**
17+
* Sample code: List operations.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void listOperations(com.azure.resourcemanager.appservice.AppServiceManager manager) {
22+
manager.domainRegistrationClient()
23+
.getDomainRegistrationProviders()
24+
.listOperations(com.azure.core.util.Context.NONE);
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
import com.azure.resourcemanager.appservice.fluent.models.NameIdentifierInner;
8+
9+
/**
10+
* Samples for Domains CheckAvailability.
11+
*/
12+
public final class DomainsCheckAvailabilitySamples {
13+
/*
14+
* x-ms-original-file:
15+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
16+
* 01/examples/CheckDomainAvailability.json
17+
*/
18+
/**
19+
* Sample code: Check domain availability.
20+
*
21+
* @param manager Entry point to AppServiceManager.
22+
*/
23+
public static void checkDomainAvailability(com.azure.resourcemanager.appservice.AppServiceManager manager) {
24+
manager.domainRegistrationClient()
25+
.getDomains()
26+
.checkAvailabilityWithResponse(new NameIdentifierInner().withName("abcd.com"),
27+
com.azure.core.util.Context.NONE);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
import com.azure.resourcemanager.appservice.fluent.models.DomainOwnershipIdentifierInner;
8+
9+
/**
10+
* Samples for Domains CreateOrUpdateOwnershipIdentifier.
11+
*/
12+
public final class DomainsCreateOrUpdateOwnershipIdentifierSamples {
13+
/*
14+
* x-ms-original-file:
15+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
16+
* 01/examples/CreateAppServiceDomainOwnershipIdentifier.json
17+
*/
18+
/**
19+
* Sample code: Create App Service Domain OwnershipIdentifier.
20+
*
21+
* @param manager Entry point to AppServiceManager.
22+
*/
23+
public static void
24+
createAppServiceDomainOwnershipIdentifier(com.azure.resourcemanager.appservice.AppServiceManager manager) {
25+
manager.domainRegistrationClient()
26+
.getDomains()
27+
.createOrUpdateOwnershipIdentifierWithResponse("testrg123", "example.com", "SampleOwnershipId",
28+
new DomainOwnershipIdentifierInner().withOwnershipId("SampleOwnershipId"),
29+
com.azure.core.util.Context.NONE);
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
import com.azure.resourcemanager.appservice.fluent.models.DomainInner;
8+
import com.azure.resourcemanager.appservice.models.Address;
9+
import com.azure.resourcemanager.appservice.models.Contact;
10+
import com.azure.resourcemanager.appservice.models.DnsType;
11+
import com.azure.resourcemanager.appservice.models.DomainPurchaseConsent;
12+
import java.time.OffsetDateTime;
13+
import java.util.Arrays;
14+
import java.util.HashMap;
15+
import java.util.Map;
16+
17+
/**
18+
* Samples for Domains CreateOrUpdate.
19+
*/
20+
public final class DomainsCreateOrUpdateSamples {
21+
/*
22+
* x-ms-original-file:
23+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
24+
* 01/examples/CreateAppServiceDomain.json
25+
*/
26+
/**
27+
* Sample code: Create App Service Domain.
28+
*
29+
* @param manager Entry point to AppServiceManager.
30+
*/
31+
public static void createAppServiceDomain(com.azure.resourcemanager.appservice.AppServiceManager manager) {
32+
manager.domainRegistrationClient()
33+
.getDomains()
34+
.createOrUpdate("testrg123", "example.com",
35+
new DomainInner().withLocation("global")
36+
.withTags(mapOf())
37+
.withContactAdmin(new Contact()
38+
.withAddressMailing(new Address().withAddress1("3400 State St")
39+
.withCity("Chicago")
40+
.withCountry("United States")
41+
.withPostalCode("fakeTokenPlaceholder")
42+
.withState("IL"))
43+
.withEmail("admin@email.com")
44+
.withFax("1-245-534-2242")
45+
.withJobTitle("Admin")
46+
.withNameFirst("John")
47+
.withNameLast("Doe")
48+
.withNameMiddle("")
49+
.withOrganization("Microsoft Inc.")
50+
.withPhone("1-245-534-2242"))
51+
.withContactBilling(new Contact()
52+
.withAddressMailing(new Address().withAddress1("3400 State St")
53+
.withCity("Chicago")
54+
.withCountry("United States")
55+
.withPostalCode("fakeTokenPlaceholder")
56+
.withState("IL"))
57+
.withEmail("billing@email.com")
58+
.withFax("1-245-534-2242")
59+
.withJobTitle("Billing")
60+
.withNameFirst("John")
61+
.withNameLast("Doe")
62+
.withNameMiddle("")
63+
.withOrganization("Microsoft Inc.")
64+
.withPhone("1-245-534-2242"))
65+
.withContactRegistrant(new Contact()
66+
.withAddressMailing(new Address().withAddress1("3400 State St")
67+
.withCity("Chicago")
68+
.withCountry("United States")
69+
.withPostalCode("fakeTokenPlaceholder")
70+
.withState("IL"))
71+
.withEmail("registrant@email.com")
72+
.withFax("1-245-534-2242")
73+
.withJobTitle("Registrant")
74+
.withNameFirst("John")
75+
.withNameLast("Doe")
76+
.withNameMiddle("")
77+
.withOrganization("Microsoft Inc.")
78+
.withPhone("1-245-534-2242"))
79+
.withContactTech(new Contact()
80+
.withAddressMailing(new Address().withAddress1("3400 State St")
81+
.withCity("Chicago")
82+
.withCountry("United States")
83+
.withPostalCode("fakeTokenPlaceholder")
84+
.withState("IL"))
85+
.withEmail("tech@email.com")
86+
.withFax("1-245-534-2242")
87+
.withJobTitle("Tech")
88+
.withNameFirst("John")
89+
.withNameLast("Doe")
90+
.withNameMiddle("")
91+
.withOrganization("Microsoft Inc.")
92+
.withPhone("1-245-534-2242"))
93+
.withPrivacy(false)
94+
.withAutoRenew(true)
95+
.withConsent(new DomainPurchaseConsent().withAgreementKeys(Arrays.asList("agreementKey1"))
96+
.withAgreedBy("192.0.2.1")
97+
.withAgreedAt(OffsetDateTime.parse("2021-09-10T19:30:53Z")))
98+
.withDnsType(DnsType.DEFAULT_DOMAIN_REGISTRAR_DNS)
99+
.withAuthCode("fakeTokenPlaceholder"),
100+
com.azure.core.util.Context.NONE);
101+
}
102+
103+
// Use "Map.of" if available
104+
@SuppressWarnings("unchecked")
105+
private static <T> Map<String, T> mapOf(Object... inputs) {
106+
Map<String, T> map = new HashMap<>();
107+
for (int i = 0; i < inputs.length; i += 2) {
108+
String key = (String) inputs[i];
109+
T value = (T) inputs[i + 1];
110+
map.put(key, value);
111+
}
112+
return map;
113+
}
114+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for Domains DeleteOwnershipIdentifier.
9+
*/
10+
public final class DomainsDeleteOwnershipIdentifierSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/DeleteAppServiceDomainOwnershipIdentifier.json
15+
*/
16+
/**
17+
* Sample code: Delete App Service Domain Ownership Identifier.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void
22+
deleteAppServiceDomainOwnershipIdentifier(com.azure.resourcemanager.appservice.AppServiceManager manager) {
23+
manager.domainRegistrationClient()
24+
.getDomains()
25+
.deleteOwnershipIdentifierWithResponse("testrg123", "example.com", "ownershipIdentifier",
26+
com.azure.core.util.Context.NONE);
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for Domains Delete.
9+
*/
10+
public final class DomainsDeleteSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/DeleteAppServiceDomain.json
15+
*/
16+
/**
17+
* Sample code: Delete App Service Domain.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void deleteAppServiceDomain(com.azure.resourcemanager.appservice.AppServiceManager manager) {
22+
manager.domainRegistrationClient()
23+
.getDomains()
24+
.deleteWithResponse("testrg123", "example.com", true, com.azure.core.util.Context.NONE);
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for Domains GetByResourceGroup.
9+
*/
10+
public final class DomainsGetByResourceGroupSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/GetDomain.json
15+
*/
16+
/**
17+
* Sample code: Get Domain.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void getDomain(com.azure.resourcemanager.appservice.AppServiceManager manager) {
22+
manager.domainRegistrationClient()
23+
.getDomains()
24+
.getByResourceGroupWithResponse("testrg123", "example.com", com.azure.core.util.Context.NONE);
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for Domains GetControlCenterSsoRequest.
9+
*/
10+
public final class DomainsGetControlCenterSsoRequestSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/GetDomainControlCenterSsoRequest.json
15+
*/
16+
/**
17+
* Sample code: Get Domain Control Center Sso Request.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void
22+
getDomainControlCenterSsoRequest(com.azure.resourcemanager.appservice.AppServiceManager manager) {
23+
manager.domainRegistrationClient()
24+
.getDomains()
25+
.getControlCenterSsoRequestWithResponse(com.azure.core.util.Context.NONE);
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for Domains GetOwnershipIdentifier.
9+
*/
10+
public final class DomainsGetOwnershipIdentifierSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/GetDomainOwnershipIdentifier.json
15+
*/
16+
/**
17+
* Sample code: Get Domain Ownership Identifier.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void getDomainOwnershipIdentifier(com.azure.resourcemanager.appservice.AppServiceManager manager) {
22+
manager.domainRegistrationClient()
23+
.getDomains()
24+
.getOwnershipIdentifierWithResponse("testrg123", "example.com", "SampleOwnershipId",
25+
com.azure.core.util.Context.NONE);
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
5+
package com.azure.resourcemanager.appservice.generated;
6+
7+
/**
8+
* Samples for Domains ListByResourceGroup.
9+
*/
10+
public final class DomainsListByResourceGroupSamples {
11+
/*
12+
* x-ms-original-file:
13+
* specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/stable/2024-11-
14+
* 01/examples/ListDomainsByResourceGroup.json
15+
*/
16+
/**
17+
* Sample code: List domains by resource group.
18+
*
19+
* @param manager Entry point to AppServiceManager.
20+
*/
21+
public static void listDomainsByResourceGroup(com.azure.resourcemanager.appservice.AppServiceManager manager) {
22+
manager.domainRegistrationClient()
23+
.getDomains()
24+
.listByResourceGroup("testrg123", com.azure.core.util.Context.NONE);
25+
}
26+
}

0 commit comments

Comments
 (0)