diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 3932d25f8e89e..35cb107220494 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -323,6 +323,7 @@ com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-orbital;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 7e6a817f6ddad..869424c70790e 100644 --- a/pom.xml +++ b/pom.xml @@ -800,6 +800,7 @@ sdk/netapp sdk/notificationhubs sdk/operationsmanagement + sdk/orbital sdk/peering sdk/policyinsights sdk/postgresql diff --git a/sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md b/sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md new file mode 100644 index 0000000000000..9db82110b8809 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-11-18) + +- Azure Resource Manager orbital client library for Java. This package contains Microsoft Azure SDK for orbital Management SDK. Azure Orbital service. Package tag package-2021-04-04-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/orbital/azure-resourcemanager-orbital/README.md b/sdk/orbital/azure-resourcemanager-orbital/README.md new file mode 100644 index 0000000000000..17ef50fee99a2 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager orbital client library for Java + +Azure Resource Manager orbital client library for Java. + +This package contains Microsoft Azure SDK for orbital Management SDK. Azure Orbital service. Package tag package-2021-04-04-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-orbital;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-orbital + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +OrbitalManager manager = OrbitalManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/orbital/azure-resourcemanager-orbital/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/orbital/azure-resourcemanager-orbital/SAMPLE.md b/sdk/orbital/azure-resourcemanager-orbital/SAMPLE.md new file mode 100644 index 0000000000000..9a47dce4d15c6 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/SAMPLE.md @@ -0,0 +1,608 @@ +# Code snippets and samples + + +## AvailableGroundStations + +- [Get](#availablegroundstations_get) +- [List](#availablegroundstations_list) + +## ContactProfiles + +- [CreateOrUpdate](#contactprofiles_createorupdate) +- [Delete](#contactprofiles_delete) +- [GetByResourceGroup](#contactprofiles_getbyresourcegroup) +- [List](#contactprofiles_list) +- [ListByResourceGroup](#contactprofiles_listbyresourcegroup) +- [UpdateTags](#contactprofiles_updatetags) + +## Contacts + +- [Create](#contacts_create) +- [Delete](#contacts_delete) +- [Get](#contacts_get) +- [List](#contacts_list) + +## Operations + +- [List](#operations_list) + +## Spacecrafts + +- [CreateOrUpdate](#spacecrafts_createorupdate) +- [Delete](#spacecrafts_delete) +- [GetByResourceGroup](#spacecrafts_getbyresourcegroup) +- [List](#spacecrafts_list) +- [ListAvailableContacts](#spacecrafts_listavailablecontacts) +- [ListByResourceGroup](#spacecrafts_listbyresourcegroup) +- [UpdateTags](#spacecrafts_updatetags) +### AvailableGroundStations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableGroundStations Get. */ +public final class AvailableGroundStationsGetSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableGroundStationGet.json + */ + /** + * Sample code: Get GroundStation. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getGroundStation(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.availableGroundStations().getWithResponse("westus_gs1", Context.NONE); + } +} +``` + +### AvailableGroundStations_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.AvailableGroundStationsCapability; + +/** Samples for AvailableGroundStations List. */ +public final class AvailableGroundStationsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableGroundStationsByCapabilityList.json + */ + /** + * Sample code: List of Ground Stations by Capability. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfGroundStationsByCapability(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.availableGroundStations().list(AvailableGroundStationsCapability.EARTH_OBSERVATION, Context.NONE); + } +} +``` + +### ContactProfiles_CreateOrUpdate + +```java +import com.azure.resourcemanager.orbital.models.AutoTrackingConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfileLink; +import com.azure.resourcemanager.orbital.models.ContactProfileLinkChannel; +import com.azure.resourcemanager.orbital.models.Direction; +import com.azure.resourcemanager.orbital.models.EndPoint; +import com.azure.resourcemanager.orbital.models.Polarization; +import com.azure.resourcemanager.orbital.models.Protocol; +import java.util.Arrays; + +/** Samples for ContactProfiles CreateOrUpdate. */ +public final class ContactProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileCreate.json + */ + /** + * Sample code: Create a contact profile. + * + * @param manager Entry point to OrbitalManager. + */ + public static void createAContactProfile(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .contactProfiles() + .define("AQUA_DIRECTPLAYBACK_WITH_UPLINK") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withMinimumViableContactDuration("PT1M") + .withMinimumElevationDegrees(10.0f) + .withAutoTrackingConfiguration(AutoTrackingConfiguration.X_BAND) + .withLinks( + Arrays + .asList( + new ContactProfileLink() + .withPolarization(Polarization.RHCP) + .withDirection(Direction.UPLINK) + .withGainOverTemperature(0.0f) + .withEirpdBW(45.0f) + .withChannels( + Arrays + .asList( + new ContactProfileLinkChannel() + .withCenterFrequencyMHz(2106.4063f) + .withBandwidthMHz(0.036f) + .withEndPoint( + new EndPoint() + .withIpAddress("10.0.1.0") + .withEndPointName("AQUA_command") + .withPort("4000") + .withProtocol(Protocol.TCP)) + .withModulationConfiguration("AQUA_UPLINK_BPSK") + .withDemodulationConfiguration("na") + .withEncodingConfiguration("AQUA_CMD_CCSDS") + .withDecodingConfiguration("na"))), + new ContactProfileLink() + .withPolarization(Polarization.RHCP) + .withDirection(Direction.DOWNLINK) + .withGainOverTemperature(25.0f) + .withEirpdBW(0.0f) + .withChannels( + Arrays + .asList( + new ContactProfileLinkChannel() + .withCenterFrequencyMHz(8160f) + .withBandwidthMHz(150f) + .withEndPoint( + new EndPoint() + .withIpAddress("10.0.2.0") + .withEndPointName("AQUA_directplayback") + .withPort("4000") + .withProtocol(Protocol.TCP)) + .withModulationConfiguration("na") + .withDemodulationConfiguration("AQUA_DOWNLINK_QPSK") + .withEncodingConfiguration("na") + .withDecodingConfiguration("AQUA_DIRECTPLAYBACK_CCSDS"))))) + .create(); + } +} +``` + +### ContactProfiles_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ContactProfiles Delete. */ +public final class ContactProfilesDeleteSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileDelete.json + */ + /** + * Sample code: Delete Contact Profile. + * + * @param manager Entry point to OrbitalManager. + */ + public static void deleteContactProfile(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().delete("rg1", "AQUA_DIRECTPLAYBACK_WITH_UPLINK", Context.NONE); + } +} +``` + +### ContactProfiles_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ContactProfiles GetByResourceGroup. */ +public final class ContactProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileGet.json + */ + /** + * Sample code: Get a contact profile. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getAContactProfile(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .contactProfiles() + .getByResourceGroupWithResponse("rg1", "AQUA_DIRECTPLAYBACK_WITH_UPLINK", Context.NONE); + } +} +``` + +### ContactProfiles_List + +```java +import com.azure.core.util.Context; + +/** Samples for ContactProfiles List. */ +public final class ContactProfilesListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfilesBySubscriptionList.json + */ + /** + * Sample code: List of Contact Profiles by Subscription. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContactProfilesBySubscription(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().list(Context.NONE); + } +} +``` + +### ContactProfiles_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ContactProfiles ListByResourceGroup. */ +public final class ContactProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfilesByResourceGroupList.json + */ + /** + * Sample code: List of Contact Profiles by Resource Group. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContactProfilesByResourceGroup(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### ContactProfiles_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.ContactProfile; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContactProfiles UpdateTags. */ +public final class ContactProfilesUpdateTagsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileUpdateTag.json + */ + /** + * Sample code: Update Contact Profile tags. + * + * @param manager Entry point to OrbitalManager. + */ + public static void updateContactProfileTags(com.azure.resourcemanager.orbital.OrbitalManager manager) { + ContactProfile resource = + manager + .contactProfiles() + .getByResourceGroupWithResponse("rg1", "AQUA_DIRECTPLAYBACK_WITH_UPLINK", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map 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; + } +} +``` + +### Contacts_Create + +```java +import com.azure.resourcemanager.orbital.models.ResourceReference; +import java.time.OffsetDateTime; + +/** Samples for Contacts Create. */ +public final class ContactsCreateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactCreate.json + */ + /** + * Sample code: Create a contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void createAContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .contacts() + .define("contact1") + .withExistingSpacecraft("rg1", "AQUA") + .withReservationStartTime(OffsetDateTime.parse("2020-07-16T20:35:00.00Z")) + .withReservationEndTime(OffsetDateTime.parse("2020-07-16T20:55:00.00Z")) + .withGroundStationName("westus_gs1") + .withContactProfile( + new ResourceReference() + .withId( + "/subscriptions/subId/resourceGroups/rg/Microsoft.Orbital/contactProfiles/AQUA_DIRECTPLAYBACK_WITH_UPLINK")) + .create(); + } +} +``` + +### Contacts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Contacts Delete. */ +public final class ContactsDeleteSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactDelete.json + */ + /** + * Sample code: Delete Contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void deleteContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().delete("rg1", "AQUA", "contact1", Context.NONE); + } +} +``` + +### Contacts_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Contacts Get. */ +public final class ContactsGetSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactGet.json + */ + /** + * Sample code: Get Contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().getWithResponse("rg1", "AQUA", "contact1", Context.NONE); + } +} +``` + +### Contacts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Contacts List. */ +public final class ContactsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactsBySpacecraftNameList.json + */ + /** + * Sample code: List of Contacts. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContacts(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().list("rg1", "AQUA", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to OrbitalManager. + */ + public static void operationsList(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Spacecrafts_CreateOrUpdate + +```java +import com.azure.resourcemanager.orbital.models.Direction; +import com.azure.resourcemanager.orbital.models.Polarization; +import com.azure.resourcemanager.orbital.models.SpacecraftLink; +import java.util.Arrays; + +/** Samples for Spacecrafts CreateOrUpdate. */ +public final class SpacecraftsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftCreate.json + */ + /** + * Sample code: Create a spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void createASpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .spacecrafts() + .define("AQUA") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withNoradId("27424") + .withTitleLine("(AQUA)") + .withTleLine1("1 27424U 02022A 20195.59202355 .00000039 00000-0 18634-4 0 9991") + .withTleLine2("2 27424 98.2098 135.8486 0000176 28.4050 144.5909 14.57108832967671") + .withLinks( + Arrays + .asList( + new SpacecraftLink() + .withCenterFrequencyMHz(2106.4063f) + .withBandwidthMHz(0.036f) + .withDirection(Direction.UPLINK) + .withPolarization(Polarization.RHCP), + new SpacecraftLink() + .withCenterFrequencyMHz(8125f) + .withBandwidthMHz(150f) + .withDirection(Direction.DOWNLINK) + .withPolarization(Polarization.RHCP))) + .create(); + } +} +``` + +### Spacecrafts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Spacecrafts Delete. */ +public final class SpacecraftsDeleteSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftDelete.json + */ + /** + * Sample code: Delete Spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void deleteSpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().delete("rg1", "AQUA", Context.NONE); + } +} +``` + +### Spacecrafts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Spacecrafts GetByResourceGroup. */ +public final class SpacecraftsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftGet.json + */ + /** + * Sample code: Get Spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getSpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().getByResourceGroupWithResponse("rg1", "AQUA", Context.NONE); + } +} +``` + +### Spacecrafts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Spacecrafts List. */ +public final class SpacecraftsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftsBySubscriptionList.json + */ + /** + * Sample code: List of Spacecraft by Subscription. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfSpacecraftBySubscription(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().list(Context.NONE); + } +} +``` + +### Spacecrafts_ListAvailableContacts + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.ResourceReference; +import java.time.OffsetDateTime; + +/** Samples for Spacecrafts ListAvailableContacts. */ +public final class SpacecraftsListAvailableContactsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableContactsList.json + */ + /** + * Sample code: List of Contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .spacecrafts() + .listAvailableContacts( + "rgName", + "AQUA", + new ContactParameters() + .withContactProfile( + new ResourceReference() + .withId( + "/subscriptions/subId/resourceGroups/rg/Microsoft.Orbital/contactProfiles/AQUA_DIRECTPLAYBACK_WITH_UPLINK")) + .withGroundStationName("westus_gs1") + .withStartTime(OffsetDateTime.parse("2020-07-16T05:40:21.00Z")) + .withEndTime(OffsetDateTime.parse("2020-07-17T23:49:40.00Z")), + Context.NONE); + } +} +``` + +### Spacecrafts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Spacecrafts ListByResourceGroup. */ +public final class SpacecraftsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftsByResourceGroupList.json + */ + /** + * Sample code: List of Spacecraft by Resource Group. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfSpacecraftByResourceGroup(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### Spacecrafts_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.Spacecraft; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Spacecrafts UpdateTags. */ +public final class SpacecraftsUpdateTagsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftUpdateTags.json + */ + /** + * Sample code: Update Spacecraft tags. + * + * @param manager Entry point to OrbitalManager. + */ + public static void updateSpacecraftTags(com.azure.resourcemanager.orbital.OrbitalManager manager) { + Spacecraft resource = + manager.spacecrafts().getByResourceGroupWithResponse("rg1", "AQUA", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map 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; + } +} +``` + diff --git a/sdk/orbital/azure-resourcemanager-orbital/pom.xml b/sdk/orbital/azure-resourcemanager-orbital/pom.xml new file mode 100644 index 0000000000000..f15c1f56c1f1d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-orbital + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for orbital Management + This package contains Microsoft Azure SDK for orbital Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Orbital service. Package tag package-2021-04-04-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + false + + + + + + com.azure + azure-core + 1.22.0 + + + com.azure + azure-core-management + 1.4.3 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/OrbitalManager.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/OrbitalManager.java new file mode 100644 index 0000000000000..588153b26f076 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/OrbitalManager.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.AzureOrbital; +import com.azure.resourcemanager.orbital.implementation.AvailableGroundStationsImpl; +import com.azure.resourcemanager.orbital.implementation.AzureOrbitalBuilder; +import com.azure.resourcemanager.orbital.implementation.ContactProfilesImpl; +import com.azure.resourcemanager.orbital.implementation.ContactsImpl; +import com.azure.resourcemanager.orbital.implementation.OperationsImpl; +import com.azure.resourcemanager.orbital.implementation.SpacecraftsImpl; +import com.azure.resourcemanager.orbital.models.AvailableGroundStations; +import com.azure.resourcemanager.orbital.models.ContactProfiles; +import com.azure.resourcemanager.orbital.models.Contacts; +import com.azure.resourcemanager.orbital.models.Operations; +import com.azure.resourcemanager.orbital.models.Spacecrafts; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to OrbitalManager. Azure Orbital service. */ +public final class OrbitalManager { + private Operations operations; + + private Spacecrafts spacecrafts; + + private Contacts contacts; + + private ContactProfiles contactProfiles; + + private AvailableGroundStations availableGroundStations; + + private final AzureOrbital clientObject; + + private OrbitalManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AzureOrbitalBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of orbital service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the orbital service API instance. + */ + public static OrbitalManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create OrbitalManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new OrbitalManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of orbital service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the orbital service API instance. + */ + public OrbitalManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.orbital") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new OrbitalManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Spacecrafts. */ + public Spacecrafts spacecrafts() { + if (this.spacecrafts == null) { + this.spacecrafts = new SpacecraftsImpl(clientObject.getSpacecrafts(), this); + } + return spacecrafts; + } + + /** @return Resource collection API of Contacts. */ + public Contacts contacts() { + if (this.contacts == null) { + this.contacts = new ContactsImpl(clientObject.getContacts(), this); + } + return contacts; + } + + /** @return Resource collection API of ContactProfiles. */ + public ContactProfiles contactProfiles() { + if (this.contactProfiles == null) { + this.contactProfiles = new ContactProfilesImpl(clientObject.getContactProfiles(), this); + } + return contactProfiles; + } + + /** @return Resource collection API of AvailableGroundStations. */ + public AvailableGroundStations availableGroundStations() { + if (this.availableGroundStations == null) { + this.availableGroundStations = + new AvailableGroundStationsImpl(clientObject.getAvailableGroundStations(), this); + } + return availableGroundStations; + } + + /** + * @return Wrapped service client AzureOrbital providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public AzureOrbital serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AvailableGroundStationsClient.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AvailableGroundStationsClient.java new file mode 100644 index 0000000000000..c57cc3dd4f656 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AvailableGroundStationsClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; +import com.azure.resourcemanager.orbital.models.AvailableGroundStationsCapability; + +/** An instance of this class provides access to all the operations defined in AvailableGroundStationsClient. */ +public interface AvailableGroundStationsClient { + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(AvailableGroundStationsCapability capability); + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(AvailableGroundStationsCapability capability, Context context); + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableGroundStationInner get(String groundStationName); + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String groundStationName, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AzureOrbital.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AzureOrbital.java new file mode 100644 index 0000000000000..f698f7f472ae2 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AzureOrbital.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AzureOrbital class. */ +public interface AzureOrbital { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SpacecraftsClient object to access its operations. + * + * @return the SpacecraftsClient object. + */ + SpacecraftsClient getSpacecrafts(); + + /** + * Gets the ContactsClient object to access its operations. + * + * @return the ContactsClient object. + */ + ContactsClient getContacts(); + + /** + * Gets the ContactProfilesClient object to access its operations. + * + * @return the ContactProfilesClient object. + */ + ContactProfilesClient getContactProfiles(); + + /** + * Gets the AvailableGroundStationsClient object to access its operations. + * + * @return the AvailableGroundStationsClient object. + */ + AvailableGroundStationsClient getAvailableGroundStations(); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactProfilesClient.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactProfilesClient.java new file mode 100644 index 0000000000000..a03c65662d965 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactProfilesClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import com.azure.resourcemanager.orbital.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ContactProfilesClient. */ +public interface ContactProfilesClient { + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactProfileInner getByResourceGroup(String resourceGroupName, String contactProfileName); + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String contactProfileName, Context context); + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContactProfileInner> beginCreateOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters); + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContactProfileInner> beginCreateOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context); + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactProfileInner createOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters); + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactProfileInner createOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context); + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String contactProfileName); + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String contactProfileName, Context context); + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String contactProfileName); + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String contactProfileName, Context context); + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactProfileInner updateTags(String resourceGroupName, String contactProfileName, TagsObject parameters); + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context); + + /** + * Returns list of contact profiles. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns list of contact profiles. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactsClient.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactsClient.java new file mode 100644 index 0000000000000..b32c28937c4a5 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactsClient.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; + +/** An instance of this class provides access to all the operations defined in ContactsClient. */ +public interface ContactsClient { + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String spacecraftName); + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String spacecraftName, Context context); + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactInner get(String resourceGroupName, String spacecraftName, String contactName); + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String spacecraftName, String contactName, Context context); + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContactInner> beginCreate( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters); + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContactInner> beginCreate( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context); + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactInner create(String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters); + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContactInner create( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context); + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String spacecraftName, String contactName); + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String spacecraftName, String contactName, Context context); + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String spacecraftName, String contactName); + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String spacecraftName, String contactName, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsClient.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsClient.java new file mode 100644 index 0000000000000..e127d59ee62ea --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Orbital Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Orbital Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/SpacecraftsClient.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/SpacecraftsClient.java new file mode 100644 index 0000000000000..d94c19ca0e2d0 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/SpacecraftsClient.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsListResultInner; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SpacecraftsClient. */ +public interface SpacecraftsClient { + /** + * Return list of spacecrafts. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Return list of spacecrafts. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SpacecraftInner getByResourceGroup(String resourceGroupName, String spacecraftName); + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String spacecraftName, Context context); + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SpacecraftInner> beginCreateOrUpdate( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters); + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SpacecraftInner> beginCreateOrUpdate( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context); + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SpacecraftInner createOrUpdate(String resourceGroupName, String spacecraftName, SpacecraftInner parameters); + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SpacecraftInner createOrUpdate( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context); + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String spacecraftName); + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String spacecraftName, Context context); + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String spacecraftName); + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String spacecraftName, Context context); + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SpacecraftInner updateTags(String resourceGroupName, String spacecraftName, TagsObject parameters); + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context); + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AvailableContactsListResultInner> + beginListAvailableContacts(String resourceGroupName, String spacecraftName, ContactParameters parameters); + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AvailableContactsListResultInner> + beginListAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context); + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableContactsListResultInner listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters); + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableContactsListResultInner listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsListResultInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsListResultInner.java new file mode 100644 index 0000000000000..8261b9fcedc9d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.AvailableContacts; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListAvailableContacts API service call. */ +@Fluent +public final class AvailableContactsListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableContactsListResultInner.class); + + /* + * A list of available contacts + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of available contacts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of available contacts. + * + * @param value the value value to set. + * @return the AvailableContactsListResultInner object itself. + */ + public AvailableContactsListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationInner.java new file mode 100644 index 0000000000000..9d0974f605f17 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationInner.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** GroundStations available to schedule Contacts. */ +@Fluent +public final class AvailableGroundStationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableGroundStationInner.class); + + /* + * Id of groundStation + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of the ground station. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Azure region + */ + @JsonProperty(value = "location") + private String location; + + /* + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The properties bag for this resource + */ + @JsonProperty(value = "properties") + private AvailableGroundStationProperties innerProperties; + + /** + * Get the id property: Id of groundStation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the ground station. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the location property: Azure region. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Azure region. + * + * @param location the location value to set. + * @return the AvailableGroundStationInner object itself. + */ + public AvailableGroundStationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: The properties bag for this resource. + * + * @return the innerProperties value. + */ + private AvailableGroundStationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the city property: City of ground station. + * + * @return the city value. + */ + public String city() { + return this.innerProperties() == null ? null : this.innerProperties().city(); + } + + /** + * Set the city property: City of ground station. + * + * @param city the city value to set. + * @return the AvailableGroundStationInner object itself. + */ + public AvailableGroundStationInner withCity(String city) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableGroundStationProperties(); + } + this.innerProperties().withCity(city); + return this; + } + + /** + * Get the providerName property: Ground station provider name. + * + * @return the providerName value. + */ + public String providerName() { + return this.innerProperties() == null ? null : this.innerProperties().providerName(); + } + + /** + * Set the providerName property: Ground station provider name. + * + * @param providerName the providerName value to set. + * @return the AvailableGroundStationInner object itself. + */ + public AvailableGroundStationInner withProviderName(String providerName) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableGroundStationProperties(); + } + this.innerProperties().withProviderName(providerName); + return this; + } + + /** + * Get the longitudeDegrees property: Longitude of the ground station in decimal degrees. + * + * @return the longitudeDegrees value. + */ + public Float longitudeDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().longitudeDegrees(); + } + + /** + * Set the longitudeDegrees property: Longitude of the ground station in decimal degrees. + * + * @param longitudeDegrees the longitudeDegrees value to set. + * @return the AvailableGroundStationInner object itself. + */ + public AvailableGroundStationInner withLongitudeDegrees(Float longitudeDegrees) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableGroundStationProperties(); + } + this.innerProperties().withLongitudeDegrees(longitudeDegrees); + return this; + } + + /** + * Get the latitudeDegrees property: Latitude of the ground station in decimal degrees. + * + * @return the latitudeDegrees value. + */ + public Float latitudeDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().latitudeDegrees(); + } + + /** + * Set the latitudeDegrees property: Latitude of the ground station in decimal degrees. + * + * @param latitudeDegrees the latitudeDegrees value to set. + * @return the AvailableGroundStationInner object itself. + */ + public AvailableGroundStationInner withLatitudeDegrees(Float latitudeDegrees) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableGroundStationProperties(); + } + this.innerProperties().withLatitudeDegrees(latitudeDegrees); + return this; + } + + /** + * Get the altitudeMeters property: Altitude of the ground station. + * + * @return the altitudeMeters value. + */ + public Float altitudeMeters() { + return this.innerProperties() == null ? null : this.innerProperties().altitudeMeters(); + } + + /** + * Set the altitudeMeters property: Altitude of the ground station. + * + * @param altitudeMeters the altitudeMeters value to set. + * @return the AvailableGroundStationInner object itself. + */ + public AvailableGroundStationInner withAltitudeMeters(Float altitudeMeters) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableGroundStationProperties(); + } + this.innerProperties().withAltitudeMeters(altitudeMeters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationProperties.java new file mode 100644 index 0000000000000..ddf27dd2d71db --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationProperties.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties object for Available groundstation. */ +@Fluent +public final class AvailableGroundStationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableGroundStationProperties.class); + + /* + * City of ground station. + */ + @JsonProperty(value = "city") + private String city; + + /* + * Ground station provider name. + */ + @JsonProperty(value = "providerName") + private String providerName; + + /* + * Longitude of the ground station in decimal degrees. + */ + @JsonProperty(value = "longitudeDegrees") + private Float longitudeDegrees; + + /* + * Latitude of the ground station in decimal degrees. + */ + @JsonProperty(value = "latitudeDegrees") + private Float latitudeDegrees; + + /* + * Altitude of the ground station + */ + @JsonProperty(value = "altitudeMeters") + private Float altitudeMeters; + + /** + * Get the city property: City of ground station. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: City of ground station. + * + * @param city the city value to set. + * @return the AvailableGroundStationProperties object itself. + */ + public AvailableGroundStationProperties withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the providerName property: Ground station provider name. + * + * @return the providerName value. + */ + public String providerName() { + return this.providerName; + } + + /** + * Set the providerName property: Ground station provider name. + * + * @param providerName the providerName value to set. + * @return the AvailableGroundStationProperties object itself. + */ + public AvailableGroundStationProperties withProviderName(String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get the longitudeDegrees property: Longitude of the ground station in decimal degrees. + * + * @return the longitudeDegrees value. + */ + public Float longitudeDegrees() { + return this.longitudeDegrees; + } + + /** + * Set the longitudeDegrees property: Longitude of the ground station in decimal degrees. + * + * @param longitudeDegrees the longitudeDegrees value to set. + * @return the AvailableGroundStationProperties object itself. + */ + public AvailableGroundStationProperties withLongitudeDegrees(Float longitudeDegrees) { + this.longitudeDegrees = longitudeDegrees; + return this; + } + + /** + * Get the latitudeDegrees property: Latitude of the ground station in decimal degrees. + * + * @return the latitudeDegrees value. + */ + public Float latitudeDegrees() { + return this.latitudeDegrees; + } + + /** + * Set the latitudeDegrees property: Latitude of the ground station in decimal degrees. + * + * @param latitudeDegrees the latitudeDegrees value to set. + * @return the AvailableGroundStationProperties object itself. + */ + public AvailableGroundStationProperties withLatitudeDegrees(Float latitudeDegrees) { + this.latitudeDegrees = latitudeDegrees; + return this; + } + + /** + * Get the altitudeMeters property: Altitude of the ground station. + * + * @return the altitudeMeters value. + */ + public Float altitudeMeters() { + return this.altitudeMeters; + } + + /** + * Set the altitudeMeters property: Altitude of the ground station. + * + * @param altitudeMeters the altitudeMeters value to set. + * @return the AvailableGroundStationProperties object itself. + */ + public AvailableGroundStationProperties withAltitudeMeters(Float altitudeMeters) { + this.altitudeMeters = altitudeMeters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInner.java new file mode 100644 index 0000000000000..a5b19fa2c3cb8 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInner.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.ResourceReference; +import com.azure.resourcemanager.orbital.models.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Customer creates a contact resource for a spacecraft resource. */ +@Fluent +public final class ContactInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactInner.class); + + /* + * Properties of the Contact Resource. + */ + @JsonProperty(value = "properties") + private ContactsProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the innerProperties property: Properties of the Contact Resource. + * + * @return the innerProperties value. + */ + private ContactsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the status property: Status of a contact. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the reservationStartTime property: Reservation start time of a contact. + * + * @return the reservationStartTime value. + */ + public OffsetDateTime reservationStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().reservationStartTime(); + } + + /** + * Set the reservationStartTime property: Reservation start time of a contact. + * + * @param reservationStartTime the reservationStartTime value to set. + * @return the ContactInner object itself. + */ + public ContactInner withReservationStartTime(OffsetDateTime reservationStartTime) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactsProperties(); + } + this.innerProperties().withReservationStartTime(reservationStartTime); + return this; + } + + /** + * Get the reservationEndTime property: Reservation end time of a contact. + * + * @return the reservationEndTime value. + */ + public OffsetDateTime reservationEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().reservationEndTime(); + } + + /** + * Set the reservationEndTime property: Reservation end time of a contact. + * + * @param reservationEndTime the reservationEndTime value to set. + * @return the ContactInner object itself. + */ + public ContactInner withReservationEndTime(OffsetDateTime reservationEndTime) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactsProperties(); + } + this.innerProperties().withReservationEndTime(reservationEndTime); + return this; + } + + /** + * Get the rxStartTime property: Receive start time of a contact. + * + * @return the rxStartTime value. + */ + public OffsetDateTime rxStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().rxStartTime(); + } + + /** + * Get the rxEndTime property: Receive end time of a contact. + * + * @return the rxEndTime value. + */ + public OffsetDateTime rxEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().rxEndTime(); + } + + /** + * Get the txStartTime property: Transmit start time of a contact. + * + * @return the txStartTime value. + */ + public OffsetDateTime txStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().txStartTime(); + } + + /** + * Get the txEndTime property: Transmit end time of a contact. + * + * @return the txEndTime value. + */ + public OffsetDateTime txEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().txEndTime(); + } + + /** + * Get the errorMessage property: Any error message while scheduling a contact. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * Get the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal degrees. + * + * @return the maximumElevationDegrees value. + */ + public Float maximumElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().maximumElevationDegrees(); + } + + /** + * Get the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees. + * + * @return the startAzimuthDegrees value. + */ + public Float startAzimuthDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().startAzimuthDegrees(); + } + + /** + * Get the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees. + * + * @return the endAzimuthDegrees value. + */ + public Float endAzimuthDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().endAzimuthDegrees(); + } + + /** + * Get the groundStationName property: Azure Ground Station name. + * + * @return the groundStationName value. + */ + public String groundStationName() { + return this.innerProperties() == null ? null : this.innerProperties().groundStationName(); + } + + /** + * Set the groundStationName property: Azure Ground Station name. + * + * @param groundStationName the groundStationName value to set. + * @return the ContactInner object itself. + */ + public ContactInner withGroundStationName(String groundStationName) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactsProperties(); + } + this.innerProperties().withGroundStationName(groundStationName); + return this; + } + + /** + * Get the startElevationDegrees property: Spacecraft elevation above the horizon at contact start. + * + * @return the startElevationDegrees value. + */ + public Float startElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().startElevationDegrees(); + } + + /** + * Get the endElevationDegrees property: Spacecraft elevation above the horizon at contact end. + * + * @return the endElevationDegrees value. + */ + public Float endElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().endElevationDegrees(); + } + + /** + * Get the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + public ResourceReference contactProfile() { + return this.innerProperties() == null ? null : this.innerProperties().contactProfile(); + } + + /** + * Set the contactProfile property: The reference to the contact profile resource. + * + * @param contactProfile the contactProfile value to set. + * @return the ContactInner object itself. + */ + public ContactInner withContactProfile(ResourceReference contactProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactsProperties(); + } + this.innerProperties().withContactProfile(contactProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInstanceProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInstanceProperties.java new file mode 100644 index 0000000000000..719c3b0bddc45 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInstanceProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Contact Instance Properties. */ +@Immutable +public final class ContactInstanceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactInstanceProperties.class); + + /* + * Maximum elevation of the antenna during the contact in decimal degrees. + */ + @JsonProperty(value = "maximumElevationDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float maximumElevationDegrees; + + /* + * Time at which antenna transmit will be enabled. + */ + @JsonProperty(value = "txStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txStartTime; + + /* + * Time at which antenna transmit will be disabled. + */ + @JsonProperty(value = "txEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txEndTime; + + /* + * Earliest time to receive a signal. + */ + @JsonProperty(value = "rxStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxStartTime; + + /* + * Time to lost receiving a signal. + */ + @JsonProperty(value = "rxEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxEndTime; + + /* + * Azimuth of the antenna at the start of the contact in decimal degrees. + */ + @JsonProperty(value = "startAzimuthDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float startAzimuthDegrees; + + /* + * Azimuth of the antenna at the end of the contact in decimal degrees. + */ + @JsonProperty(value = "endAzimuthDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float endAzimuthDegrees; + + /* + * Spacecraft elevation above the horizon at contact start. + */ + @JsonProperty(value = "startElevationDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float startElevationDegrees; + + /* + * Spacecraft elevation above the horizon at contact end. + */ + @JsonProperty(value = "endElevationDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float endElevationDegrees; + + /** + * Get the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal degrees. + * + * @return the maximumElevationDegrees value. + */ + public Float maximumElevationDegrees() { + return this.maximumElevationDegrees; + } + + /** + * Get the txStartTime property: Time at which antenna transmit will be enabled. + * + * @return the txStartTime value. + */ + public OffsetDateTime txStartTime() { + return this.txStartTime; + } + + /** + * Get the txEndTime property: Time at which antenna transmit will be disabled. + * + * @return the txEndTime value. + */ + public OffsetDateTime txEndTime() { + return this.txEndTime; + } + + /** + * Get the rxStartTime property: Earliest time to receive a signal. + * + * @return the rxStartTime value. + */ + public OffsetDateTime rxStartTime() { + return this.rxStartTime; + } + + /** + * Get the rxEndTime property: Time to lost receiving a signal. + * + * @return the rxEndTime value. + */ + public OffsetDateTime rxEndTime() { + return this.rxEndTime; + } + + /** + * Get the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees. + * + * @return the startAzimuthDegrees value. + */ + public Float startAzimuthDegrees() { + return this.startAzimuthDegrees; + } + + /** + * Get the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees. + * + * @return the endAzimuthDegrees value. + */ + public Float endAzimuthDegrees() { + return this.endAzimuthDegrees; + } + + /** + * Get the startElevationDegrees property: Spacecraft elevation above the horizon at contact start. + * + * @return the startElevationDegrees value. + */ + public Float startElevationDegrees() { + return this.startElevationDegrees; + } + + /** + * Get the endElevationDegrees property: Spacecraft elevation above the horizon at contact end. + * + * @return the endElevationDegrees value. + */ + public Float endElevationDegrees() { + return this.endElevationDegrees; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileInner.java new file mode 100644 index 0000000000000..423b760f335e0 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileInner.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.AutoTrackingConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfileLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Customer creates a Contact Profile Resource, which will contain all of the configurations required for scheduling a + * contact. + */ +@Fluent +public final class ContactProfileInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfileInner.class); + + /* + * Properties of the spacecraft resource. + */ + @JsonProperty(value = "properties") + private ContactProfilesProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of the spacecraft resource. + * + * @return the innerProperties value. + */ + private ContactProfilesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. + * + * @return the minimumViableContactDuration value. + */ + public String minimumViableContactDuration() { + return this.innerProperties() == null ? null : this.innerProperties().minimumViableContactDuration(); + } + + /** + * Set the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. + * + * @param minimumViableContactDuration the minimumViableContactDuration value to set. + * @return the ContactProfileInner object itself. + */ + public ContactProfileInner withMinimumViableContactDuration(String minimumViableContactDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactProfilesProperties(); + } + this.innerProperties().withMinimumViableContactDuration(minimumViableContactDuration); + return this; + } + + /** + * Get the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. + * + * @return the minimumElevationDegrees value. + */ + public Float minimumElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().minimumElevationDegrees(); + } + + /** + * Set the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. + * + * @param minimumElevationDegrees the minimumElevationDegrees value to set. + * @return the ContactProfileInner object itself. + */ + public ContactProfileInner withMinimumElevationDegrees(Float minimumElevationDegrees) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactProfilesProperties(); + } + this.innerProperties().withMinimumElevationDegrees(minimumElevationDegrees); + return this; + } + + /** + * Get the autoTrackingConfiguration property: Auto track configuration. + * + * @return the autoTrackingConfiguration value. + */ + public AutoTrackingConfiguration autoTrackingConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().autoTrackingConfiguration(); + } + + /** + * Set the autoTrackingConfiguration property: Auto track configuration. + * + * @param autoTrackingConfiguration the autoTrackingConfiguration value to set. + * @return the ContactProfileInner object itself. + */ + public ContactProfileInner withAutoTrackingConfiguration(AutoTrackingConfiguration autoTrackingConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactProfilesProperties(); + } + this.innerProperties().withAutoTrackingConfiguration(autoTrackingConfiguration); + return this; + } + + /** + * Get the links property: Links of the Contact Profile. + * + * @return the links value. + */ + public List links() { + return this.innerProperties() == null ? null : this.innerProperties().links(); + } + + /** + * Set the links property: Links of the Contact Profile. + * + * @param links the links value to set. + * @return the ContactProfileInner object itself. + */ + public ContactProfileInner withLinks(List links) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactProfilesProperties(); + } + this.innerProperties().withLinks(links); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfilesProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfilesProperties.java new file mode 100644 index 0000000000000..b8d6f58ce4832 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfilesProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.AutoTrackingConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfileLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Contact Profile Resource Properties. */ +@Fluent +public final class ContactProfilesProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfilesProperties.class); + + /* + * Minimum viable contact duration in ISO 8601 format. + */ + @JsonProperty(value = "minimumViableContactDuration") + private String minimumViableContactDuration; + + /* + * Minimum viable elevation for the contact in decimal degrees. + */ + @JsonProperty(value = "minimumElevationDegrees") + private Float minimumElevationDegrees; + + /* + * Auto track configuration. + */ + @JsonProperty(value = "autoTrackingConfiguration") + private AutoTrackingConfiguration autoTrackingConfiguration; + + /* + * Links of the Contact Profile + */ + @JsonProperty(value = "links", required = true) + private List links; + + /** + * Get the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. + * + * @return the minimumViableContactDuration value. + */ + public String minimumViableContactDuration() { + return this.minimumViableContactDuration; + } + + /** + * Set the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. + * + * @param minimumViableContactDuration the minimumViableContactDuration value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withMinimumViableContactDuration(String minimumViableContactDuration) { + this.minimumViableContactDuration = minimumViableContactDuration; + return this; + } + + /** + * Get the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. + * + * @return the minimumElevationDegrees value. + */ + public Float minimumElevationDegrees() { + return this.minimumElevationDegrees; + } + + /** + * Set the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. + * + * @param minimumElevationDegrees the minimumElevationDegrees value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withMinimumElevationDegrees(Float minimumElevationDegrees) { + this.minimumElevationDegrees = minimumElevationDegrees; + return this; + } + + /** + * Get the autoTrackingConfiguration property: Auto track configuration. + * + * @return the autoTrackingConfiguration value. + */ + public AutoTrackingConfiguration autoTrackingConfiguration() { + return this.autoTrackingConfiguration; + } + + /** + * Set the autoTrackingConfiguration property: Auto track configuration. + * + * @param autoTrackingConfiguration the autoTrackingConfiguration value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withAutoTrackingConfiguration( + AutoTrackingConfiguration autoTrackingConfiguration) { + this.autoTrackingConfiguration = autoTrackingConfiguration; + return this; + } + + /** + * Get the links property: Links of the Contact Profile. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: Links of the Contact Profile. + * + * @param links the links value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withLinks(List links) { + this.links = links; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (links() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property links in model ContactProfilesProperties")); + } else { + links().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactsProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactsProperties.java new file mode 100644 index 0000000000000..05f2b6d92840f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactsProperties.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.ResourceReference; +import com.azure.resourcemanager.orbital.models.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of the Contact Resource. */ +@Fluent +public final class ContactsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactsProperties.class); + + /* + * Status of a contact. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * Reservation start time of a contact. + */ + @JsonProperty(value = "reservationStartTime", required = true) + private OffsetDateTime reservationStartTime; + + /* + * Reservation end time of a contact. + */ + @JsonProperty(value = "reservationEndTime", required = true) + private OffsetDateTime reservationEndTime; + + /* + * Receive start time of a contact. + */ + @JsonProperty(value = "rxStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxStartTime; + + /* + * Receive end time of a contact. + */ + @JsonProperty(value = "rxEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxEndTime; + + /* + * Transmit start time of a contact. + */ + @JsonProperty(value = "txStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txStartTime; + + /* + * Transmit end time of a contact. + */ + @JsonProperty(value = "txEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txEndTime; + + /* + * Any error message while scheduling a contact. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * Maximum elevation of the antenna during the contact in decimal degrees. + */ + @JsonProperty(value = "maximumElevationDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float maximumElevationDegrees; + + /* + * Azimuth of the antenna at the start of the contact in decimal degrees. + */ + @JsonProperty(value = "startAzimuthDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float startAzimuthDegrees; + + /* + * Azimuth of the antenna at the end of the contact in decimal degrees. + */ + @JsonProperty(value = "endAzimuthDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float endAzimuthDegrees; + + /* + * Azure Ground Station name. + */ + @JsonProperty(value = "groundStationName", required = true) + private String groundStationName; + + /* + * Spacecraft elevation above the horizon at contact start. + */ + @JsonProperty(value = "startElevationDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float startElevationDegrees; + + /* + * Spacecraft elevation above the horizon at contact end. + */ + @JsonProperty(value = "endElevationDegrees", access = JsonProperty.Access.WRITE_ONLY) + private Float endElevationDegrees; + + /* + * The reference to the contact profile resource. + */ + @JsonProperty(value = "contactProfile", required = true) + private ResourceReference contactProfile; + + /** + * Get the status property: Status of a contact. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the reservationStartTime property: Reservation start time of a contact. + * + * @return the reservationStartTime value. + */ + public OffsetDateTime reservationStartTime() { + return this.reservationStartTime; + } + + /** + * Set the reservationStartTime property: Reservation start time of a contact. + * + * @param reservationStartTime the reservationStartTime value to set. + * @return the ContactsProperties object itself. + */ + public ContactsProperties withReservationStartTime(OffsetDateTime reservationStartTime) { + this.reservationStartTime = reservationStartTime; + return this; + } + + /** + * Get the reservationEndTime property: Reservation end time of a contact. + * + * @return the reservationEndTime value. + */ + public OffsetDateTime reservationEndTime() { + return this.reservationEndTime; + } + + /** + * Set the reservationEndTime property: Reservation end time of a contact. + * + * @param reservationEndTime the reservationEndTime value to set. + * @return the ContactsProperties object itself. + */ + public ContactsProperties withReservationEndTime(OffsetDateTime reservationEndTime) { + this.reservationEndTime = reservationEndTime; + return this; + } + + /** + * Get the rxStartTime property: Receive start time of a contact. + * + * @return the rxStartTime value. + */ + public OffsetDateTime rxStartTime() { + return this.rxStartTime; + } + + /** + * Get the rxEndTime property: Receive end time of a contact. + * + * @return the rxEndTime value. + */ + public OffsetDateTime rxEndTime() { + return this.rxEndTime; + } + + /** + * Get the txStartTime property: Transmit start time of a contact. + * + * @return the txStartTime value. + */ + public OffsetDateTime txStartTime() { + return this.txStartTime; + } + + /** + * Get the txEndTime property: Transmit end time of a contact. + * + * @return the txEndTime value. + */ + public OffsetDateTime txEndTime() { + return this.txEndTime; + } + + /** + * Get the errorMessage property: Any error message while scheduling a contact. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal degrees. + * + * @return the maximumElevationDegrees value. + */ + public Float maximumElevationDegrees() { + return this.maximumElevationDegrees; + } + + /** + * Get the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees. + * + * @return the startAzimuthDegrees value. + */ + public Float startAzimuthDegrees() { + return this.startAzimuthDegrees; + } + + /** + * Get the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees. + * + * @return the endAzimuthDegrees value. + */ + public Float endAzimuthDegrees() { + return this.endAzimuthDegrees; + } + + /** + * Get the groundStationName property: Azure Ground Station name. + * + * @return the groundStationName value. + */ + public String groundStationName() { + return this.groundStationName; + } + + /** + * Set the groundStationName property: Azure Ground Station name. + * + * @param groundStationName the groundStationName value to set. + * @return the ContactsProperties object itself. + */ + public ContactsProperties withGroundStationName(String groundStationName) { + this.groundStationName = groundStationName; + return this; + } + + /** + * Get the startElevationDegrees property: Spacecraft elevation above the horizon at contact start. + * + * @return the startElevationDegrees value. + */ + public Float startElevationDegrees() { + return this.startElevationDegrees; + } + + /** + * Get the endElevationDegrees property: Spacecraft elevation above the horizon at contact end. + * + * @return the endElevationDegrees value. + */ + public Float endElevationDegrees() { + return this.endElevationDegrees; + } + + /** + * Get the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + public ResourceReference contactProfile() { + return this.contactProfile; + } + + /** + * Set the contactProfile property: The reference to the contact profile resource. + * + * @param contactProfile the contactProfile value to set. + * @return the ContactsProperties object itself. + */ + public ContactsProperties withContactProfile(ResourceReference contactProfile) { + this.contactProfile = contactProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (reservationStartTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reservationStartTime in model ContactsProperties")); + } + if (reservationEndTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reservationEndTime in model ContactsProperties")); + } + if (groundStationName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property groundStationName in model ContactsProperties")); + } + if (contactProfile() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contactProfile in model ContactsProperties")); + } else { + contactProfile().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..312342392c4d8 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.ActionType; +import com.azure.resourcemanager.orbital.models.OperationDisplay; +import com.azure.resourcemanager.orbital.models.Origin; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftInner.java new file mode 100644 index 0000000000000..a48c0aafbc541 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftInner.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.AuthorizationStatus; +import com.azure.resourcemanager.orbital.models.SpacecraftLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Customer creates a spacecraft resource to schedule a contact. */ +@Fluent +public final class SpacecraftInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SpacecraftInner.class); + + /* + * Spacecraft Properties + */ + @JsonProperty(value = "properties") + private SpacecraftsProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the innerProperties property: Spacecraft Properties. + * + * @return the innerProperties value. + */ + private SpacecraftsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public SpacecraftInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SpacecraftInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the noradId property: NORAD ID of the spacecraft. + * + * @return the noradId value. + */ + public String noradId() { + return this.innerProperties() == null ? null : this.innerProperties().noradId(); + } + + /** + * Set the noradId property: NORAD ID of the spacecraft. + * + * @param noradId the noradId value to set. + * @return the SpacecraftInner object itself. + */ + public SpacecraftInner withNoradId(String noradId) { + if (this.innerProperties() == null) { + this.innerProperties = new SpacecraftsProperties(); + } + this.innerProperties().withNoradId(noradId); + return this; + } + + /** + * Get the authorizationStatus property: Authorization status of spacecraft. + * + * @return the authorizationStatus value. + */ + public AuthorizationStatus authorizationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationStatus(); + } + + /** + * Get the authorizationStatusExtended property: Details of the authorization status. + * + * @return the authorizationStatusExtended value. + */ + public String authorizationStatusExtended() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationStatusExtended(); + } + + /** + * Get the titleLine property: Title line of Two Line Element (TLE). + * + * @return the titleLine value. + */ + public String titleLine() { + return this.innerProperties() == null ? null : this.innerProperties().titleLine(); + } + + /** + * Set the titleLine property: Title line of Two Line Element (TLE). + * + * @param titleLine the titleLine value to set. + * @return the SpacecraftInner object itself. + */ + public SpacecraftInner withTitleLine(String titleLine) { + if (this.innerProperties() == null) { + this.innerProperties = new SpacecraftsProperties(); + } + this.innerProperties().withTitleLine(titleLine); + return this; + } + + /** + * Get the tleLine1 property: Line 1 of Two Line Element (TLE). + * + * @return the tleLine1 value. + */ + public String tleLine1() { + return this.innerProperties() == null ? null : this.innerProperties().tleLine1(); + } + + /** + * Set the tleLine1 property: Line 1 of Two Line Element (TLE). + * + * @param tleLine1 the tleLine1 value to set. + * @return the SpacecraftInner object itself. + */ + public SpacecraftInner withTleLine1(String tleLine1) { + if (this.innerProperties() == null) { + this.innerProperties = new SpacecraftsProperties(); + } + this.innerProperties().withTleLine1(tleLine1); + return this; + } + + /** + * Get the tleLine2 property: Line 2 of Two Line Element (TLE). + * + * @return the tleLine2 value. + */ + public String tleLine2() { + return this.innerProperties() == null ? null : this.innerProperties().tleLine2(); + } + + /** + * Set the tleLine2 property: Line 2 of Two Line Element (TLE). + * + * @param tleLine2 the tleLine2 value to set. + * @return the SpacecraftInner object itself. + */ + public SpacecraftInner withTleLine2(String tleLine2) { + if (this.innerProperties() == null) { + this.innerProperties = new SpacecraftsProperties(); + } + this.innerProperties().withTleLine2(tleLine2); + return this; + } + + /** + * Get the links property: Links of the Spacecraft. + * + * @return the links value. + */ + public List links() { + return this.innerProperties() == null ? null : this.innerProperties().links(); + } + + /** + * Set the links property: Links of the Spacecraft. + * + * @param links the links value to set. + * @return the SpacecraftInner object itself. + */ + public SpacecraftInner withLinks(List links) { + if (this.innerProperties() == null) { + this.innerProperties = new SpacecraftsProperties(); + } + this.innerProperties().withLinks(links); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftsProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftsProperties.java new file mode 100644 index 0000000000000..c7abe5af22b1e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftsProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.models.AuthorizationStatus; +import com.azure.resourcemanager.orbital.models.SpacecraftLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Spacecraft Resource Properties. */ +@Fluent +public final class SpacecraftsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SpacecraftsProperties.class); + + /* + * NORAD ID of the spacecraft. + */ + @JsonProperty(value = "noradId", required = true) + private String noradId; + + /* + * Authorization status of spacecraft. + */ + @JsonProperty(value = "authorizationStatus", access = JsonProperty.Access.WRITE_ONLY) + private AuthorizationStatus authorizationStatus; + + /* + * Details of the authorization status. + */ + @JsonProperty(value = "authorizationStatusExtended", access = JsonProperty.Access.WRITE_ONLY) + private String authorizationStatusExtended; + + /* + * Title line of Two Line Element (TLE). + */ + @JsonProperty(value = "titleLine") + private String titleLine; + + /* + * Line 1 of Two Line Element (TLE). + */ + @JsonProperty(value = "tleLine1") + private String tleLine1; + + /* + * Line 2 of Two Line Element (TLE). + */ + @JsonProperty(value = "tleLine2") + private String tleLine2; + + /* + * Links of the Spacecraft + */ + @JsonProperty(value = "links") + private List links; + + /** + * Get the noradId property: NORAD ID of the spacecraft. + * + * @return the noradId value. + */ + public String noradId() { + return this.noradId; + } + + /** + * Set the noradId property: NORAD ID of the spacecraft. + * + * @param noradId the noradId value to set. + * @return the SpacecraftsProperties object itself. + */ + public SpacecraftsProperties withNoradId(String noradId) { + this.noradId = noradId; + return this; + } + + /** + * Get the authorizationStatus property: Authorization status of spacecraft. + * + * @return the authorizationStatus value. + */ + public AuthorizationStatus authorizationStatus() { + return this.authorizationStatus; + } + + /** + * Get the authorizationStatusExtended property: Details of the authorization status. + * + * @return the authorizationStatusExtended value. + */ + public String authorizationStatusExtended() { + return this.authorizationStatusExtended; + } + + /** + * Get the titleLine property: Title line of Two Line Element (TLE). + * + * @return the titleLine value. + */ + public String titleLine() { + return this.titleLine; + } + + /** + * Set the titleLine property: Title line of Two Line Element (TLE). + * + * @param titleLine the titleLine value to set. + * @return the SpacecraftsProperties object itself. + */ + public SpacecraftsProperties withTitleLine(String titleLine) { + this.titleLine = titleLine; + return this; + } + + /** + * Get the tleLine1 property: Line 1 of Two Line Element (TLE). + * + * @return the tleLine1 value. + */ + public String tleLine1() { + return this.tleLine1; + } + + /** + * Set the tleLine1 property: Line 1 of Two Line Element (TLE). + * + * @param tleLine1 the tleLine1 value to set. + * @return the SpacecraftsProperties object itself. + */ + public SpacecraftsProperties withTleLine1(String tleLine1) { + this.tleLine1 = tleLine1; + return this; + } + + /** + * Get the tleLine2 property: Line 2 of Two Line Element (TLE). + * + * @return the tleLine2 value. + */ + public String tleLine2() { + return this.tleLine2; + } + + /** + * Set the tleLine2 property: Line 2 of Two Line Element (TLE). + * + * @param tleLine2 the tleLine2 value to set. + * @return the SpacecraftsProperties object itself. + */ + public SpacecraftsProperties withTleLine2(String tleLine2) { + this.tleLine2 = tleLine2; + return this; + } + + /** + * Get the links property: Links of the Spacecraft. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: Links of the Spacecraft. + * + * @param links the links value to set. + * @return the SpacecraftsProperties object itself. + */ + public SpacecraftsProperties withLinks(List links) { + this.links = links; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (noradId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property noradId in model SpacecraftsProperties")); + } + if (links() != null) { + links().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/package-info.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/package-info.java new file mode 100644 index 0000000000000..faed02c3a7178 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for AzureOrbital. Azure Orbital service. */ +package com.azure.resourcemanager.orbital.fluent.models; diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/package-info.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/package-info.java new file mode 100644 index 0000000000000..dfe01db0b1bee --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for AzureOrbital. Azure Orbital service. */ +package com.azure.resourcemanager.orbital.fluent; diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableContactsListResultImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableContactsListResultImpl.java new file mode 100644 index 0000000000000..b47c665a18892 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableContactsListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsListResultInner; +import com.azure.resourcemanager.orbital.models.AvailableContacts; +import com.azure.resourcemanager.orbital.models.AvailableContactsListResult; +import java.util.Collections; +import java.util.List; + +public final class AvailableContactsListResultImpl implements AvailableContactsListResult { + private AvailableContactsListResultInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + AvailableContactsListResultImpl( + AvailableContactsListResultInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public AvailableContactsListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationImpl.java new file mode 100644 index 0000000000000..52429a50676bb --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; +import com.azure.resourcemanager.orbital.models.AvailableGroundStation; + +public final class AvailableGroundStationImpl implements AvailableGroundStation { + private AvailableGroundStationInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + AvailableGroundStationImpl( + AvailableGroundStationInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public String type() { + return this.innerModel().type(); + } + + public String city() { + return this.innerModel().city(); + } + + public String providerName() { + return this.innerModel().providerName(); + } + + public Float longitudeDegrees() { + return this.innerModel().longitudeDegrees(); + } + + public Float latitudeDegrees() { + return this.innerModel().latitudeDegrees(); + } + + public Float altitudeMeters() { + return this.innerModel().altitudeMeters(); + } + + public AvailableGroundStationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsClientImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsClientImpl.java new file mode 100644 index 0000000000000..0482a23902a29 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsClientImpl.java @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.AvailableGroundStationsClient; +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; +import com.azure.resourcemanager.orbital.models.AvailableGroundStationListResult; +import com.azure.resourcemanager.orbital.models.AvailableGroundStationsCapability; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableGroundStationsClient. */ +public final class AvailableGroundStationsClientImpl implements AvailableGroundStationsClient { + private final ClientLogger logger = new ClientLogger(AvailableGroundStationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableGroundStationsService service; + + /** The service client containing this operation class. */ + private final AzureOrbitalImpl client; + + /** + * Initializes an instance of AvailableGroundStationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableGroundStationsClientImpl(AzureOrbitalImpl client) { + this.service = + RestProxy + .create(AvailableGroundStationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureOrbitalAvailableGroundStations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureOrbitalAvailabl") + private interface AvailableGroundStationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/availableGroundStations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("capability") AvailableGroundStationsCapability capability, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/availableGroundStations/{groundStationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groundStationName") String groundStationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCapabilityNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + AvailableGroundStationsCapability capability) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (capability == null) { + return Mono.error(new IllegalArgumentException("Parameter capability is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + capability, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + AvailableGroundStationsCapability capability, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (capability == null) { + return Mono.error(new IllegalArgumentException("Parameter capability is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + capability, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(AvailableGroundStationsCapability capability) { + return new PagedFlux<>( + () -> listSinglePageAsync(capability), nextLink -> listByCapabilityNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + AvailableGroundStationsCapability capability, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(capability, context), + nextLink -> listByCapabilityNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(AvailableGroundStationsCapability capability) { + return new PagedIterable<>(listAsync(capability)); + } + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + AvailableGroundStationsCapability capability, Context context) { + return new PagedIterable<>(listAsync(capability, context)); + } + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groundStationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groundStationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter groundStationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groundStationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groundStationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groundStationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter groundStationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groundStationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groundStationName) { + return getWithResponseAsync(groundStationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableGroundStationInner get(String groundStationName) { + return getAsync(groundStationName).block(); + } + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String groundStationName, Context context) { + return getWithResponseAsync(groundStationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapabilityNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByCapabilityNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCapabilityNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCapabilityNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsImpl.java new file mode 100644 index 0000000000000..5540e7d15ea23 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.AvailableGroundStationsClient; +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; +import com.azure.resourcemanager.orbital.models.AvailableGroundStation; +import com.azure.resourcemanager.orbital.models.AvailableGroundStations; +import com.azure.resourcemanager.orbital.models.AvailableGroundStationsCapability; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableGroundStationsImpl implements AvailableGroundStations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableGroundStationsImpl.class); + + private final AvailableGroundStationsClient innerClient; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public AvailableGroundStationsImpl( + AvailableGroundStationsClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(AvailableGroundStationsCapability capability) { + PagedIterable inner = this.serviceClient().list(capability); + return Utils.mapPage(inner, inner1 -> new AvailableGroundStationImpl(inner1, this.manager())); + } + + public PagedIterable list(AvailableGroundStationsCapability capability, Context context) { + PagedIterable inner = this.serviceClient().list(capability, context); + return Utils.mapPage(inner, inner1 -> new AvailableGroundStationImpl(inner1, this.manager())); + } + + public AvailableGroundStation get(String groundStationName) { + AvailableGroundStationInner inner = this.serviceClient().get(groundStationName); + if (inner != null) { + return new AvailableGroundStationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String groundStationName, Context context) { + Response inner = this.serviceClient().getWithResponse(groundStationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AvailableGroundStationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AvailableGroundStationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalBuilder.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalBuilder.java new file mode 100644 index 0000000000000..2aafceb9242dd --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the AzureOrbitalImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureOrbitalImpl.class}) +public final class AzureOrbitalBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureOrbitalBuilder. + */ + public AzureOrbitalBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureOrbitalBuilder. + */ + public AzureOrbitalBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AzureOrbitalBuilder. + */ + public AzureOrbitalBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AzureOrbitalBuilder. + */ + public AzureOrbitalBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureOrbitalBuilder. + */ + public AzureOrbitalBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureOrbitalBuilder. + */ + public AzureOrbitalBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureOrbitalImpl with the provided parameters. + * + * @return an instance of AzureOrbitalImpl. + */ + public AzureOrbitalImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + AzureOrbitalImpl client = + new AzureOrbitalImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalImpl.java new file mode 100644 index 0000000000000..d865beee51907 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalImpl.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.orbital.fluent.AvailableGroundStationsClient; +import com.azure.resourcemanager.orbital.fluent.AzureOrbital; +import com.azure.resourcemanager.orbital.fluent.ContactProfilesClient; +import com.azure.resourcemanager.orbital.fluent.ContactsClient; +import com.azure.resourcemanager.orbital.fluent.OperationsClient; +import com.azure.resourcemanager.orbital.fluent.SpacecraftsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AzureOrbitalImpl type. */ +@ServiceClient(builder = AzureOrbitalBuilder.class) +public final class AzureOrbitalImpl implements AzureOrbital { + private final ClientLogger logger = new ClientLogger(AzureOrbitalImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SpacecraftsClient object to access its operations. */ + private final SpacecraftsClient spacecrafts; + + /** + * Gets the SpacecraftsClient object to access its operations. + * + * @return the SpacecraftsClient object. + */ + public SpacecraftsClient getSpacecrafts() { + return this.spacecrafts; + } + + /** The ContactsClient object to access its operations. */ + private final ContactsClient contacts; + + /** + * Gets the ContactsClient object to access its operations. + * + * @return the ContactsClient object. + */ + public ContactsClient getContacts() { + return this.contacts; + } + + /** The ContactProfilesClient object to access its operations. */ + private final ContactProfilesClient contactProfiles; + + /** + * Gets the ContactProfilesClient object to access its operations. + * + * @return the ContactProfilesClient object. + */ + public ContactProfilesClient getContactProfiles() { + return this.contactProfiles; + } + + /** The AvailableGroundStationsClient object to access its operations. */ + private final AvailableGroundStationsClient availableGroundStations; + + /** + * Gets the AvailableGroundStationsClient object to access its operations. + * + * @return the AvailableGroundStationsClient object. + */ + public AvailableGroundStationsClient getAvailableGroundStations() { + return this.availableGroundStations; + } + + /** + * Initializes an instance of AzureOrbital client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + AzureOrbitalImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-04-04-preview"; + this.operations = new OperationsClientImpl(this); + this.spacecrafts = new SpacecraftsClientImpl(this); + this.contacts = new ContactsClientImpl(this); + this.contactProfiles = new ContactProfilesClientImpl(this); + this.availableGroundStations = new AvailableGroundStationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactImpl.java new file mode 100644 index 0000000000000..b71eca0c2214a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; +import com.azure.resourcemanager.orbital.models.Contact; +import com.azure.resourcemanager.orbital.models.ResourceReference; +import com.azure.resourcemanager.orbital.models.Status; +import java.time.OffsetDateTime; + +public final class ContactImpl implements Contact, Contact.Definition { + private ContactInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + ContactImpl(ContactInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Status status() { + return this.innerModel().status(); + } + + public OffsetDateTime reservationStartTime() { + return this.innerModel().reservationStartTime(); + } + + public OffsetDateTime reservationEndTime() { + return this.innerModel().reservationEndTime(); + } + + public OffsetDateTime rxStartTime() { + return this.innerModel().rxStartTime(); + } + + public OffsetDateTime rxEndTime() { + return this.innerModel().rxEndTime(); + } + + public OffsetDateTime txStartTime() { + return this.innerModel().txStartTime(); + } + + public OffsetDateTime txEndTime() { + return this.innerModel().txEndTime(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public Float maximumElevationDegrees() { + return this.innerModel().maximumElevationDegrees(); + } + + public Float startAzimuthDegrees() { + return this.innerModel().startAzimuthDegrees(); + } + + public Float endAzimuthDegrees() { + return this.innerModel().endAzimuthDegrees(); + } + + public String groundStationName() { + return this.innerModel().groundStationName(); + } + + public Float startElevationDegrees() { + return this.innerModel().startElevationDegrees(); + } + + public Float endElevationDegrees() { + return this.innerModel().endElevationDegrees(); + } + + public ResourceReference contactProfile() { + return this.innerModel().contactProfile(); + } + + public ContactInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String spacecraftName; + + private String contactName; + + public ContactImpl withExistingSpacecraft(String resourceGroupName, String spacecraftName) { + this.resourceGroupName = resourceGroupName; + this.spacecraftName = spacecraftName; + return this; + } + + public Contact create() { + this.innerObject = + serviceManager + .serviceClient() + .getContacts() + .create(resourceGroupName, spacecraftName, contactName, this.innerModel(), Context.NONE); + return this; + } + + public Contact create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContacts() + .create(resourceGroupName, spacecraftName, contactName, this.innerModel(), context); + return this; + } + + ContactImpl(String name, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = new ContactInner(); + this.serviceManager = serviceManager; + this.contactName = name; + } + + public Contact refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContacts() + .getWithResponse(resourceGroupName, spacecraftName, contactName, Context.NONE) + .getValue(); + return this; + } + + public Contact refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContacts() + .getWithResponse(resourceGroupName, spacecraftName, contactName, context) + .getValue(); + return this; + } + + public ContactImpl withReservationStartTime(OffsetDateTime reservationStartTime) { + this.innerModel().withReservationStartTime(reservationStartTime); + return this; + } + + public ContactImpl withReservationEndTime(OffsetDateTime reservationEndTime) { + this.innerModel().withReservationEndTime(reservationEndTime); + return this; + } + + public ContactImpl withGroundStationName(String groundStationName) { + this.innerModel().withGroundStationName(groundStationName); + return this; + } + + public ContactImpl withContactProfile(ResourceReference contactProfile) { + this.innerModel().withContactProfile(contactProfile); + return this; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfileImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfileImpl.java new file mode 100644 index 0000000000000..6387b7e3f3da8 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfileImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import com.azure.resourcemanager.orbital.models.AutoTrackingConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfile; +import com.azure.resourcemanager.orbital.models.ContactProfileLink; +import com.azure.resourcemanager.orbital.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ContactProfileImpl implements ContactProfile, ContactProfile.Definition, ContactProfile.Update { + private ContactProfileInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String minimumViableContactDuration() { + return this.innerModel().minimumViableContactDuration(); + } + + public Float minimumElevationDegrees() { + return this.innerModel().minimumElevationDegrees(); + } + + public AutoTrackingConfiguration autoTrackingConfiguration() { + return this.innerModel().autoTrackingConfiguration(); + } + + public List links() { + List inner = this.innerModel().links(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ContactProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String contactProfileName; + + private TagsObject updateParameters; + + public ContactProfileImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContactProfile create() { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .createOrUpdate(resourceGroupName, contactProfileName, this.innerModel(), Context.NONE); + return this; + } + + public ContactProfile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .createOrUpdate(resourceGroupName, contactProfileName, this.innerModel(), context); + return this; + } + + ContactProfileImpl(String name, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = new ContactProfileInner(); + this.serviceManager = serviceManager; + this.contactProfileName = name; + } + + public ContactProfileImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ContactProfile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .updateTagsWithResponse(resourceGroupName, contactProfileName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ContactProfile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .updateTagsWithResponse(resourceGroupName, contactProfileName, updateParameters, context) + .getValue(); + return this; + } + + ContactProfileImpl( + ContactProfileInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.contactProfileName = Utils.getValueFromIdByName(innerObject.id(), "contactProfiles"); + } + + public ContactProfile refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .getByResourceGroupWithResponse(resourceGroupName, contactProfileName, Context.NONE) + .getValue(); + return this; + } + + public ContactProfile refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .getByResourceGroupWithResponse(resourceGroupName, contactProfileName, context) + .getValue(); + return this; + } + + public ContactProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContactProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContactProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ContactProfileImpl withMinimumViableContactDuration(String minimumViableContactDuration) { + this.innerModel().withMinimumViableContactDuration(minimumViableContactDuration); + return this; + } + + public ContactProfileImpl withMinimumElevationDegrees(Float minimumElevationDegrees) { + this.innerModel().withMinimumElevationDegrees(minimumElevationDegrees); + return this; + } + + public ContactProfileImpl withAutoTrackingConfiguration(AutoTrackingConfiguration autoTrackingConfiguration) { + this.innerModel().withAutoTrackingConfiguration(autoTrackingConfiguration); + return this; + } + + public ContactProfileImpl withLinks(List links) { + this.innerModel().withLinks(links); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesClientImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesClientImpl.java new file mode 100644 index 0000000000000..048a71e668098 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesClientImpl.java @@ -0,0 +1,1272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.ContactProfilesClient; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import com.azure.resourcemanager.orbital.models.ContactProfileListResult; +import com.azure.resourcemanager.orbital.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContactProfilesClient. */ +public final class ContactProfilesClientImpl implements ContactProfilesClient { + private final ClientLogger logger = new ClientLogger(ContactProfilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContactProfilesService service; + + /** The service client containing this operation class. */ + private final AzureOrbitalImpl client; + + /** + * Initializes an instance of ContactProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContactProfilesClientImpl(AzureOrbitalImpl client) { + this.service = + RestProxy.create(ContactProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureOrbitalContactProfiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureOrbitalContactP") + private interface ContactProfilesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital" + + "/contactProfiles/{contactProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("contactProfileName") String contactProfileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital" + + "/contactProfiles/{contactProfileName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("contactProfileName") String contactProfileName, + @BodyParam("application/json") ContactProfileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital" + + "/contactProfiles/{contactProfileName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("contactProfileName") String contactProfileName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital" + + "/contactProfiles/{contactProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("contactProfileName") String contactProfileName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/contactProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital" + + "/contactProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String contactProfileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + contactProfileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String contactProfileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + contactProfileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String contactProfileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, contactProfileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactProfileInner getByResourceGroup(String resourceGroupName, String contactProfileName) { + return getByResourceGroupAsync(resourceGroupName, contactProfileName).block(); + } + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String contactProfileName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, contactProfileName, context).block(); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + contactProfileName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + contactProfileName, + parameters, + accept, + context); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContactProfileInner> beginCreateOrUpdateAsync( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, contactProfileName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContactProfileInner.class, + ContactProfileInner.class, + Context.NONE); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContactProfileInner> beginCreateOrUpdateAsync( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, contactProfileName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContactProfileInner.class, ContactProfileInner.class, context); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContactProfileInner> beginCreateOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, contactProfileName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContactProfileInner> beginCreateOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, contactProfileName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, contactProfileName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, contactProfileName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactProfileInner createOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters) { + return createOrUpdateAsync(resourceGroupName, contactProfileName, parameters).block(); + } + + /** + * Creates or updates a contact profile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters The parameters to provide for the created Contact Profile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactProfileInner createOrUpdate( + String resourceGroupName, String contactProfileName, ContactProfileInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, contactProfileName, parameters, context).block(); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String contactProfileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + contactProfileName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String contactProfileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + contactProfileName, + accept, + context); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String contactProfileName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, contactProfileName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String contactProfileName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, contactProfileName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String contactProfileName) { + return beginDeleteAsync(resourceGroupName, contactProfileName).getSyncPoller(); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String contactProfileName, Context context) { + return beginDeleteAsync(resourceGroupName, contactProfileName, context).getSyncPoller(); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String contactProfileName) { + return beginDeleteAsync(resourceGroupName, contactProfileName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String contactProfileName, Context context) { + return beginDeleteAsync(resourceGroupName, contactProfileName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String contactProfileName) { + deleteAsync(resourceGroupName, contactProfileName).block(); + } + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String contactProfileName, Context context) { + deleteAsync(resourceGroupName, contactProfileName, context).block(); + } + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + contactProfileName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (contactProfileName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contactProfileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + contactProfileName, + parameters, + accept, + context); + } + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, contactProfileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactProfileInner updateTags(String resourceGroupName, String contactProfileName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, contactProfileName, parameters).block(); + } + + /** + * Updates the specified contact profile tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param parameters Parameters supplied to update contact profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a Contact Profile Resource, which will contain all of the configurations required for + * scheduling a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, contactProfileName, parameters, context).block(); + } + + /** + * Returns list of contact profiles. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns list of contact profiles. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns list of contact profiles. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Returns list of contact profiles. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Returns list of contact profiles. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns list of contact profiles. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesImpl.java new file mode 100644 index 0000000000000..ffb4871529b1e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.ContactProfilesClient; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import com.azure.resourcemanager.orbital.models.ContactProfile; +import com.azure.resourcemanager.orbital.models.ContactProfiles; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContactProfilesImpl implements ContactProfiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfilesImpl.class); + + private final ContactProfilesClient innerClient; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public ContactProfilesImpl( + ContactProfilesClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ContactProfile getByResourceGroup(String resourceGroupName, String contactProfileName) { + ContactProfileInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, contactProfileName); + if (inner != null) { + return new ContactProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String contactProfileName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, contactProfileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContactProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String contactProfileName) { + this.serviceClient().delete(resourceGroupName, contactProfileName); + } + + public void delete(String resourceGroupName, String contactProfileName, Context context) { + this.serviceClient().delete(resourceGroupName, contactProfileName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ContactProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ContactProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ContactProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ContactProfileImpl(inner1, this.manager())); + } + + public ContactProfile getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String contactProfileName = Utils.getValueFromIdByName(id, "contactProfiles"); + if (contactProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'contactProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, contactProfileName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String contactProfileName = Utils.getValueFromIdByName(id, "contactProfiles"); + if (contactProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'contactProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, contactProfileName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String contactProfileName = Utils.getValueFromIdByName(id, "contactProfiles"); + if (contactProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'contactProfiles'.", id))); + } + this.delete(resourceGroupName, contactProfileName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String contactProfileName = Utils.getValueFromIdByName(id, "contactProfiles"); + if (contactProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'contactProfiles'.", id))); + } + this.delete(resourceGroupName, contactProfileName, context); + } + + private ContactProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } + + public ContactProfileImpl define(String name) { + return new ContactProfileImpl(name, this.manager()); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsClientImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsClientImpl.java new file mode 100644 index 0000000000000..4d8994f06da34 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsClientImpl.java @@ -0,0 +1,990 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.ContactsClient; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; +import com.azure.resourcemanager.orbital.models.ContactListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContactsClient. */ +public final class ContactsClientImpl implements ContactsClient { + private final ClientLogger logger = new ClientLogger(ContactsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContactsService service; + + /** The service client containing this operation class. */ + private final AzureOrbitalImpl client; + + /** + * Initializes an instance of ContactsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContactsClientImpl(AzureOrbitalImpl client) { + this.service = RestProxy.create(ContactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureOrbitalContacts to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureOrbitalContacts") + private interface ContactsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}/contacts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}/contacts/{contactName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("spacecraftName") String spacecraftName, + @PathParam("contactName") String contactName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}/contacts/{contactName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("spacecraftName") String spacecraftName, + @PathParam("contactName") String contactName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContactInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}/contacts/{contactName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("spacecraftName") String spacecraftName, + @PathParam("contactName") String contactName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String spacecraftName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String spacecraftName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String spacecraftName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, spacecraftName)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String spacecraftName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, spacecraftName, context)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String spacecraftName) { + return new PagedIterable<>(listAsync(resourceGroupName, spacecraftName)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String spacecraftName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, spacecraftName, context)); + } + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String spacecraftName, String contactName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (contactName == null) { + return Mono.error(new IllegalArgumentException("Parameter contactName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + contactName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (contactName == null) { + return Mono.error(new IllegalArgumentException("Parameter contactName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + contactName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String spacecraftName, String contactName) { + return getWithResponseAsync(resourceGroupName, spacecraftName, contactName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactInner get(String resourceGroupName, String spacecraftName, String contactName) { + return getAsync(resourceGroupName, spacecraftName, contactName).block(); + } + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + return getWithResponseAsync(resourceGroupName, spacecraftName, contactName, context).block(); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (contactName == null) { + return Mono.error(new IllegalArgumentException("Parameter contactName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + contactName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (contactName == null) { + return Mono.error(new IllegalArgumentException("Parameter contactName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + contactName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContactInner> beginCreateAsync( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, spacecraftName, contactName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContactInner.class, ContactInner.class, Context.NONE); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContactInner> beginCreateAsync( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, spacecraftName, contactName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContactInner.class, ContactInner.class, context); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContactInner> beginCreate( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters) { + return beginCreateAsync(resourceGroupName, spacecraftName, contactName, parameters).getSyncPoller(); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContactInner> beginCreate( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, spacecraftName, contactName, parameters, context).getSyncPoller(); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters) { + return beginCreateAsync(resourceGroupName, spacecraftName, contactName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, spacecraftName, contactName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactInner create( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters) { + return createAsync(resourceGroupName, spacecraftName, contactName, parameters).block(); + } + + /** + * Creates a contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param parameters The parameters to provide for the created contact. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a contact resource for a spacecraft resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContactInner create( + String resourceGroupName, String spacecraftName, String contactName, ContactInner parameters, Context context) { + return createAsync(resourceGroupName, spacecraftName, contactName, parameters, context).block(); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String spacecraftName, String contactName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (contactName == null) { + return Mono.error(new IllegalArgumentException("Parameter contactName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + contactName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (contactName == null) { + return Mono.error(new IllegalArgumentException("Parameter contactName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + contactName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String spacecraftName, String contactName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, spacecraftName, contactName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, spacecraftName, contactName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String spacecraftName, String contactName) { + return beginDeleteAsync(resourceGroupName, spacecraftName, contactName).getSyncPoller(); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + return beginDeleteAsync(resourceGroupName, spacecraftName, contactName, context).getSyncPoller(); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String spacecraftName, String contactName) { + return beginDeleteAsync(resourceGroupName, spacecraftName, contactName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + return beginDeleteAsync(resourceGroupName, spacecraftName, contactName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String spacecraftName, String contactName) { + deleteAsync(resourceGroupName, spacecraftName, contactName).block(); + } + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String spacecraftName, String contactName, Context context) { + deleteAsync(resourceGroupName, spacecraftName, contactName, context).block(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsImpl.java new file mode 100644 index 0000000000000..e4c698a548f4b --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.ContactsClient; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; +import com.azure.resourcemanager.orbital.models.Contact; +import com.azure.resourcemanager.orbital.models.Contacts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContactsImpl implements Contacts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactsImpl.class); + + private final ContactsClient innerClient; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public ContactsImpl(ContactsClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String spacecraftName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, spacecraftName); + return Utils.mapPage(inner, inner1 -> new ContactImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String spacecraftName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, spacecraftName, context); + return Utils.mapPage(inner, inner1 -> new ContactImpl(inner1, this.manager())); + } + + public Contact get(String resourceGroupName, String spacecraftName, String contactName) { + ContactInner inner = this.serviceClient().get(resourceGroupName, spacecraftName, contactName); + if (inner != null) { + return new ContactImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String spacecraftName, String contactName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, spacecraftName, contactName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContactImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String spacecraftName, String contactName) { + this.serviceClient().delete(resourceGroupName, spacecraftName, contactName); + } + + public void delete(String resourceGroupName, String spacecraftName, String contactName, Context context) { + this.serviceClient().delete(resourceGroupName, spacecraftName, contactName, context); + } + + public Contact getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + String contactName = Utils.getValueFromIdByName(id, "contacts"); + if (contactName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contacts'.", id))); + } + return this.getWithResponse(resourceGroupName, spacecraftName, contactName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + String contactName = Utils.getValueFromIdByName(id, "contacts"); + if (contactName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contacts'.", id))); + } + return this.getWithResponse(resourceGroupName, spacecraftName, contactName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + String contactName = Utils.getValueFromIdByName(id, "contacts"); + if (contactName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contacts'.", id))); + } + this.delete(resourceGroupName, spacecraftName, contactName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + String contactName = Utils.getValueFromIdByName(id, "contacts"); + if (contactName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contacts'.", id))); + } + this.delete(resourceGroupName, spacecraftName, contactName, context); + } + + private ContactsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } + + public ContactImpl define(String name) { + return new ContactImpl(name, this.manager()); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationImpl.java new file mode 100644 index 0000000000000..3103f0afb9903 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; +import com.azure.resourcemanager.orbital.models.ActionType; +import com.azure.resourcemanager.orbital.models.Operation; +import com.azure.resourcemanager.orbital.models.OperationDisplay; +import com.azure.resourcemanager.orbital.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsClientImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..3cb20f01995ae --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsClientImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.OperationsClient; +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; +import com.azure.resourcemanager.orbital.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AzureOrbitalImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzureOrbitalImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureOrbitalOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureOrbitalOperatio") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Orbital/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Orbital Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Orbital Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all of the available Orbital Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists all of the available Orbital Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists all of the available Orbital Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Orbital Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..04890a61b4036 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.OperationsClient; +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; +import com.azure.resourcemanager.orbital.models.Operation; +import com.azure.resourcemanager.orbital.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftImpl.java new file mode 100644 index 0000000000000..0d857d626106b --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.azure.resourcemanager.orbital.models.AuthorizationStatus; +import com.azure.resourcemanager.orbital.models.AvailableContactsListResult; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.Spacecraft; +import com.azure.resourcemanager.orbital.models.SpacecraftLink; +import com.azure.resourcemanager.orbital.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SpacecraftImpl implements Spacecraft, Spacecraft.Definition, Spacecraft.Update { + private SpacecraftInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String noradId() { + return this.innerModel().noradId(); + } + + public AuthorizationStatus authorizationStatus() { + return this.innerModel().authorizationStatus(); + } + + public String authorizationStatusExtended() { + return this.innerModel().authorizationStatusExtended(); + } + + public String titleLine() { + return this.innerModel().titleLine(); + } + + public String tleLine1() { + return this.innerModel().tleLine1(); + } + + public String tleLine2() { + return this.innerModel().tleLine2(); + } + + public List links() { + List inner = this.innerModel().links(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SpacecraftInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String spacecraftName; + + private TagsObject updateParameters; + + public SpacecraftImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Spacecraft create() { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .createOrUpdate(resourceGroupName, spacecraftName, this.innerModel(), Context.NONE); + return this; + } + + public Spacecraft create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .createOrUpdate(resourceGroupName, spacecraftName, this.innerModel(), context); + return this; + } + + SpacecraftImpl(String name, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = new SpacecraftInner(); + this.serviceManager = serviceManager; + this.spacecraftName = name; + } + + public SpacecraftImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Spacecraft apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .updateTagsWithResponse(resourceGroupName, spacecraftName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Spacecraft apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .updateTagsWithResponse(resourceGroupName, spacecraftName, updateParameters, context) + .getValue(); + return this; + } + + SpacecraftImpl(SpacecraftInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.spacecraftName = Utils.getValueFromIdByName(innerObject.id(), "spacecrafts"); + } + + public Spacecraft refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .getByResourceGroupWithResponse(resourceGroupName, spacecraftName, Context.NONE) + .getValue(); + return this; + } + + public Spacecraft refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .getByResourceGroupWithResponse(resourceGroupName, spacecraftName, context) + .getValue(); + return this; + } + + public AvailableContactsListResult listAvailableContacts(ContactParameters parameters) { + return serviceManager.spacecrafts().listAvailableContacts(resourceGroupName, spacecraftName, parameters); + } + + public AvailableContactsListResult listAvailableContacts(ContactParameters parameters, Context context) { + return serviceManager + .spacecrafts() + .listAvailableContacts(resourceGroupName, spacecraftName, parameters, context); + } + + public SpacecraftImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SpacecraftImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SpacecraftImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SpacecraftImpl withNoradId(String noradId) { + this.innerModel().withNoradId(noradId); + return this; + } + + public SpacecraftImpl withTitleLine(String titleLine) { + this.innerModel().withTitleLine(titleLine); + return this; + } + + public SpacecraftImpl withTleLine1(String tleLine1) { + this.innerModel().withTleLine1(tleLine1); + return this; + } + + public SpacecraftImpl withTleLine2(String tleLine2) { + this.innerModel().withTleLine2(tleLine2); + return this; + } + + public SpacecraftImpl withLinks(List links) { + this.innerModel().withLinks(links); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsClientImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsClientImpl.java new file mode 100644 index 0000000000000..99ef88c0844a7 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsClientImpl.java @@ -0,0 +1,1535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.SpacecraftsClient; +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsListResultInner; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.SpacecraftListResult; +import com.azure.resourcemanager.orbital.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SpacecraftsClient. */ +public final class SpacecraftsClientImpl implements SpacecraftsClient { + private final ClientLogger logger = new ClientLogger(SpacecraftsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SpacecraftsService service; + + /** The service client containing this operation class. */ + private final AzureOrbitalImpl client; + + /** + * Initializes an instance of SpacecraftsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SpacecraftsClientImpl(AzureOrbitalImpl client) { + this.service = + RestProxy.create(SpacecraftsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureOrbitalSpacecrafts to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureOrbitalSpacecra") + private interface SpacecraftsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/spacecrafts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital" + + "/spacecrafts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @BodyParam("application/json") SpacecraftInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("spacecraftName") String spacecraftName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" + + "/{spacecraftName}/listAvailableContacts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listAvailableContacts( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("spacecraftName") String spacecraftName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContactParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Return list of spacecrafts. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return list of spacecrafts. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Return list of spacecrafts. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Return list of spacecrafts. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Return list of spacecrafts. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Return list of spacecrafts. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String spacecraftName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String spacecraftName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + accept, + context); + } + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String spacecraftName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, spacecraftName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SpacecraftInner getByResourceGroup(String resourceGroupName, String spacecraftName) { + return getByResourceGroupAsync(resourceGroupName, spacecraftName).block(); + } + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String spacecraftName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, spacecraftName, context).block(); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + parameters, + accept, + context); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SpacecraftInner> beginCreateOrUpdateAsync( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, spacecraftName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SpacecraftInner.class, SpacecraftInner.class, Context.NONE); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SpacecraftInner> beginCreateOrUpdateAsync( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, spacecraftName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SpacecraftInner.class, SpacecraftInner.class, context); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SpacecraftInner> beginCreateOrUpdate( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, spacecraftName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SpacecraftInner> beginCreateOrUpdate( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, spacecraftName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, spacecraftName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, spacecraftName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SpacecraftInner createOrUpdate(String resourceGroupName, String spacecraftName, SpacecraftInner parameters) { + return createOrUpdateAsync(resourceGroupName, spacecraftName, parameters).block(); + } + + /** + * Creates or updates a spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the created spacecraft. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SpacecraftInner createOrUpdate( + String resourceGroupName, String spacecraftName, SpacecraftInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, spacecraftName, parameters, context).block(); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String spacecraftName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String spacecraftName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + spacecraftName, + accept, + context); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String spacecraftName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, spacecraftName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String spacecraftName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, spacecraftName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String spacecraftName) { + return beginDeleteAsync(resourceGroupName, spacecraftName).getSyncPoller(); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String spacecraftName, Context context) { + return beginDeleteAsync(resourceGroupName, spacecraftName, context).getSyncPoller(); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String spacecraftName) { + return beginDeleteAsync(resourceGroupName, spacecraftName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String spacecraftName, Context context) { + return beginDeleteAsync(resourceGroupName, spacecraftName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String spacecraftName) { + deleteAsync(resourceGroupName, spacecraftName).block(); + } + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String spacecraftName, Context context) { + deleteAsync(resourceGroupName, spacecraftName, context).block(); + } + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, spacecraftName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SpacecraftInner updateTags(String resourceGroupName, String spacecraftName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, spacecraftName, parameters).block(); + } + + /** + * Updates the specified spacecraft tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters Parameters supplied to update spacecraft tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, spacecraftName, parameters, context).block(); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableContactsWithResponseAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableContacts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listAvailableContactsWithResponseAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (spacecraftName == null) { + return Mono.error(new IllegalArgumentException("Parameter spacecraftName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableContacts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + spacecraftName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AvailableContactsListResultInner> + beginListAvailableContactsAsync(String resourceGroupName, String spacecraftName, ContactParameters parameters) { + Mono>> mono = + listAvailableContactsWithResponseAsync(resourceGroupName, spacecraftName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AvailableContactsListResultInner.class, + AvailableContactsListResultInner.class, + Context.NONE); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AvailableContactsListResultInner> + beginListAvailableContactsAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + listAvailableContactsWithResponseAsync(resourceGroupName, spacecraftName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AvailableContactsListResultInner.class, + AvailableContactsListResultInner.class, + context); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvailableContactsListResultInner> + beginListAvailableContacts(String resourceGroupName, String spacecraftName, ContactParameters parameters) { + return beginListAvailableContactsAsync(resourceGroupName, spacecraftName, parameters).getSyncPoller(); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvailableContactsListResultInner> + beginListAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + return beginListAvailableContactsAsync(resourceGroupName, spacecraftName, parameters, context).getSyncPoller(); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableContactsAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + return beginListAvailableContactsAsync(resourceGroupName, spacecraftName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableContactsAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + return beginListAvailableContactsAsync(resourceGroupName, spacecraftName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableContactsListResultInner listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + return listAvailableContactsAsync(resourceGroupName, spacecraftName, parameters).block(); + } + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableContactsListResultInner listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + return listAvailableContactsAsync(resourceGroupName, spacecraftName, parameters, context).block(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsImpl.java new file mode 100644 index 0000000000000..6801ef81fb94e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.SpacecraftsClient; +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsListResultInner; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.azure.resourcemanager.orbital.models.AvailableContactsListResult; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.Spacecraft; +import com.azure.resourcemanager.orbital.models.Spacecrafts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SpacecraftsImpl implements Spacecrafts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SpacecraftsImpl.class); + + private final SpacecraftsClient innerClient; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public SpacecraftsImpl( + SpacecraftsClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SpacecraftImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SpacecraftImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SpacecraftImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SpacecraftImpl(inner1, this.manager())); + } + + public Spacecraft getByResourceGroup(String resourceGroupName, String spacecraftName) { + SpacecraftInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, spacecraftName); + if (inner != null) { + return new SpacecraftImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String spacecraftName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, spacecraftName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SpacecraftImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String spacecraftName) { + this.serviceClient().delete(resourceGroupName, spacecraftName); + } + + public void delete(String resourceGroupName, String spacecraftName, Context context) { + this.serviceClient().delete(resourceGroupName, spacecraftName, context); + } + + public AvailableContactsListResult listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + AvailableContactsListResultInner inner = + this.serviceClient().listAvailableContacts(resourceGroupName, spacecraftName, parameters); + if (inner != null) { + return new AvailableContactsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public AvailableContactsListResult listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + AvailableContactsListResultInner inner = + this.serviceClient().listAvailableContacts(resourceGroupName, spacecraftName, parameters, context); + if (inner != null) { + return new AvailableContactsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Spacecraft getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, spacecraftName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, spacecraftName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + this.delete(resourceGroupName, spacecraftName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String spacecraftName = Utils.getValueFromIdByName(id, "spacecrafts"); + if (spacecraftName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'spacecrafts'.", id))); + } + this.delete(resourceGroupName, spacecraftName, context); + } + + private SpacecraftsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.orbital.OrbitalManager manager() { + return this.serviceManager; + } + + public SpacecraftImpl define(String name) { + return new SpacecraftImpl(name, this.manager()); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/Utils.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/Utils.java new file mode 100644 index 0000000000000..126afc890a1a0 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/package-info.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/package-info.java new file mode 100644 index 0000000000000..6d78f9e86aa91 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for AzureOrbital. Azure Orbital service. */ +package com.azure.resourcemanager.orbital.implementation; diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ActionType.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ActionType.java new file mode 100644 index 0000000000000..295e45a46e861 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AuthorizationStatus.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AuthorizationStatus.java new file mode 100644 index 0000000000000..729a048ab69fc --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AuthorizationStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AuthorizationStatus. */ +public enum AuthorizationStatus { + /** Enum value Allowed. */ + ALLOWED("Allowed"), + + /** Enum value Pending. */ + PENDING("Pending"), + + /** Enum value Denied. */ + DENIED("Denied"); + + /** The actual serialized value for a AuthorizationStatus instance. */ + private final String value; + + AuthorizationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AuthorizationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AuthorizationStatus object, or null if unable to parse. + */ + @JsonCreator + public static AuthorizationStatus fromString(String value) { + AuthorizationStatus[] items = AuthorizationStatus.values(); + for (AuthorizationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AutoTrackingConfiguration.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AutoTrackingConfiguration.java new file mode 100644 index 0000000000000..48bf6f1f1f3e9 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AutoTrackingConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AutoTrackingConfiguration. */ +public enum AutoTrackingConfiguration { + /** Enum value disabled. */ + DISABLED("disabled"), + + /** Enum value xBand. */ + X_BAND("xBand"), + + /** Enum value sBand. */ + S_BAND("sBand"); + + /** The actual serialized value for a AutoTrackingConfiguration instance. */ + private final String value; + + AutoTrackingConfiguration(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AutoTrackingConfiguration instance. + * + * @param value the serialized value to parse. + * @return the parsed AutoTrackingConfiguration object, or null if unable to parse. + */ + @JsonCreator + public static AutoTrackingConfiguration fromString(String value) { + AutoTrackingConfiguration[] items = AutoTrackingConfiguration.values(); + for (AutoTrackingConfiguration item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContacts.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContacts.java new file mode 100644 index 0000000000000..14f9301d7fa3a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContacts.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.models.ContactInstanceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Customer retrieves list of Available Contacts for a spacecraft resource. Later, one of the available contact can be + * selected to create a contact. + */ +@Fluent +public final class AvailableContacts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableContacts.class); + + /* + * The reference to the spacecraft resource. + */ + @JsonProperty(value = "spacecraft") + private ResourceReference spacecraft; + + /* + * Name of Azure Ground Station. + */ + @JsonProperty(value = "groundStationName", access = JsonProperty.Access.WRITE_ONLY) + private String groundStationName; + + /* + * Properties of Contact resource. + */ + @JsonProperty(value = "properties") + private ContactInstanceProperties innerProperties; + + /** + * Get the spacecraft property: The reference to the spacecraft resource. + * + * @return the spacecraft value. + */ + public ResourceReference spacecraft() { + return this.spacecraft; + } + + /** + * Set the spacecraft property: The reference to the spacecraft resource. + * + * @param spacecraft the spacecraft value to set. + * @return the AvailableContacts object itself. + */ + public AvailableContacts withSpacecraft(ResourceReference spacecraft) { + this.spacecraft = spacecraft; + return this; + } + + /** + * Get the groundStationName property: Name of Azure Ground Station. + * + * @return the groundStationName value. + */ + public String groundStationName() { + return this.groundStationName; + } + + /** + * Get the innerProperties property: Properties of Contact resource. + * + * @return the innerProperties value. + */ + private ContactInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal degrees. + * + * @return the maximumElevationDegrees value. + */ + public Float maximumElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().maximumElevationDegrees(); + } + + /** + * Get the txStartTime property: Time at which antenna transmit will be enabled. + * + * @return the txStartTime value. + */ + public OffsetDateTime txStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().txStartTime(); + } + + /** + * Get the txEndTime property: Time at which antenna transmit will be disabled. + * + * @return the txEndTime value. + */ + public OffsetDateTime txEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().txEndTime(); + } + + /** + * Get the rxStartTime property: Earliest time to receive a signal. + * + * @return the rxStartTime value. + */ + public OffsetDateTime rxStartTime() { + return this.innerProperties() == null ? null : this.innerProperties().rxStartTime(); + } + + /** + * Get the rxEndTime property: Time to lost receiving a signal. + * + * @return the rxEndTime value. + */ + public OffsetDateTime rxEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().rxEndTime(); + } + + /** + * Get the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees. + * + * @return the startAzimuthDegrees value. + */ + public Float startAzimuthDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().startAzimuthDegrees(); + } + + /** + * Get the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees. + * + * @return the endAzimuthDegrees value. + */ + public Float endAzimuthDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().endAzimuthDegrees(); + } + + /** + * Get the startElevationDegrees property: Spacecraft elevation above the horizon at contact start. + * + * @return the startElevationDegrees value. + */ + public Float startElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().startElevationDegrees(); + } + + /** + * Get the endElevationDegrees property: Spacecraft elevation above the horizon at contact end. + * + * @return the endElevationDegrees value. + */ + public Float endElevationDegrees() { + return this.innerProperties() == null ? null : this.innerProperties().endElevationDegrees(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (spacecraft() != null) { + spacecraft().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsListResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsListResult.java new file mode 100644 index 0000000000000..382a0869adb46 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsListResultInner; +import java.util.List; + +/** An immutable client-side representation of AvailableContactsListResult. */ +public interface AvailableContactsListResult { + /** + * Gets the value property: A list of available contacts. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.AvailableContactsListResultInner object. + * + * @return the inner object. + */ + AvailableContactsListResultInner innerModel(); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStation.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStation.java new file mode 100644 index 0000000000000..dd0519c2c0a86 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStation.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; + +/** An immutable client-side representation of AvailableGroundStation. */ +public interface AvailableGroundStation { + /** + * Gets the id property: Id of groundStation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the ground station. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Azure region. + * + * @return the location value. + */ + String location(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the city property: City of ground station. + * + * @return the city value. + */ + String city(); + + /** + * Gets the providerName property: Ground station provider name. + * + * @return the providerName value. + */ + String providerName(); + + /** + * Gets the longitudeDegrees property: Longitude of the ground station in decimal degrees. + * + * @return the longitudeDegrees value. + */ + Float longitudeDegrees(); + + /** + * Gets the latitudeDegrees property: Latitude of the ground station in decimal degrees. + * + * @return the latitudeDegrees value. + */ + Float latitudeDegrees(); + + /** + * Gets the altitudeMeters property: Altitude of the ground station. + * + * @return the altitudeMeters value. + */ + Float altitudeMeters(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner object. + * + * @return the inner object. + */ + AvailableGroundStationInner innerModel(); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationListResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationListResult.java new file mode 100644 index 0000000000000..a8fc27e7061d8 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the AvailableGroundStations API service call. */ +@Fluent +public final class AvailableGroundStationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableGroundStationListResult.class); + + /* + * A list of ground station resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ground station resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ground station resources. + * + * @param value the value value to set. + * @return the AvailableGroundStationListResult object itself. + */ + public AvailableGroundStationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStations.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStations.java new file mode 100644 index 0000000000000..a107164ffb5ad --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStations.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableGroundStations. */ +public interface AvailableGroundStations { + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + PagedIterable list(AvailableGroundStationsCapability capability); + + /** + * Returns list of available ground stations. + * + * @param capability Ground Station Capability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the AvailableGroundStations API service call. + */ + PagedIterable list(AvailableGroundStationsCapability capability, Context context); + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + AvailableGroundStation get(String groundStationName); + + /** + * Gets the specified available ground station. + * + * @param groundStationName Ground Station name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified available ground station. + */ + Response getWithResponse(String groundStationName, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationsCapability.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationsCapability.java new file mode 100644 index 0000000000000..fe5c5c63a2ed4 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationsCapability.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AvailableGroundStationsCapability. */ +public final class AvailableGroundStationsCapability extends ExpandableStringEnum { + /** Static value EarthObservation for AvailableGroundStationsCapability. */ + public static final AvailableGroundStationsCapability EARTH_OBSERVATION = fromString("EarthObservation"); + + /** Static value Communication for AvailableGroundStationsCapability. */ + public static final AvailableGroundStationsCapability COMMUNICATION = fromString("Communication"); + + /** + * Creates or finds a AvailableGroundStationsCapability from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailableGroundStationsCapability. + */ + @JsonCreator + public static AvailableGroundStationsCapability fromString(String name) { + return fromString(name, AvailableGroundStationsCapability.class); + } + + /** @return known AvailableGroundStationsCapability values. */ + public static Collection values() { + return values(AvailableGroundStationsCapability.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contact.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contact.java new file mode 100644 index 0000000000000..b4546b7c5260e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contact.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Contact. */ +public interface Contact { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the status property: Status of a contact. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the reservationStartTime property: Reservation start time of a contact. + * + * @return the reservationStartTime value. + */ + OffsetDateTime reservationStartTime(); + + /** + * Gets the reservationEndTime property: Reservation end time of a contact. + * + * @return the reservationEndTime value. + */ + OffsetDateTime reservationEndTime(); + + /** + * Gets the rxStartTime property: Receive start time of a contact. + * + * @return the rxStartTime value. + */ + OffsetDateTime rxStartTime(); + + /** + * Gets the rxEndTime property: Receive end time of a contact. + * + * @return the rxEndTime value. + */ + OffsetDateTime rxEndTime(); + + /** + * Gets the txStartTime property: Transmit start time of a contact. + * + * @return the txStartTime value. + */ + OffsetDateTime txStartTime(); + + /** + * Gets the txEndTime property: Transmit end time of a contact. + * + * @return the txEndTime value. + */ + OffsetDateTime txEndTime(); + + /** + * Gets the errorMessage property: Any error message while scheduling a contact. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal + * degrees. + * + * @return the maximumElevationDegrees value. + */ + Float maximumElevationDegrees(); + + /** + * Gets the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees. + * + * @return the startAzimuthDegrees value. + */ + Float startAzimuthDegrees(); + + /** + * Gets the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees. + * + * @return the endAzimuthDegrees value. + */ + Float endAzimuthDegrees(); + + /** + * Gets the groundStationName property: Azure Ground Station name. + * + * @return the groundStationName value. + */ + String groundStationName(); + + /** + * Gets the startElevationDegrees property: Spacecraft elevation above the horizon at contact start. + * + * @return the startElevationDegrees value. + */ + Float startElevationDegrees(); + + /** + * Gets the endElevationDegrees property: Spacecraft elevation above the horizon at contact end. + * + * @return the endElevationDegrees value. + */ + Float endElevationDegrees(); + + /** + * Gets the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + ResourceReference contactProfile(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.ContactInner object. + * + * @return the inner object. + */ + ContactInner innerModel(); + + /** The entirety of the Contact definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Contact definition stages. */ + interface DefinitionStages { + /** The first stage of the Contact definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Contact definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @return the next definition stage. + */ + WithCreate withExistingSpacecraft(String resourceGroupName, String spacecraftName); + } + /** + * The stage of the Contact definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithReservationStartTime, + DefinitionStages.WithReservationEndTime, + DefinitionStages.WithGroundStationName, + DefinitionStages.WithContactProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + Contact create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Contact create(Context context); + } + /** The stage of the Contact definition allowing to specify reservationStartTime. */ + interface WithReservationStartTime { + /** + * Specifies the reservationStartTime property: Reservation start time of a contact.. + * + * @param reservationStartTime Reservation start time of a contact. + * @return the next definition stage. + */ + WithCreate withReservationStartTime(OffsetDateTime reservationStartTime); + } + /** The stage of the Contact definition allowing to specify reservationEndTime. */ + interface WithReservationEndTime { + /** + * Specifies the reservationEndTime property: Reservation end time of a contact.. + * + * @param reservationEndTime Reservation end time of a contact. + * @return the next definition stage. + */ + WithCreate withReservationEndTime(OffsetDateTime reservationEndTime); + } + /** The stage of the Contact definition allowing to specify groundStationName. */ + interface WithGroundStationName { + /** + * Specifies the groundStationName property: Azure Ground Station name.. + * + * @param groundStationName Azure Ground Station name. + * @return the next definition stage. + */ + WithCreate withGroundStationName(String groundStationName); + } + /** The stage of the Contact definition allowing to specify contactProfile. */ + interface WithContactProfile { + /** + * Specifies the contactProfile property: The reference to the contact profile resource.. + * + * @param contactProfile The reference to the contact profile resource. + * @return the next definition stage. + */ + WithCreate withContactProfile(ResourceReference contactProfile); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Contact refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Contact refresh(Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactListResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactListResult.java new file mode 100644 index 0000000000000..d54a67bfe5981 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListContacts API service call. */ +@Fluent +public final class ContactListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactListResult.class); + + /* + * A list of contact resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of contact resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of contact resources in a resource group. + * + * @param value the value value to set. + * @return the ContactListResult object itself. + */ + public ContactListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParameters.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParameters.java new file mode 100644 index 0000000000000..b44dde12725fc --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParameters.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Parameters that define the contact resource. */ +@Fluent +public final class ContactParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactParameters.class); + + /* + * The reference to the contact profile resource. + */ + @JsonProperty(value = "contactProfile", required = true) + private ResourceReference contactProfile; + + /* + * Name of Azure Ground Station. + */ + @JsonProperty(value = "groundStationName", required = true) + private String groundStationName; + + /* + * Start time of a contact. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * End time of a contact. + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /** + * Get the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + public ResourceReference contactProfile() { + return this.contactProfile; + } + + /** + * Set the contactProfile property: The reference to the contact profile resource. + * + * @param contactProfile the contactProfile value to set. + * @return the ContactParameters object itself. + */ + public ContactParameters withContactProfile(ResourceReference contactProfile) { + this.contactProfile = contactProfile; + return this; + } + + /** + * Get the groundStationName property: Name of Azure Ground Station. + * + * @return the groundStationName value. + */ + public String groundStationName() { + return this.groundStationName; + } + + /** + * Set the groundStationName property: Name of Azure Ground Station. + * + * @param groundStationName the groundStationName value to set. + * @return the ContactParameters object itself. + */ + public ContactParameters withGroundStationName(String groundStationName) { + this.groundStationName = groundStationName; + return this; + } + + /** + * Get the startTime property: Start time of a contact. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of a contact. + * + * @param startTime the startTime value to set. + * @return the ContactParameters object itself. + */ + public ContactParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time of a contact. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of a contact. + * + * @param endTime the endTime value to set. + * @return the ContactParameters object itself. + */ + public ContactParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contactProfile() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contactProfile in model ContactParameters")); + } else { + contactProfile().validate(); + } + if (groundStationName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property groundStationName in model ContactParameters")); + } + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property startTime in model ContactParameters")); + } + if (endTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property endTime in model ContactParameters")); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfile.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfile.java new file mode 100644 index 0000000000000..051c889b79d02 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfile.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ContactProfile. */ +public interface ContactProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. + * + * @return the minimumViableContactDuration value. + */ + String minimumViableContactDuration(); + + /** + * Gets the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. + * + * @return the minimumElevationDegrees value. + */ + Float minimumElevationDegrees(); + + /** + * Gets the autoTrackingConfiguration property: Auto track configuration. + * + * @return the autoTrackingConfiguration value. + */ + AutoTrackingConfiguration autoTrackingConfiguration(); + + /** + * Gets the links property: Links of the Contact Profile. + * + * @return the links value. + */ + List links(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner object. + * + * @return the inner object. + */ + ContactProfileInner innerModel(); + + /** The entirety of the ContactProfile definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ContactProfile definition stages. */ + interface DefinitionStages { + /** The first stage of the ContactProfile definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ContactProfile definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ContactProfile definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ContactProfile definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithMinimumViableContactDuration, + DefinitionStages.WithMinimumElevationDegrees, + DefinitionStages.WithAutoTrackingConfiguration, + DefinitionStages.WithLinks { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContactProfile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContactProfile create(Context context); + } + /** The stage of the ContactProfile definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ContactProfile definition allowing to specify minimumViableContactDuration. */ + interface WithMinimumViableContactDuration { + /** + * Specifies the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format.. + * + * @param minimumViableContactDuration Minimum viable contact duration in ISO 8601 format. + * @return the next definition stage. + */ + WithCreate withMinimumViableContactDuration(String minimumViableContactDuration); + } + /** The stage of the ContactProfile definition allowing to specify minimumElevationDegrees. */ + interface WithMinimumElevationDegrees { + /** + * Specifies the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal + * degrees.. + * + * @param minimumElevationDegrees Minimum viable elevation for the contact in decimal degrees. + * @return the next definition stage. + */ + WithCreate withMinimumElevationDegrees(Float minimumElevationDegrees); + } + /** The stage of the ContactProfile definition allowing to specify autoTrackingConfiguration. */ + interface WithAutoTrackingConfiguration { + /** + * Specifies the autoTrackingConfiguration property: Auto track configuration.. + * + * @param autoTrackingConfiguration Auto track configuration. + * @return the next definition stage. + */ + WithCreate withAutoTrackingConfiguration(AutoTrackingConfiguration autoTrackingConfiguration); + } + /** The stage of the ContactProfile definition allowing to specify links. */ + interface WithLinks { + /** + * Specifies the links property: Links of the Contact Profile. + * + * @param links Links of the Contact Profile. + * @return the next definition stage. + */ + WithCreate withLinks(List links); + } + } + /** + * Begins update for the ContactProfile resource. + * + * @return the stage of resource update. + */ + ContactProfile.Update update(); + + /** The template for ContactProfile update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContactProfile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContactProfile apply(Context context); + } + /** The ContactProfile update stages. */ + interface UpdateStages { + /** The stage of the ContactProfile update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContactProfile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContactProfile refresh(Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLink.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLink.java new file mode 100644 index 0000000000000..9be54e01a2ddd --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLink.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contact Profile link. */ +@Fluent +public final class ContactProfileLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfileLink.class); + + /* + * polarization. eg (RHCP, LHCP) + */ + @JsonProperty(value = "polarization", required = true) + private Polarization polarization; + + /* + * Direction (uplink or downlink) + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Gain To Noise Temperature in db/K. + */ + @JsonProperty(value = "gainOverTemperature") + private Float gainOverTemperature; + + /* + * Effective Isotropic Radiated Power (EIRP) in dBW. + */ + @JsonProperty(value = "eirpdBW") + private Float eirpdBW; + + /* + * Contact Profile Link Channel + */ + @JsonProperty(value = "channels", required = true) + private List channels; + + /** + * Get the polarization property: polarization. eg (RHCP, LHCP). + * + * @return the polarization value. + */ + public Polarization polarization() { + return this.polarization; + } + + /** + * Set the polarization property: polarization. eg (RHCP, LHCP). + * + * @param polarization the polarization value to set. + * @return the ContactProfileLink object itself. + */ + public ContactProfileLink withPolarization(Polarization polarization) { + this.polarization = polarization; + return this; + } + + /** + * Get the direction property: Direction (uplink or downlink). + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: Direction (uplink or downlink). + * + * @param direction the direction value to set. + * @return the ContactProfileLink object itself. + */ + public ContactProfileLink withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the gainOverTemperature property: Gain To Noise Temperature in db/K. + * + * @return the gainOverTemperature value. + */ + public Float gainOverTemperature() { + return this.gainOverTemperature; + } + + /** + * Set the gainOverTemperature property: Gain To Noise Temperature in db/K. + * + * @param gainOverTemperature the gainOverTemperature value to set. + * @return the ContactProfileLink object itself. + */ + public ContactProfileLink withGainOverTemperature(Float gainOverTemperature) { + this.gainOverTemperature = gainOverTemperature; + return this; + } + + /** + * Get the eirpdBW property: Effective Isotropic Radiated Power (EIRP) in dBW. + * + * @return the eirpdBW value. + */ + public Float eirpdBW() { + return this.eirpdBW; + } + + /** + * Set the eirpdBW property: Effective Isotropic Radiated Power (EIRP) in dBW. + * + * @param eirpdBW the eirpdBW value to set. + * @return the ContactProfileLink object itself. + */ + public ContactProfileLink withEirpdBW(Float eirpdBW) { + this.eirpdBW = eirpdBW; + return this; + } + + /** + * Get the channels property: Contact Profile Link Channel. + * + * @return the channels value. + */ + public List channels() { + return this.channels; + } + + /** + * Set the channels property: Contact Profile Link Channel. + * + * @param channels the channels value to set. + * @return the ContactProfileLink object itself. + */ + public ContactProfileLink withChannels(List channels) { + this.channels = channels; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (polarization() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property polarization in model ContactProfileLink")); + } + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property direction in model ContactProfileLink")); + } + if (channels() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property channels in model ContactProfileLink")); + } else { + channels().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLinkChannel.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLinkChannel.java new file mode 100644 index 0000000000000..219e1274c26a9 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLinkChannel.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contact Profile Link Channel. */ +@Fluent +public final class ContactProfileLinkChannel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfileLinkChannel.class); + + /* + * Center Frequency in MHz + */ + @JsonProperty(value = "centerFrequencyMHz", required = true) + private float centerFrequencyMHz; + + /* + * Bandwidth in MHz + */ + @JsonProperty(value = "bandwidthMHz", required = true) + private float bandwidthMHz; + + /* + * Customer End point to store/retrieve data during a contact. + */ + @JsonProperty(value = "endPoint", required = true) + private EndPoint endPoint; + + /* + * Configuration for modulation + */ + @JsonProperty(value = "modulationConfiguration") + private String modulationConfiguration; + + /* + * Configuration for demodulation + */ + @JsonProperty(value = "demodulationConfiguration") + private String demodulationConfiguration; + + /* + * Configuration for encoding + */ + @JsonProperty(value = "encodingConfiguration") + private String encodingConfiguration; + + /* + * Configuration for decoding + */ + @JsonProperty(value = "decodingConfiguration") + private String decodingConfiguration; + + /** + * Get the centerFrequencyMHz property: Center Frequency in MHz. + * + * @return the centerFrequencyMHz value. + */ + public float centerFrequencyMHz() { + return this.centerFrequencyMHz; + } + + /** + * Set the centerFrequencyMHz property: Center Frequency in MHz. + * + * @param centerFrequencyMHz the centerFrequencyMHz value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withCenterFrequencyMHz(float centerFrequencyMHz) { + this.centerFrequencyMHz = centerFrequencyMHz; + return this; + } + + /** + * Get the bandwidthMHz property: Bandwidth in MHz. + * + * @return the bandwidthMHz value. + */ + public float bandwidthMHz() { + return this.bandwidthMHz; + } + + /** + * Set the bandwidthMHz property: Bandwidth in MHz. + * + * @param bandwidthMHz the bandwidthMHz value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withBandwidthMHz(float bandwidthMHz) { + this.bandwidthMHz = bandwidthMHz; + return this; + } + + /** + * Get the endPoint property: Customer End point to store/retrieve data during a contact. + * + * @return the endPoint value. + */ + public EndPoint endPoint() { + return this.endPoint; + } + + /** + * Set the endPoint property: Customer End point to store/retrieve data during a contact. + * + * @param endPoint the endPoint value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withEndPoint(EndPoint endPoint) { + this.endPoint = endPoint; + return this; + } + + /** + * Get the modulationConfiguration property: Configuration for modulation. + * + * @return the modulationConfiguration value. + */ + public String modulationConfiguration() { + return this.modulationConfiguration; + } + + /** + * Set the modulationConfiguration property: Configuration for modulation. + * + * @param modulationConfiguration the modulationConfiguration value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withModulationConfiguration(String modulationConfiguration) { + this.modulationConfiguration = modulationConfiguration; + return this; + } + + /** + * Get the demodulationConfiguration property: Configuration for demodulation. + * + * @return the demodulationConfiguration value. + */ + public String demodulationConfiguration() { + return this.demodulationConfiguration; + } + + /** + * Set the demodulationConfiguration property: Configuration for demodulation. + * + * @param demodulationConfiguration the demodulationConfiguration value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withDemodulationConfiguration(String demodulationConfiguration) { + this.demodulationConfiguration = demodulationConfiguration; + return this; + } + + /** + * Get the encodingConfiguration property: Configuration for encoding. + * + * @return the encodingConfiguration value. + */ + public String encodingConfiguration() { + return this.encodingConfiguration; + } + + /** + * Set the encodingConfiguration property: Configuration for encoding. + * + * @param encodingConfiguration the encodingConfiguration value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withEncodingConfiguration(String encodingConfiguration) { + this.encodingConfiguration = encodingConfiguration; + return this; + } + + /** + * Get the decodingConfiguration property: Configuration for decoding. + * + * @return the decodingConfiguration value. + */ + public String decodingConfiguration() { + return this.decodingConfiguration; + } + + /** + * Set the decodingConfiguration property: Configuration for decoding. + * + * @param decodingConfiguration the decodingConfiguration value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withDecodingConfiguration(String decodingConfiguration) { + this.decodingConfiguration = decodingConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endPoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endPoint in model ContactProfileLinkChannel")); + } else { + endPoint().validate(); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileListResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileListResult.java new file mode 100644 index 0000000000000..c263ba9709780 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListContactProfiles API service call. */ +@Fluent +public final class ContactProfileListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfileListResult.class); + + /* + * A list of contact profile resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of contact profile resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of contact profile resources in a resource group. + * + * @param value the value value to set. + * @return the ContactProfileListResult object itself. + */ + public ContactProfileListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfiles.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfiles.java new file mode 100644 index 0000000000000..b15985a42fad0 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfiles.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ContactProfiles. */ +public interface ContactProfiles { + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + ContactProfile getByResourceGroup(String resourceGroupName, String contactProfileName); + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String contactProfileName, Context context); + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String contactProfileName); + + /** + * Deletes a specified contact profile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param contactProfileName Contact Profile Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String contactProfileName, Context context); + + /** + * Returns list of contact profiles. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + PagedIterable list(); + + /** + * Returns list of contact profiles. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + PagedIterable list(Context context); + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns list of contact profiles. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContactProfiles API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + ContactProfile getById(String id); + + /** + * Gets the specified contact Profile in a specified resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact Profile in a specified resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified contact profile resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified contact profile resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContactProfile resource. + * + * @param name resource name. + * @return the first stage of the new ContactProfile definition. + */ + ContactProfile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contacts.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contacts.java new file mode 100644 index 0000000000000..5defa4eafb7d6 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contacts.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Contacts. */ +public interface Contacts { + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + PagedIterable list(String resourceGroupName, String spacecraftName); + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListContacts API service call. + */ + PagedIterable list(String resourceGroupName, String spacecraftName, Context context); + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + Contact get(String resourceGroupName, String spacecraftName, String contactName); + + /** + * Gets the specified contact in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + Response getWithResponse( + String resourceGroupName, String spacecraftName, String contactName, Context context); + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String spacecraftName, String contactName); + + /** + * Deletes a specified contact. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param contactName Contact Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String spacecraftName, String contactName, Context context); + + /** + * Gets the specified contact in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + Contact getById(String id); + + /** + * Gets the specified contact in a specified resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified contact in a specified resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified contact. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified contact. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Contact resource. + * + * @param name resource name. + * @return the first stage of the new Contact definition. + */ + Contact.DefinitionStages.Blank define(String name); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Direction.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Direction.java new file mode 100644 index 0000000000000..b6144d65ef881 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Direction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Direction. */ +public final class Direction extends ExpandableStringEnum { + /** Static value uplink for Direction. */ + public static final Direction UPLINK = fromString("uplink"); + + /** Static value downlink for Direction. */ + public static final Direction DOWNLINK = fromString("downlink"); + + /** + * Creates or finds a Direction from its string representation. + * + * @param name a name to look for. + * @return the corresponding Direction. + */ + @JsonCreator + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** @return known Direction values. */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/EndPoint.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/EndPoint.java new file mode 100644 index 0000000000000..32de0df8ade64 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/EndPoint.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer End point to store/retrieve data during a contact. */ +@Fluent +public final class EndPoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndPoint.class); + + /* + * IP Address. + */ + @JsonProperty(value = "ipAddress", required = true) + private String ipAddress; + + /* + * Name of an end point. + */ + @JsonProperty(value = "endPointName", required = true) + private String endPointName; + + /* + * TCP port to listen on to receive data. + */ + @JsonProperty(value = "port", required = true) + private String port; + + /* + * Protocol either UDP or TCP. + */ + @JsonProperty(value = "protocol", required = true) + private Protocol protocol; + + /** + * Get the ipAddress property: IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: IP Address. + * + * @param ipAddress the ipAddress value to set. + * @return the EndPoint object itself. + */ + public EndPoint withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the endPointName property: Name of an end point. + * + * @return the endPointName value. + */ + public String endPointName() { + return this.endPointName; + } + + /** + * Set the endPointName property: Name of an end point. + * + * @param endPointName the endPointName value to set. + * @return the EndPoint object itself. + */ + public EndPoint withEndPointName(String endPointName) { + this.endPointName = endPointName; + return this; + } + + /** + * Get the port property: TCP port to listen on to receive data. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: TCP port to listen on to receive data. + * + * @param port the port value to set. + * @return the EndPoint object itself. + */ + public EndPoint withPort(String port) { + this.port = port; + return this; + } + + /** + * Get the protocol property: Protocol either UDP or TCP. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol either UDP or TCP. + * + * @param protocol the protocol value to set. + * @return the EndPoint object itself. + */ + public EndPoint withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddress in model EndPoint")); + } + if (endPointName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property endPointName in model EndPoint")); + } + if (port() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property port in model EndPoint")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property protocol in model EndPoint")); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operation.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operation.java new file mode 100644 index 0000000000000..fd32f00d74392 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationDisplay.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationDisplay.java new file mode 100644 index 0000000000000..1213567eabb26 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationDisplay.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationListResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationListResult.java new file mode 100644 index 0000000000000..087d6d700bf31 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operations.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operations.java new file mode 100644 index 0000000000000..8ef7c09936e4a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Orbital Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + PagedIterable list(); + + /** + * Lists all of the available Orbital Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + PagedIterable list(Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Origin.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Origin.java new file mode 100644 index 0000000000000..e6ea55fb335d8 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Origin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Polarization.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Polarization.java new file mode 100644 index 0000000000000..29be56f040103 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Polarization.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Polarization. */ +public final class Polarization extends ExpandableStringEnum { + /** Static value RHCP for Polarization. */ + public static final Polarization RHCP = fromString("RHCP"); + + /** Static value LHCP for Polarization. */ + public static final Polarization LHCP = fromString("LHCP"); + + /** Static value dualRhcpLhcp for Polarization. */ + public static final Polarization DUAL_RHCP_LHCP = fromString("dualRhcpLhcp"); + + /** Static value linearVertical for Polarization. */ + public static final Polarization LINEAR_VERTICAL = fromString("linearVertical"); + + /** Static value linearHorizontal for Polarization. */ + public static final Polarization LINEAR_HORIZONTAL = fromString("linearHorizontal"); + + /** + * Creates or finds a Polarization from its string representation. + * + * @param name a name to look for. + * @return the corresponding Polarization. + */ + @JsonCreator + public static Polarization fromString(String name) { + return fromString(name, Polarization.class); + } + + /** @return known Polarization values. */ + public static Collection values() { + return values(Polarization.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Protocol.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Protocol.java new file mode 100644 index 0000000000000..a25e0469e5d07 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Protocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value TCP for Protocol. */ + public static final Protocol TCP = fromString("TCP"); + + /** Static value UDP for Protocol. */ + public static final Protocol UDP = fromString("UDP"); + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ResourceReference.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ResourceReference.java new file mode 100644 index 0000000000000..fdfbbed65c99f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ResourceReference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource Reference. */ +@Fluent +public final class ResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceReference.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the ResourceReference object itself. + */ + public ResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecraft.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecraft.java new file mode 100644 index 0000000000000..7b96823115f46 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecraft.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Spacecraft. */ +public interface Spacecraft { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the noradId property: NORAD ID of the spacecraft. + * + * @return the noradId value. + */ + String noradId(); + + /** + * Gets the authorizationStatus property: Authorization status of spacecraft. + * + * @return the authorizationStatus value. + */ + AuthorizationStatus authorizationStatus(); + + /** + * Gets the authorizationStatusExtended property: Details of the authorization status. + * + * @return the authorizationStatusExtended value. + */ + String authorizationStatusExtended(); + + /** + * Gets the titleLine property: Title line of Two Line Element (TLE). + * + * @return the titleLine value. + */ + String titleLine(); + + /** + * Gets the tleLine1 property: Line 1 of Two Line Element (TLE). + * + * @return the tleLine1 value. + */ + String tleLine1(); + + /** + * Gets the tleLine2 property: Line 2 of Two Line Element (TLE). + * + * @return the tleLine2 value. + */ + String tleLine2(); + + /** + * Gets the links property: Links of the Spacecraft. + * + * @return the links value. + */ + List links(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner object. + * + * @return the inner object. + */ + SpacecraftInner innerModel(); + + /** The entirety of the Spacecraft definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Spacecraft definition stages. */ + interface DefinitionStages { + /** The first stage of the Spacecraft definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Spacecraft definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Spacecraft definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Spacecraft definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithNoradId, + DefinitionStages.WithTitleLine, + DefinitionStages.WithTleLine1, + DefinitionStages.WithTleLine2, + DefinitionStages.WithLinks { + /** + * Executes the create request. + * + * @return the created resource. + */ + Spacecraft create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Spacecraft create(Context context); + } + /** The stage of the Spacecraft definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Spacecraft definition allowing to specify noradId. */ + interface WithNoradId { + /** + * Specifies the noradId property: NORAD ID of the spacecraft.. + * + * @param noradId NORAD ID of the spacecraft. + * @return the next definition stage. + */ + WithCreate withNoradId(String noradId); + } + /** The stage of the Spacecraft definition allowing to specify titleLine. */ + interface WithTitleLine { + /** + * Specifies the titleLine property: Title line of Two Line Element (TLE).. + * + * @param titleLine Title line of Two Line Element (TLE). + * @return the next definition stage. + */ + WithCreate withTitleLine(String titleLine); + } + /** The stage of the Spacecraft definition allowing to specify tleLine1. */ + interface WithTleLine1 { + /** + * Specifies the tleLine1 property: Line 1 of Two Line Element (TLE).. + * + * @param tleLine1 Line 1 of Two Line Element (TLE). + * @return the next definition stage. + */ + WithCreate withTleLine1(String tleLine1); + } + /** The stage of the Spacecraft definition allowing to specify tleLine2. */ + interface WithTleLine2 { + /** + * Specifies the tleLine2 property: Line 2 of Two Line Element (TLE).. + * + * @param tleLine2 Line 2 of Two Line Element (TLE). + * @return the next definition stage. + */ + WithCreate withTleLine2(String tleLine2); + } + /** The stage of the Spacecraft definition allowing to specify links. */ + interface WithLinks { + /** + * Specifies the links property: Links of the Spacecraft. + * + * @param links Links of the Spacecraft. + * @return the next definition stage. + */ + WithCreate withLinks(List links); + } + } + /** + * Begins update for the Spacecraft resource. + * + * @return the stage of resource update. + */ + Spacecraft.Update update(); + + /** The template for Spacecraft update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Spacecraft apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Spacecraft apply(Context context); + } + /** The Spacecraft update stages. */ + interface UpdateStages { + /** The stage of the Spacecraft update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Spacecraft refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Spacecraft refresh(Context context); + + /** + * Return list of available contacts. + * + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + AvailableContactsListResult listAvailableContacts(ContactParameters parameters); + + /** + * Return list of available contacts. + * + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + AvailableContactsListResult listAvailableContacts(ContactParameters parameters, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftLink.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftLink.java new file mode 100644 index 0000000000000..30e6f8aeb9efa --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftLink.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Spacecraft Link. */ +@Fluent +public final class SpacecraftLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SpacecraftLink.class); + + /* + * Center Frequency in MHz + */ + @JsonProperty(value = "centerFrequencyMHz", required = true) + private float centerFrequencyMHz; + + /* + * Bandwidth in MHz + */ + @JsonProperty(value = "bandwidthMHz", required = true) + private float bandwidthMHz; + + /* + * Direction (uplink or downlink) + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * polarization. eg (RHCP, LHCP) + */ + @JsonProperty(value = "polarization", required = true) + private Polarization polarization; + + /** + * Get the centerFrequencyMHz property: Center Frequency in MHz. + * + * @return the centerFrequencyMHz value. + */ + public float centerFrequencyMHz() { + return this.centerFrequencyMHz; + } + + /** + * Set the centerFrequencyMHz property: Center Frequency in MHz. + * + * @param centerFrequencyMHz the centerFrequencyMHz value to set. + * @return the SpacecraftLink object itself. + */ + public SpacecraftLink withCenterFrequencyMHz(float centerFrequencyMHz) { + this.centerFrequencyMHz = centerFrequencyMHz; + return this; + } + + /** + * Get the bandwidthMHz property: Bandwidth in MHz. + * + * @return the bandwidthMHz value. + */ + public float bandwidthMHz() { + return this.bandwidthMHz; + } + + /** + * Set the bandwidthMHz property: Bandwidth in MHz. + * + * @param bandwidthMHz the bandwidthMHz value to set. + * @return the SpacecraftLink object itself. + */ + public SpacecraftLink withBandwidthMHz(float bandwidthMHz) { + this.bandwidthMHz = bandwidthMHz; + return this; + } + + /** + * Get the direction property: Direction (uplink or downlink). + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: Direction (uplink or downlink). + * + * @param direction the direction value to set. + * @return the SpacecraftLink object itself. + */ + public SpacecraftLink withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the polarization property: polarization. eg (RHCP, LHCP). + * + * @return the polarization value. + */ + public Polarization polarization() { + return this.polarization; + } + + /** + * Set the polarization property: polarization. eg (RHCP, LHCP). + * + * @param polarization the polarization value to set. + * @return the SpacecraftLink object itself. + */ + public SpacecraftLink withPolarization(Polarization polarization) { + this.polarization = polarization; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property direction in model SpacecraftLink")); + } + if (polarization() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property polarization in model SpacecraftLink")); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftListResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftListResult.java new file mode 100644 index 0000000000000..7c8a83d3483c1 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListSpacecrafts API service call. */ +@Fluent +public final class SpacecraftListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SpacecraftListResult.class); + + /* + * A list of spacecraft resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of spacecraft resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of spacecraft resources in a resource group. + * + * @param value the value value to set. + * @return the SpacecraftListResult object itself. + */ + public SpacecraftListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecrafts.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecrafts.java new file mode 100644 index 0000000000000..8137b0d13ab23 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecrafts.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Spacecrafts. */ +public interface Spacecrafts { + /** + * Return list of spacecrafts. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + PagedIterable list(); + + /** + * Return list of spacecrafts. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + PagedIterable list(Context context); + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Return list of spacecrafts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListSpacecrafts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + Spacecraft getByResourceGroup(String resourceGroupName, String spacecraftName); + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String spacecraftName, Context context); + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String spacecraftName); + + /** + * Deletes a specified spacecraft resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String spacecraftName, Context context); + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + AvailableContactsListResult listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters); + + /** + * Return list of available contacts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param parameters The parameters to provide for the contacts. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableContacts API service call. + */ + AvailableContactsListResult listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context); + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + Spacecraft getById(String id); + + /** + * Gets the specified spacecraft in a specified resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified spacecraft in a specified resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a specified spacecraft resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a specified spacecraft resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Spacecraft resource. + * + * @param name resource name. + * @return the first stage of the new Spacecraft definition. + */ + Spacecraft.DefinitionStages.Blank define(String name); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Status.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Status.java new file mode 100644 index 0000000000000..5648f15a60cd4 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Status.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Status. */ +public enum Status { + /** Enum value scheduled. */ + SCHEDULED("scheduled"), + + /** Enum value cancelled. */ + CANCELLED("cancelled"), + + /** Enum value succeeded. */ + SUCCEEDED("succeeded"), + + /** Enum value failed. */ + FAILED("failed"), + + /** Enum value providerCancelled. */ + PROVIDER_CANCELLED("providerCancelled"); + + /** The actual serialized value for a Status instance. */ + private final String value; + + Status(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Status instance. + * + * @param value the serialized value to parse. + * @return the parsed Status object, or null if unable to parse. + */ + @JsonCreator + public static Status fromString(String value) { + Status[] items = Status.values(); + for (Status item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/TagsObject.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/TagsObject.java new file mode 100644 index 0000000000000..cb6c8aedf2c1c --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/TagsObject.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/package-info.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/package-info.java new file mode 100644 index 0000000000000..8517b63cdb09d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for AzureOrbital. Azure Orbital service. */ +package com.azure.resourcemanager.orbital.models; diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/package-info.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/package-info.java new file mode 100644 index 0000000000000..80075b3c96932 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for AzureOrbital. Azure Orbital service. */ +package com.azure.resourcemanager.orbital; diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/module-info.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/module-info.java new file mode 100644 index 0000000000000..72d4c81f91d4e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.orbital { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.orbital; + exports com.azure.resourcemanager.orbital.fluent; + exports com.azure.resourcemanager.orbital.fluent.models; + exports com.azure.resourcemanager.orbital.models; + + opens com.azure.resourcemanager.orbital.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.orbital.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsGetSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsGetSamples.java new file mode 100644 index 0000000000000..8d4781c727388 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for AvailableGroundStations Get. */ +public final class AvailableGroundStationsGetSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableGroundStationGet.json + */ + /** + * Sample code: Get GroundStation. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getGroundStation(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.availableGroundStations().getWithResponse("westus_gs1", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsListSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsListSamples.java new file mode 100644 index 0000000000000..cc2f2c6462be3 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.AvailableGroundStationsCapability; + +/** Samples for AvailableGroundStations List. */ +public final class AvailableGroundStationsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableGroundStationsByCapabilityList.json + */ + /** + * Sample code: List of Ground Stations by Capability. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfGroundStationsByCapability(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.availableGroundStations().list(AvailableGroundStationsCapability.EARTH_OBSERVATION, Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesCreateOrUpdateSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..430028cb79db5 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesCreateOrUpdateSamples.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.resourcemanager.orbital.models.AutoTrackingConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfileLink; +import com.azure.resourcemanager.orbital.models.ContactProfileLinkChannel; +import com.azure.resourcemanager.orbital.models.Direction; +import com.azure.resourcemanager.orbital.models.EndPoint; +import com.azure.resourcemanager.orbital.models.Polarization; +import com.azure.resourcemanager.orbital.models.Protocol; +import java.util.Arrays; + +/** Samples for ContactProfiles CreateOrUpdate. */ +public final class ContactProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileCreate.json + */ + /** + * Sample code: Create a contact profile. + * + * @param manager Entry point to OrbitalManager. + */ + public static void createAContactProfile(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .contactProfiles() + .define("AQUA_DIRECTPLAYBACK_WITH_UPLINK") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withMinimumViableContactDuration("PT1M") + .withMinimumElevationDegrees(10.0f) + .withAutoTrackingConfiguration(AutoTrackingConfiguration.X_BAND) + .withLinks( + Arrays + .asList( + new ContactProfileLink() + .withPolarization(Polarization.RHCP) + .withDirection(Direction.UPLINK) + .withGainOverTemperature(0.0f) + .withEirpdBW(45.0f) + .withChannels( + Arrays + .asList( + new ContactProfileLinkChannel() + .withCenterFrequencyMHz(2106.4063f) + .withBandwidthMHz(0.036f) + .withEndPoint( + new EndPoint() + .withIpAddress("10.0.1.0") + .withEndPointName("AQUA_command") + .withPort("4000") + .withProtocol(Protocol.TCP)) + .withModulationConfiguration("AQUA_UPLINK_BPSK") + .withDemodulationConfiguration("na") + .withEncodingConfiguration("AQUA_CMD_CCSDS") + .withDecodingConfiguration("na"))), + new ContactProfileLink() + .withPolarization(Polarization.RHCP) + .withDirection(Direction.DOWNLINK) + .withGainOverTemperature(25.0f) + .withEirpdBW(0.0f) + .withChannels( + Arrays + .asList( + new ContactProfileLinkChannel() + .withCenterFrequencyMHz(8160f) + .withBandwidthMHz(150f) + .withEndPoint( + new EndPoint() + .withIpAddress("10.0.2.0") + .withEndPointName("AQUA_directplayback") + .withPort("4000") + .withProtocol(Protocol.TCP)) + .withModulationConfiguration("na") + .withDemodulationConfiguration("AQUA_DOWNLINK_QPSK") + .withEncodingConfiguration("na") + .withDecodingConfiguration("AQUA_DIRECTPLAYBACK_CCSDS"))))) + .create(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesDeleteSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesDeleteSamples.java new file mode 100644 index 0000000000000..6ee043bdc1159 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for ContactProfiles Delete. */ +public final class ContactProfilesDeleteSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileDelete.json + */ + /** + * Sample code: Delete Contact Profile. + * + * @param manager Entry point to OrbitalManager. + */ + public static void deleteContactProfile(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().delete("rg1", "AQUA_DIRECTPLAYBACK_WITH_UPLINK", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesGetByResourceGroupSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..89eb820a670e3 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for ContactProfiles GetByResourceGroup. */ +public final class ContactProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileGet.json + */ + /** + * Sample code: Get a contact profile. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getAContactProfile(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .contactProfiles() + .getByResourceGroupWithResponse("rg1", "AQUA_DIRECTPLAYBACK_WITH_UPLINK", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListByResourceGroupSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..be27c22bb6888 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for ContactProfiles ListByResourceGroup. */ +public final class ContactProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfilesByResourceGroupList.json + */ + /** + * Sample code: List of Contact Profiles by Resource Group. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContactProfilesByResourceGroup(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListSamples.java new file mode 100644 index 0000000000000..f51ed333ee3d4 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for ContactProfiles List. */ +public final class ContactProfilesListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfilesBySubscriptionList.json + */ + /** + * Sample code: List of Contact Profiles by Subscription. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContactProfilesBySubscription(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().list(Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesUpdateTagsSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesUpdateTagsSamples.java new file mode 100644 index 0000000000000..9f8b4e3d54a9f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesUpdateTagsSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.ContactProfile; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContactProfiles UpdateTags. */ +public final class ContactProfilesUpdateTagsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileUpdateTag.json + */ + /** + * Sample code: Update Contact Profile tags. + * + * @param manager Entry point to OrbitalManager. + */ + public static void updateContactProfileTags(com.azure.resourcemanager.orbital.OrbitalManager manager) { + ContactProfile resource = + manager + .contactProfiles() + .getByResourceGroupWithResponse("rg1", "AQUA_DIRECTPLAYBACK_WITH_UPLINK", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map 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; + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsCreateSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsCreateSamples.java new file mode 100644 index 0000000000000..18f5949035b7e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsCreateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.resourcemanager.orbital.models.ResourceReference; +import java.time.OffsetDateTime; + +/** Samples for Contacts Create. */ +public final class ContactsCreateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactCreate.json + */ + /** + * Sample code: Create a contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void createAContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .contacts() + .define("contact1") + .withExistingSpacecraft("rg1", "AQUA") + .withReservationStartTime(OffsetDateTime.parse("2020-07-16T20:35:00.00Z")) + .withReservationEndTime(OffsetDateTime.parse("2020-07-16T20:55:00.00Z")) + .withGroundStationName("westus_gs1") + .withContactProfile( + new ResourceReference() + .withId( + "/subscriptions/subId/resourceGroups/rg/Microsoft.Orbital/contactProfiles/AQUA_DIRECTPLAYBACK_WITH_UPLINK")) + .create(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsDeleteSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsDeleteSamples.java new file mode 100644 index 0000000000000..862f63a2fc389 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Contacts Delete. */ +public final class ContactsDeleteSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactDelete.json + */ + /** + * Sample code: Delete Contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void deleteContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().delete("rg1", "AQUA", "contact1", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsGetSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsGetSamples.java new file mode 100644 index 0000000000000..aba45b1789e41 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Contacts Get. */ +public final class ContactsGetSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactGet.json + */ + /** + * Sample code: Get Contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().getWithResponse("rg1", "AQUA", "contact1", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsListSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsListSamples.java new file mode 100644 index 0000000000000..121dd278bd102 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Contacts List. */ +public final class ContactsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactsBySpacecraftNameList.json + */ + /** + * Sample code: List of Contacts. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContacts(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().list("rg1", "AQUA", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsListSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..bdd98c2ba0879 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to OrbitalManager. + */ + public static void operationsList(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsCreateOrUpdateSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..246374629345e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.resourcemanager.orbital.models.Direction; +import com.azure.resourcemanager.orbital.models.Polarization; +import com.azure.resourcemanager.orbital.models.SpacecraftLink; +import java.util.Arrays; + +/** Samples for Spacecrafts CreateOrUpdate. */ +public final class SpacecraftsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftCreate.json + */ + /** + * Sample code: Create a spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void createASpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .spacecrafts() + .define("AQUA") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withNoradId("27424") + .withTitleLine("(AQUA)") + .withTleLine1("1 27424U 02022A 20195.59202355 .00000039 00000-0 18634-4 0 9991") + .withTleLine2("2 27424 98.2098 135.8486 0000176 28.4050 144.5909 14.57108832967671") + .withLinks( + Arrays + .asList( + new SpacecraftLink() + .withCenterFrequencyMHz(2106.4063f) + .withBandwidthMHz(0.036f) + .withDirection(Direction.UPLINK) + .withPolarization(Polarization.RHCP), + new SpacecraftLink() + .withCenterFrequencyMHz(8125f) + .withBandwidthMHz(150f) + .withDirection(Direction.DOWNLINK) + .withPolarization(Polarization.RHCP))) + .create(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsDeleteSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsDeleteSamples.java new file mode 100644 index 0000000000000..d80b1a21d4351 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Spacecrafts Delete. */ +public final class SpacecraftsDeleteSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftDelete.json + */ + /** + * Sample code: Delete Spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void deleteSpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().delete("rg1", "AQUA", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsGetByResourceGroupSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..7400ab63f0c8f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Spacecrafts GetByResourceGroup. */ +public final class SpacecraftsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftGet.json + */ + /** + * Sample code: Get Spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void getSpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().getByResourceGroupWithResponse("rg1", "AQUA", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListAvailableContactsSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListAvailableContactsSamples.java new file mode 100644 index 0000000000000..fb9a8723477d7 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListAvailableContactsSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.ResourceReference; +import java.time.OffsetDateTime; + +/** Samples for Spacecrafts ListAvailableContacts. */ +public final class SpacecraftsListAvailableContactsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableContactsList.json + */ + /** + * Sample code: List of Contact. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContact(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager + .spacecrafts() + .listAvailableContacts( + "rgName", + "AQUA", + new ContactParameters() + .withContactProfile( + new ResourceReference() + .withId( + "/subscriptions/subId/resourceGroups/rg/Microsoft.Orbital/contactProfiles/AQUA_DIRECTPLAYBACK_WITH_UPLINK")) + .withGroundStationName("westus_gs1") + .withStartTime(OffsetDateTime.parse("2020-07-16T05:40:21.00Z")) + .withEndTime(OffsetDateTime.parse("2020-07-17T23:49:40.00Z")), + Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListByResourceGroupSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..b5446ac11d5f2 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Spacecrafts ListByResourceGroup. */ +public final class SpacecraftsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftsByResourceGroupList.json + */ + /** + * Sample code: List of Spacecraft by Resource Group. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfSpacecraftByResourceGroup(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListSamples.java new file mode 100644 index 0000000000000..a928c6db10c67 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; + +/** Samples for Spacecrafts List. */ +public final class SpacecraftsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftsBySubscriptionList.json + */ + /** + * Sample code: List of Spacecraft by Subscription. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfSpacecraftBySubscription(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.spacecrafts().list(Context.NONE); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsUpdateTagsSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsUpdateTagsSamples.java new file mode 100644 index 0000000000000..677bad3222eb2 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsUpdateTagsSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.orbital.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.Spacecraft; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Spacecrafts UpdateTags. */ +public final class SpacecraftsUpdateTagsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftUpdateTags.json + */ + /** + * Sample code: Update Spacecraft tags. + * + * @param manager Entry point to OrbitalManager. + */ + public static void updateSpacecraftTags(com.azure.resourcemanager.orbital.OrbitalManager manager) { + Spacecraft resource = + manager.spacecrafts().getByResourceGroupWithResponse("rg1", "AQUA", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map 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; + } +} diff --git a/sdk/orbital/ci.yml b/sdk/orbital/ci.yml new file mode 100644 index 0000000000000..156b6221049f7 --- /dev/null +++ b/sdk/orbital/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.yml + - sdk/orbital/azure-resourcemanager-orbital/ + exclude: + - sdk/orbital/pom.xml + - sdk/orbital/azure-resourcemanager-orbital/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.yml + - sdk/orbital/azure-resourcemanager-orbital/ + exclude: + - sdk/orbital/pom.xml + - sdk/orbital/azure-resourcemanager-orbital/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: orbital + Artifacts: + - name: azure-resourcemanager-orbital + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerorbital diff --git a/sdk/orbital/pom.xml b/sdk/orbital/pom.xml new file mode 100644 index 0000000000000..2f8b69e5b15e0 --- /dev/null +++ b/sdk/orbital/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-orbital-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-orbital + + + +