From 1dc9b777bee1a8987f994a5b0790959c84b89adc Mon Sep 17 00:00:00 2001 From: xiaofeicao Date: Thu, 23 Jun 2022 12:01:34 +0800 Subject: [PATCH] codegen --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../azure-resourcemanager-orbital/README.md | 102 + .../azure-resourcemanager-orbital/SAMPLE.md | 576 +++++ .../azure-resourcemanager-orbital/pom.xml | 55 + .../orbital/OrbitalManager.java | 363 +++ .../fluent/AvailableGroundStationsClient.java | 68 + .../orbital/fluent/AzureOrbital.java | 88 + .../orbital/fluent/ContactProfilesClient.java | 285 +++ .../orbital/fluent/ContactsClient.java | 201 ++ .../orbital/fluent/OperationsClient.java | 38 + .../fluent/OperationsResultsClient.java | 70 + .../orbital/fluent/SpacecraftsClient.java | 309 +++ .../fluent/models/AvailableContactsInner.java | 86 + .../models/AvailableContactsProperties.java | 22 + .../models/AvailableGroundStationInner.java | 109 + .../AvailableGroundStationProperties.java | 65 + .../orbital/fluent/models/ContactInner.java | 282 +++ .../fluent/models/ContactProfileInner.java | 89 + .../models/ContactProfileProperties.java | 78 + .../fluent/models/ContactsProperties.java | 367 +++ .../orbital/fluent/models/OperationInner.java | 121 + .../fluent/models/OperationResultInner.java | 168 ++ .../fluent/models/SpacecraftInner.java | 210 ++ .../fluent/models/SpacecraftsProperties.java | 190 ++ .../orbital/fluent/models/package-info.java | 6 + .../orbital/fluent/package-info.java | 6 + .../implementation/AvailableContactsImpl.java | 37 + .../AvailableGroundStationImpl.java | 44 + .../AvailableGroundStationsClientImpl.java | 461 ++++ .../AvailableGroundStationsImpl.java | 70 + .../implementation/AzureOrbitalBuilder.java | 142 ++ .../implementation/AzureOrbitalImpl.java | 360 +++ .../orbital/implementation/ContactImpl.java | 198 ++ .../implementation/ContactProfileImpl.java | 183 ++ .../ContactProfilesClientImpl.java | 1652 ++++++++++++++ .../implementation/ContactProfilesImpl.java | 175 ++ .../implementation/ContactsClientImpl.java | 1129 ++++++++++ .../orbital/implementation/ContactsImpl.java | 188 ++ .../orbital/implementation/OperationImpl.java | 50 + .../implementation/OperationResultImpl.java | 63 + .../implementation/OperationsClientImpl.java | 179 ++ .../implementation/OperationsImpl.java | 45 + .../OperationsResultsClientImpl.java | 306 +++ .../implementation/OperationsResultsImpl.java | 52 + .../implementation/SpacecraftImpl.java | 252 +++ .../implementation/SpacecraftsClientImpl.java | 1970 +++++++++++++++++ .../implementation/SpacecraftsImpl.java | 187 ++ .../orbital/implementation/Utils.java | 204 ++ .../orbital/implementation/package-info.java | 6 + .../orbital/models/ActionType.java | 35 + .../models/AuthorizedGroundstation.java | 73 + .../models/AutoTrackingConfiguration.java | 50 + .../orbital/models/AvailableContacts.java | 31 + .../models/AvailableContactsListResult.java | 66 + .../models/AvailableContactsSpacecraft.java | 28 + .../models/AvailableGroundStation.java | 45 + .../AvailableGroundStationListResult.java | 66 + ...eGroundStationPropertiesAutoGenerated.java | 176 ++ .../models/AvailableGroundStations.java | 60 + .../orbital/models/CapabilityParameter.java | 38 + .../orbital/models/Contact.java | 280 +++ .../models/ContactInstanceProperties.java | 156 ++ .../orbital/models/ContactListResult.java | 66 + .../orbital/models/ContactParameters.java | 152 ++ .../ContactParametersContactProfile.java | 28 + .../orbital/models/ContactProfile.java | 214 ++ .../orbital/models/ContactProfileLink.java | 208 ++ .../models/ContactProfileLinkChannel.java | 258 +++ .../models/ContactProfileListResult.java | 66 + .../orbital/models/ContactProfiles.java | 164 ++ .../models/ContactProfilesProperties.java | 236 ++ ...rofilesPropertiesNetworkConfiguration.java | 61 + ...ctProfilesPropertiesProvisioningState.java | 51 + .../orbital/models/Contacts.java | 146 ++ ...ontactsPropertiesAntennaConfiguration.java | 76 + .../ContactsPropertiesContactProfile.java | 28 + .../ContactsPropertiesProvisioningState.java | 51 + .../orbital/models/ContactsStatus.java | 47 + .../orbital/models/Direction.java | 38 + .../orbital/models/EndPoint.java | 146 ++ .../orbital/models/Operation.java | 56 + .../orbital/models/OperationDisplay.java | 89 + .../orbital/models/OperationListResult.java | 58 + .../orbital/models/OperationResult.java | 74 + .../OperationResultErrorProperties.java | 50 + .../orbital/models/Operations.java | 33 + .../orbital/models/OperationsResults.java | 35 + .../orbital/models/Origin.java | 41 + .../orbital/models/Polarization.java | 44 + .../orbital/models/Protocol.java | 38 + .../orbital/models/ReleaseMode.java | 38 + .../orbital/models/ResourceReference.java | 46 + .../orbital/models/Spacecraft.java | 343 +++ .../orbital/models/SpacecraftLink.java | 187 ++ .../orbital/models/SpacecraftListResult.java | 66 + .../orbital/models/Spacecrafts.java | 195 ++ ...pacecraftsPropertiesProvisioningState.java | 51 + .../orbital/models/Status.java | 44 + .../orbital/models/TagsObject.java | 49 + .../orbital/models/package-info.java | 6 + .../resourcemanager/orbital/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../AvailableGroundStationsGetSamples.java | 22 + .../AvailableGroundStationsListSamples.java | 23 + .../ContactProfilesCreateOrUpdateSamples.java | 25 + .../ContactProfilesDeleteSamples.java | 22 + ...tactProfilesGetByResourceGroupSamples.java | 22 + ...actProfilesListByResourceGroupSamples.java | 22 + .../generated/ContactProfilesListSamples.java | 22 + .../ContactProfilesUpdateTagsSamples.java | 41 + .../generated/ContactsCreateSamples.java | 34 + .../generated/ContactsDeleteSamples.java | 22 + .../orbital/generated/ContactsGetSamples.java | 22 + .../generated/ContactsListSamples.java | 22 + .../generated/OperationsListSamples.java | 22 + .../OperationsResultsGetSamples.java | 22 + .../SpacecraftsCreateOrUpdateSamples.java | 49 + .../generated/SpacecraftsDeleteSamples.java | 22 + .../SpacecraftsGetByResourceGroupSamples.java | 22 + ...acecraftsListAvailableContactsSamples.java | 38 + ...SpacecraftsListByResourceGroupSamples.java | 22 + .../generated/SpacecraftsListSamples.java | 22 + .../SpacecraftsUpdateTagsSamples.java | 38 + sdk/orbital/ci.yml | 47 + sdk/orbital/pom.xml | 15 + 127 files changed, 17240 insertions(+) create mode 100644 sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md create mode 100644 sdk/orbital/azure-resourcemanager-orbital/README.md create mode 100644 sdk/orbital/azure-resourcemanager-orbital/SAMPLE.md create mode 100644 sdk/orbital/azure-resourcemanager-orbital/pom.xml create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/OrbitalManager.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AvailableGroundStationsClient.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AzureOrbital.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactProfilesClient.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactsClient.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsClient.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsResultsClient.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/SpacecraftsClient.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactsProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationResultInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftInner.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftsProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/package-info.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/package-info.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableContactsImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsClientImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalBuilder.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfileImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesClientImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsClientImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationResultImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsClientImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsClientImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsClientImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsImpl.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/Utils.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/package-info.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ActionType.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AuthorizedGroundstation.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AutoTrackingConfiguration.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContacts.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsListResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsSpacecraft.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStation.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationListResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationPropertiesAutoGenerated.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStations.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/CapabilityParameter.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contact.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactInstanceProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactListResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParameters.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParametersContactProfile.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfile.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLink.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLinkChannel.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileListResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfiles.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesNetworkConfiguration.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesProvisioningState.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contacts.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesAntennaConfiguration.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesContactProfile.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesProvisioningState.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsStatus.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Direction.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/EndPoint.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operation.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationDisplay.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationListResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResultErrorProperties.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operations.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationsResults.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Origin.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Polarization.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Protocol.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ReleaseMode.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ResourceReference.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecraft.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftLink.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftListResult.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecrafts.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftsPropertiesProvisioningState.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Status.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/TagsObject.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/package-info.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/package-info.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/main/java/module-info.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsGetSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/AvailableGroundStationsListSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesCreateOrUpdateSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesDeleteSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesGetByResourceGroupSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListByResourceGroupSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesListSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesUpdateTagsSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsCreateSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsDeleteSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsGetSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactsListSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsListSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsResultsGetSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsCreateOrUpdateSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsDeleteSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsGetByResourceGroupSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListAvailableContactsSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListByResourceGroupSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsListSamples.java create mode 100644 sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsUpdateTagsSamples.java create mode 100644 sdk/orbital/ci.yml create mode 100644 sdk/orbital/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f0148f54383b7..61fd1ce482947 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -351,6 +351,7 @@ com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-deviceupdate;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-machinelearning;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-education;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 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 694e863fcd222..f56f4e225eb53 100644 --- a/pom.xml +++ b/pom.xml @@ -944,6 +944,7 @@ sdk/notificationhubs sdk/oep sdk/operationsmanagement + sdk/orbital sdk/parents sdk/peering sdk/policyinsights diff --git a/sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md b/sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md new file mode 100644 index 0000000000000..03c11800a9170 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-06-23) + +- Azure Resource Manager orbital client library for Java. This package contains Microsoft Azure SDK for orbital Management SDK. Azure Orbital service. Package tag package-2022-03-01. 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..1d3f9bfe894fd --- /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-2022-03-01. 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..f1686511b5932 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/SAMPLE.md @@ -0,0 +1,576 @@ +# 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) + +## OperationsResults + +- [Get](#operationsresults_get) + +## 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/stable/2022-03-01/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("EASTUS2_0", Context.NONE); + } +} +``` + +### AvailableGroundStations_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.CapabilityParameter; + +/** Samples for AvailableGroundStations List. */ +public final class AvailableGroundStationsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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(CapabilityParameter.EARTH_OBSERVATION, Context.NONE); + } +} +``` + +### ContactProfiles_CreateOrUpdate + +```java +/** Samples for ContactProfiles CreateOrUpdate. */ +public final class ContactProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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("CONTOSO-CP") + .withRegion("eastus2") + .withExistingResourceGroup("contoso-Rgp") + .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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO-CP", 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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO-CP", 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/stable/2022-03-01/examples/ContactProfilesBySubscriptionList.json + */ + /** + * Sample code: List of Contact Profiles. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContactProfiles(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().list("opaqueString", 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/stable/2022-03-01/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("contoso-Rgp", "opaqueString", 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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO-CP", 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.ContactsPropertiesContactProfile; +import java.time.OffsetDateTime; + +/** Samples for Contacts Create. */ +public final class ContactsCreateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT") + .withReservationStartTime(OffsetDateTime.parse("2022-03-02T10:58:30Z")) + .withReservationEndTime(OffsetDateTime.parse("2022-03-02T11:10:45Z")) + .withGroundStationName("EASTUS2_0") + .withContactProfile( + new ContactsPropertiesContactProfile() + .withId( + "/subscriptions/c1be1141-a7c9-4aac-9608-3c2e2f1152c3/resourceGroups/contoso-Rgp/providers/Microsoft.Orbital/contactProfiles/CONTOSO-CP")) + .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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", "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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", "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/stable/2022-03-01/examples/ContactsBySpacecraftNameList.json + */ + /** + * Sample code: List of Spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfSpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().list("contoso-Rgp", "CONTOSO_SAT", "opaqueString", 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/stable/2022-03-01/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); + } +} +``` + +### OperationsResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationsResults Get. */ +public final class OperationsResultsGetSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/examples/OperationResultsGet.json + */ + /** + * Sample code: KustoOperationResultsGet. + * + * @param manager Entry point to OrbitalManager. + */ + public static void kustoOperationResultsGet(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.operationsResults().get("eastus2", "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", 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/stable/2022-03-01/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("CONTOSO_SAT") + .withRegion("eastus2") + .withExistingResourceGroup("contoso-Rgp") + .withNoradId("36411") + .withTitleLine("CONTOSO_SAT") + .withTleLine1("1 27424U 02022A 22167.05119303 .00000638 00000+0 15103-3 0 9994") + .withTleLine2("2 27424 98.2477 108.9546 0000928 92.9194 327.0802 14.57300770 69982") + .withLinks( + Arrays + .asList( + new SpacecraftLink() + .withName("uplink_lhcp1") + .withCenterFrequencyMHz(2250f) + .withBandwidthMHz(2f) + .withDirection(Direction.UPLINK) + .withPolarization(Polarization.LHCP), + new SpacecraftLink() + .withName("downlink_rhcp1") + .withCenterFrequencyMHz(8160f) + .withBandwidthMHz(15f) + .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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", 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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", 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/stable/2022-03-01/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("opaqueString", Context.NONE); + } +} +``` + +### Spacecrafts_ListAvailableContacts + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.ContactParametersContactProfile; +import java.time.OffsetDateTime; + +/** Samples for Spacecrafts ListAvailableContacts. */ +public final class SpacecraftsListAvailableContactsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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( + "contoso-Rgp", + "CONTOSO_SAT", + new ContactParameters() + .withContactProfile( + new ContactParametersContactProfile() + .withId( + "/subscriptions/c1be1141-a7c9-4aac-9608-3c2e2f1152c3/resourceGroups/contoso-Rgp/providers/Microsoft.Orbital/contactProfiles/CONTOSO-CP")) + .withGroundStationName("EASTUS2_0") + .withStartTime(OffsetDateTime.parse("2022-03-01T11:30:00Z")) + .withEndTime(OffsetDateTime.parse("2022-03-02T11:30: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/stable/2022-03-01/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("contoso-Rgp", "opaqueString", 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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", 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..6db83fb498465 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/pom.xml @@ -0,0 +1,55 @@ + + 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-2022-03-01. + 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 + + + + com.azure + azure-core + 1.29.1 + + + com.azure + azure-core-management + 1.6.2 + + + 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..0cd3bb15e158f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/OrbitalManager.java @@ -0,0 +1,363 @@ +// 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.AddHeadersFromContextPolicy; +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.RetryOptions; +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.OperationsResultsImpl; +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.OperationsResults; +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 OperationsResults operationsResults; + + 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); + } + + /** + * Creates an instance of orbital service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the orbital service API instance. + */ + public static OrbitalManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new OrbitalManager(httpPipeline, profile, null); + } + + /** + * 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 static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' 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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Spacecrafts. It manages Spacecraft. + * + * @return Resource collection API of Spacecrafts. + */ + public Spacecrafts spacecrafts() { + if (this.spacecrafts == null) { + this.spacecrafts = new SpacecraftsImpl(clientObject.getSpacecrafts(), this); + } + return spacecrafts; + } + + /** + * Gets the resource collection API of Contacts. It manages Contact. + * + * @return Resource collection API of Contacts. + */ + public Contacts contacts() { + if (this.contacts == null) { + this.contacts = new ContactsImpl(clientObject.getContacts(), this); + } + return contacts; + } + + /** + * Gets the resource collection API of ContactProfiles. It manages ContactProfile. + * + * @return Resource collection API of ContactProfiles. + */ + public ContactProfiles contactProfiles() { + if (this.contactProfiles == null) { + this.contactProfiles = new ContactProfilesImpl(clientObject.getContactProfiles(), this); + } + return contactProfiles; + } + + /** + * Gets the resource collection API of AvailableGroundStations. + * + * @return Resource collection API of AvailableGroundStations. + */ + public AvailableGroundStations availableGroundStations() { + if (this.availableGroundStations == null) { + this.availableGroundStations = + new AvailableGroundStationsImpl(clientObject.getAvailableGroundStations(), this); + } + return availableGroundStations; + } + + /** + * Gets the resource collection API of OperationsResults. + * + * @return Resource collection API of OperationsResults. + */ + public OperationsResults operationsResults() { + if (this.operationsResults == null) { + this.operationsResults = new OperationsResultsImpl(clientObject.getOperationsResults(), this); + } + return operationsResults; + } + + /** + * @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..9f44a2f7bdb8d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AvailableGroundStationsClient.java @@ -0,0 +1,68 @@ +// 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.CapabilityParameter; + +/** 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(CapabilityParameter 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(CapabilityParameter 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 along with {@link Response}. + */ + @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..9d3b1f5090c9c --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/AzureOrbital.java @@ -0,0 +1,88 @@ +// 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(); + + /** + * Gets the OperationsResultsClient object to access its operations. + * + * @return the OperationsResultsClient object. + */ + OperationsResultsClient getOperationsResults(); +} 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..7e1ea9db7d460 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactProfilesClient.java @@ -0,0 +1,285 @@ +// 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 along with {@link Response}. + */ + @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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 the {@link SyncPoller} for polling of 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> beginUpdateTags( + 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 the {@link SyncPoller} for polling of 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> beginUpdateTags( + String resourceGroupName, String contactProfileName, TagsObject parameters, 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) + ContactProfileInner updateTags( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context); + + /** + * Returns list of contact profiles by Subscription. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns list of contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String skiptoken, Context context); + + /** + * Returns list of contact profiles by Resource Group. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns list of contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, 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..74c9c48a11109 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/ContactsClient.java @@ -0,0 +1,201 @@ +// 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 as paginated response with {@link PagedIterable}. + */ + @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 skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String spacecraftName, String skiptoken, 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 along with {@link Response}. + */ + @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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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..471c2f0b98df4 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsClient.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.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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsResultsClient.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsResultsClient.java new file mode 100644 index 0000000000000..3efc7d95e740f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/OperationsResultsClient.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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.OperationResultInner; + +/** An instance of this class provides access to all the operations defined in OperationsResultsClient. */ +public interface OperationsResultsClient { + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 {@link SyncPoller} for polling of operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationResultInner> beginGet(String location, String operationId); + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 {@link SyncPoller} for polling of operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationResultInner> beginGet( + String location, String operationId, Context context); + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultInner get(String location, String operationId); + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultInner get(String location, String operationId, 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..8e64e6d17f00b --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/SpacecraftsClient.java @@ -0,0 +1,309 @@ +// 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.AvailableContactsInner; +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 { + /** + * Returns list of spacecrafts by subscription. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns list of spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String skiptoken, Context context); + + /** + * Returns list of spacecrafts by resource group. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns list of spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, 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 along with {@link Response}. + */ + @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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 the {@link SyncPoller} for polling of customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SpacecraftInner> beginUpdateTags( + 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 the {@link SyncPoller} for polling of customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SpacecraftInner> beginUpdateTags( + String resourceGroupName, String spacecraftName, TagsObject parameters, 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) + SpacecraftInner updateTags(String resourceGroupName, String spacecraftName, TagsObject parameters, Context context); + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters); + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable 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/AvailableContactsInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsInner.java new file mode 100644 index 0000000000000..eac7cecadeb66 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsInner.java @@ -0,0 +1,86 @@ +// 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.resourcemanager.orbital.models.AvailableContactsSpacecraft; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 AvailableContactsInner { + /* + * The reference to the spacecraft resource. + */ + @JsonProperty(value = "spacecraft") + private AvailableContactsSpacecraft 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 AvailableContactsProperties innerProperties; + + /** + * Get the spacecraft property: The reference to the spacecraft resource. + * + * @return the spacecraft value. + */ + public AvailableContactsSpacecraft spacecraft() { + return this.spacecraft; + } + + /** + * Set the spacecraft property: The reference to the spacecraft resource. + * + * @param spacecraft the spacecraft value to set. + * @return the AvailableContactsInner object itself. + */ + public AvailableContactsInner withSpacecraft(AvailableContactsSpacecraft 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 AvailableContactsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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/fluent/models/AvailableContactsProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsProperties.java new file mode 100644 index 0000000000000..2d6671ad1437e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableContactsProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.orbital.models.ContactInstanceProperties; + +/** Properties of Contact resource. */ +@Immutable +public final class AvailableContactsProperties extends ContactInstanceProperties { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.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..d26ecd5b50681 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationInner.java @@ -0,0 +1,109 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Ground Stations available to schedule Contacts. */ +@Fluent +public final class AvailableGroundStationInner { + /* + * 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; + } + + /** + * 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..fee216dfc23df --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/AvailableGroundStationProperties.java @@ -0,0 +1,65 @@ +// 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.resourcemanager.orbital.models.AvailableGroundStationPropertiesAutoGenerated; +import com.azure.resourcemanager.orbital.models.ReleaseMode; + +/** The properties bag for this resource. */ +@Fluent +public final class AvailableGroundStationProperties extends AvailableGroundStationPropertiesAutoGenerated { + /** {@inheritDoc} */ + @Override + public AvailableGroundStationProperties withCity(String city) { + super.withCity(city); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailableGroundStationProperties withProviderName(String providerName) { + super.withProviderName(providerName); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailableGroundStationProperties withLongitudeDegrees(Float longitudeDegrees) { + super.withLongitudeDegrees(longitudeDegrees); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailableGroundStationProperties withLatitudeDegrees(Float latitudeDegrees) { + super.withLatitudeDegrees(latitudeDegrees); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailableGroundStationProperties withAltitudeMeters(Float altitudeMeters) { + super.withAltitudeMeters(altitudeMeters); + return this; + } + + /** {@inheritDoc} */ + @Override + public AvailableGroundStationProperties withReleaseMode(ReleaseMode releaseMode) { + super.withReleaseMode(releaseMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.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..61f715efb2f85 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesAntennaConfiguration; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesContactProfile; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesProvisioningState; +import com.azure.resourcemanager.orbital.models.ContactsStatus; +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 { + /* + * 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 provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + public ContactsPropertiesProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @param provisioningState the provisioningState value to set. + * @return the ContactInner object itself. + */ + public ContactInner withProvisioningState(ContactsPropertiesProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new ContactsProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the status property: Status of a contact. + * + * @return the status value. + */ + public ContactsStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @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 antennaConfiguration property: The configuration associated with the allocated antenna. + * + * @return the antennaConfiguration value. + */ + public ContactsPropertiesAntennaConfiguration antennaConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().antennaConfiguration(); + } + + /** + * Get the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + public ContactsPropertiesContactProfile 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(ContactsPropertiesContactProfile 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/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..8a7205643357a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileInner.java @@ -0,0 +1,89 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * Properties of the contact profile resource. + */ + @JsonProperty(value = "properties") + private ContactProfileProperties 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 contact profile resource. + * + * @return the innerProperties value. + */ + private ContactProfileProperties 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; + } + + /** + * 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/ContactProfileProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileProperties.java new file mode 100644 index 0000000000000..4b6813e8c4fb5 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactProfileProperties.java @@ -0,0 +1,78 @@ +// 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.resourcemanager.orbital.models.AutoTrackingConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfileLink; +import com.azure.resourcemanager.orbital.models.ContactProfilesProperties; +import com.azure.resourcemanager.orbital.models.ContactProfilesPropertiesNetworkConfiguration; +import com.azure.resourcemanager.orbital.models.ContactProfilesPropertiesProvisioningState; +import java.util.List; + +/** Properties of the contact profile resource. */ +@Fluent +public final class ContactProfileProperties extends ContactProfilesProperties { + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withProvisioningState( + ContactProfilesPropertiesProvisioningState provisioningState) { + super.withProvisioningState(provisioningState); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withMinimumViableContactDuration(String minimumViableContactDuration) { + super.withMinimumViableContactDuration(minimumViableContactDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withMinimumElevationDegrees(Float minimumElevationDegrees) { + super.withMinimumElevationDegrees(minimumElevationDegrees); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withAutoTrackingConfiguration(AutoTrackingConfiguration autoTrackingConfiguration) { + super.withAutoTrackingConfiguration(autoTrackingConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withEventHubUri(String eventHubUri) { + super.withEventHubUri(eventHubUri); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withNetworkConfiguration( + ContactProfilesPropertiesNetworkConfiguration networkConfiguration) { + super.withNetworkConfiguration(networkConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContactProfileProperties withLinks(List links) { + super.withLinks(links); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.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..23ad745e3b238 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/ContactsProperties.java @@ -0,0 +1,367 @@ +// 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.ContactsPropertiesAntennaConfiguration; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesContactProfile; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesProvisioningState; +import com.azure.resourcemanager.orbital.models.ContactsStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of the Contact Resource. */ +@Fluent +public final class ContactsProperties { + /* + * The current state of the resource's creation, deletion, or modification. + */ + @JsonProperty(value = "provisioningState") + private ContactsPropertiesProvisioningState provisioningState; + + /* + * Status of a contact. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ContactsStatus status; + + /* + * Reservation start time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "reservationStartTime", required = true) + private OffsetDateTime reservationStartTime; + + /* + * Reservation end time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "reservationEndTime", required = true) + private OffsetDateTime reservationEndTime; + + /* + * Receive start time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "rxStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxStartTime; + + /* + * Receive end time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "rxEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxEndTime; + + /* + * Transmit start time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "txStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txStartTime; + + /* + * Transmit end time of a contact (ISO 8601 UTC standard). + */ + @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 configuration associated with the allocated antenna. + */ + @JsonProperty(value = "antennaConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private ContactsPropertiesAntennaConfiguration antennaConfiguration; + + /* + * The reference to the contact profile resource. + */ + @JsonProperty(value = "contactProfile", required = true) + private ContactsPropertiesContactProfile contactProfile; + + /** + * Get the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + public ContactsPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @param provisioningState the provisioningState value to set. + * @return the ContactsProperties object itself. + */ + public ContactsProperties withProvisioningState(ContactsPropertiesProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the status property: Status of a contact. + * + * @return the status value. + */ + public ContactsStatus status() { + return this.status; + } + + /** + * Get the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard). + * + * @return the reservationStartTime value. + */ + public OffsetDateTime reservationStartTime() { + return this.reservationStartTime; + } + + /** + * Set the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @return the reservationEndTime value. + */ + public OffsetDateTime reservationEndTime() { + return this.reservationEndTime; + } + + /** + * Set the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @return the rxStartTime value. + */ + public OffsetDateTime rxStartTime() { + return this.rxStartTime; + } + + /** + * Get the rxEndTime property: Receive end time of a contact (ISO 8601 UTC standard). + * + * @return the rxEndTime value. + */ + public OffsetDateTime rxEndTime() { + return this.rxEndTime; + } + + /** + * Get the txStartTime property: Transmit start time of a contact (ISO 8601 UTC standard). + * + * @return the txStartTime value. + */ + public OffsetDateTime txStartTime() { + return this.txStartTime; + } + + /** + * Get the txEndTime property: Transmit end time of a contact (ISO 8601 UTC standard). + * + * @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 antennaConfiguration property: The configuration associated with the allocated antenna. + * + * @return the antennaConfiguration value. + */ + public ContactsPropertiesAntennaConfiguration antennaConfiguration() { + return this.antennaConfiguration; + } + + /** + * Get the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + public ContactsPropertiesContactProfile 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(ContactsPropertiesContactProfile 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 (antennaConfiguration() != null) { + antennaConfiguration().validate(); + } + if (contactProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contactProfile in model ContactsProperties")); + } else { + contactProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactsProperties.class); +} 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..1dd02237882b1 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationInner.java @@ -0,0 +1,121 @@ +// 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.resourcemanager.orbital.models.ActionType; +import com.azure.resourcemanager.orbital.models.OperationDisplay; +import com.azure.resourcemanager.orbital.models.Origin; +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 { + /* + * 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/OperationResultInner.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationResultInner.java new file mode 100644 index 0000000000000..9d40f139d82c2 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/OperationResultInner.java @@ -0,0 +1,168 @@ +// 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.resourcemanager.orbital.models.OperationResultErrorProperties; +import com.azure.resourcemanager.orbital.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation Result Entity. */ +@Fluent +public final class OperationResultInner { + /* + * ID of the resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The status of operation. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The operation start time (ISO 8601 UTC standard). + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The operation end time (ISO 8601 UTC standard). + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * Percentage completed. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Double percentComplete; + + /* + * Operation result properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * Operation result error properties. + */ + @JsonProperty(value = "error") + private OperationResultErrorProperties error; + + /** + * Get the id property: ID of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: The status of operation. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the startTime property: The operation start time (ISO 8601 UTC standard). + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The operation end time (ISO 8601 UTC standard). + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the percentComplete property: Percentage completed. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the properties property: Operation result properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Operation result properties. + * + * @param properties the properties value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the error property: Operation result error properties. + * + * @return the error value. + */ + public OperationResultErrorProperties error() { + return this.error; + } + + /** + * Set the error property: Operation result error properties. + * + * @param error the error value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withError(OperationResultErrorProperties error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().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..a9207109e0b0f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftInner.java @@ -0,0 +1,210 @@ +// 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.resourcemanager.orbital.models.SpacecraftLink; +import com.azure.resourcemanager.orbital.models.SpacecraftsPropertiesProvisioningState; +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 { + /* + * 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 provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + public SpacecraftsPropertiesProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @param provisioningState the provisioningState value to set. + * @return the SpacecraftInner object itself. + */ + public SpacecraftInner withProvisioningState(SpacecraftsPropertiesProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new SpacecraftsProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + 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 titleLine property: Title line of the two-line element set (TLE). + * + * @return the titleLine value. + */ + public String titleLine() { + return this.innerProperties() == null ? null : this.innerProperties().titleLine(); + } + + /** + * Set the titleLine property: Title line of the two-line element set (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 the two-line element set (TLE). + * + * @return the tleLine1 value. + */ + public String tleLine1() { + return this.innerProperties() == null ? null : this.innerProperties().tleLine1(); + } + + /** + * Set the tleLine1 property: Line 1 of the two-line element set (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 the two-line element set (TLE). + * + * @return the tleLine2 value. + */ + public String tleLine2() { + return this.innerProperties() == null ? null : this.innerProperties().tleLine2(); + } + + /** + * Set the tleLine2 property: Line 2 of the two-line element set (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: Immutable list of Spacecraft links. + * + * @return the links value. + */ + public List links() { + return this.innerProperties() == null ? null : this.innerProperties().links(); + } + + /** + * Set the links property: Immutable list of Spacecraft links. + * + * @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..fc2152ffd582d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/fluent/models/SpacecraftsProperties.java @@ -0,0 +1,190 @@ +// 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.SpacecraftLink; +import com.azure.resourcemanager.orbital.models.SpacecraftsPropertiesProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Spacecraft Resource Properties. */ +@Fluent +public final class SpacecraftsProperties { + /* + * The current state of the resource's creation, deletion, or modification. + */ + @JsonProperty(value = "provisioningState") + private SpacecraftsPropertiesProvisioningState provisioningState; + + /* + * NORAD ID of the spacecraft. + */ + @JsonProperty(value = "noradId", required = true) + private String noradId; + + /* + * Title line of the two-line element set (TLE). + */ + @JsonProperty(value = "titleLine") + private String titleLine; + + /* + * Line 1 of the two-line element set (TLE). + */ + @JsonProperty(value = "tleLine1") + private String tleLine1; + + /* + * Line 2 of the two-line element set (TLE). + */ + @JsonProperty(value = "tleLine2") + private String tleLine2; + + /* + * Immutable list of Spacecraft links. + */ + @JsonProperty(value = "links") + private List links; + + /** + * Get the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + public SpacecraftsPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @param provisioningState the provisioningState value to set. + * @return the SpacecraftsProperties object itself. + */ + public SpacecraftsProperties withProvisioningState(SpacecraftsPropertiesProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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 titleLine property: Title line of the two-line element set (TLE). + * + * @return the titleLine value. + */ + public String titleLine() { + return this.titleLine; + } + + /** + * Set the titleLine property: Title line of the two-line element set (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 the two-line element set (TLE). + * + * @return the tleLine1 value. + */ + public String tleLine1() { + return this.tleLine1; + } + + /** + * Set the tleLine1 property: Line 1 of the two-line element set (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 the two-line element set (TLE). + * + * @return the tleLine2 value. + */ + public String tleLine2() { + return this.tleLine2; + } + + /** + * Set the tleLine2 property: Line 2 of the two-line element set (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: Immutable list of Spacecraft links. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: Immutable list of Spacecraft links. + * + * @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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SpacecraftsProperties.class); +} 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/AvailableContactsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableContactsImpl.java new file mode 100644 index 0000000000000..39f2315c90f4a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableContactsImpl.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.implementation; + +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsInner; +import com.azure.resourcemanager.orbital.models.AvailableContacts; +import com.azure.resourcemanager.orbital.models.AvailableContactsSpacecraft; + +public final class AvailableContactsImpl implements AvailableContacts { + private AvailableContactsInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + AvailableContactsImpl( + AvailableContactsInner innerObject, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public AvailableContactsSpacecraft spacecraft() { + return this.innerModel().spacecraft(); + } + + public String groundStationName() { + return this.innerModel().groundStationName(); + } + + public AvailableContactsInner 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..bd0e3d2801e58 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationImpl.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.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 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..8c610bdcc3f50 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsClientImpl.java @@ -0,0 +1,461 @@ +// 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.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.CapabilityParameter; +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 { + /** 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") CapabilityParameter 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(CapabilityParameter 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + CapabilityParameter 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(CapabilityParameter 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(CapabilityParameter 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(CapabilityParameter 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(CapabilityParameter 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groundStationName) { + return getWithResponseAsync(groundStationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..3b290a4f98cd5 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AvailableGroundStationsImpl.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.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.CapabilityParameter; + +public final class AvailableGroundStationsImpl implements AvailableGroundStations { + private static 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(CapabilityParameter capability) { + PagedIterable inner = this.serviceClient().list(capability); + return Utils.mapPage(inner, inner1 -> new AvailableGroundStationImpl(inner1, this.manager())); + } + + public PagedIterable list(CapabilityParameter 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..a7fafa39f7307 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalBuilder.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.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.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 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 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 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 (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + 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..b73d7e1487746 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/AzureOrbitalImpl.java @@ -0,0 +1,360 @@ +// 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.CoreUtils; +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.OperationsResultsClient; +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 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 { + /** 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; + } + + /** The OperationsResultsClient object to access its operations. */ + private final OperationsResultsClient operationsResults; + + /** + * Gets the OperationsResultsClient object to access its operations. + * + * @return the OperationsResultsClient object. + */ + public OperationsResultsClient getOperationsResults() { + return this.operationsResults; + } + + /** + * 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 = "2022-03-01"; + 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); + this.operationsResults = new OperationsResultsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureOrbitalImpl.class); +} 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..247520c781cae --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactImpl.java @@ -0,0 +1,198 @@ +// 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.ContactsPropertiesAntennaConfiguration; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesContactProfile; +import com.azure.resourcemanager.orbital.models.ContactsPropertiesProvisioningState; +import com.azure.resourcemanager.orbital.models.ContactsStatus; +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 ContactsPropertiesProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ContactsStatus 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 ContactsPropertiesAntennaConfiguration antennaConfiguration() { + return this.innerModel().antennaConfiguration(); + } + + public ContactsPropertiesContactProfile 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 withProvisioningState(ContactsPropertiesProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + 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(ContactsPropertiesContactProfile 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..85ed0ad1a9c6f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfileImpl.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.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.ContactProfile; +import com.azure.resourcemanager.orbital.models.TagsObject; +import java.util.Collections; +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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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() + .updateTags(resourceGroupName, contactProfileName, updateParameters, Context.NONE); + return this; + } + + public ContactProfile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContactProfiles() + .updateTags(resourceGroupName, contactProfileName, updateParameters, context); + 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; + } + } + + 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..4849a0f87b3bd --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesClientImpl.java @@ -0,0 +1,1652 @@ +// 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.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 { + /** 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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("contactProfileName") String contactProfileName, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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, + @QueryParam("$skiptoken") String skiptoken, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skiptoken") String skiptoken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contactProfileName, + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + contactProfileName, + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String contactProfileName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, contactProfileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 the {@link PollerFlux} for polling of 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 {@link PollerFlux} for polling of long-running operation. + */ + @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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 the {@link PollerFlux} for polling of 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> beginUpdateTagsAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, contactProfileName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContactProfileInner.class, + ContactProfileInner.class, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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> beginUpdateTagsAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, contactProfileName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContactProfileInner.class, ContactProfileInner.class, 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 the {@link SyncPoller} for polling of 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> beginUpdateTags( + String resourceGroupName, String contactProfileName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, contactProfileName, parameters).getSyncPoller(); + } + + /** + * 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 the {@link SyncPoller} for polling of 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> beginUpdateTags( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, contactProfileName, parameters, context).getSyncPoller(); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, contactProfileName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, contactProfileName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ContactProfileInner updateTags( + String resourceGroupName, String contactProfileName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, contactProfileName, parameters, context).block(); + } + + /** + * Returns list of contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skiptoken) { + 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(), + skiptoken, + 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 contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skiptoken, 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(), + skiptoken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skiptoken) { + return new PagedFlux<>( + () -> listSinglePageAsync(skiptoken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of contact profiles by Subscription. + * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String skiptoken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(skiptoken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skiptoken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(skiptoken, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of contact profiles by Subscription. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String skiptoken = null; + return new PagedIterable<>(listAsync(skiptoken)); + } + + /** + * Returns list of contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String skiptoken, Context context) { + return new PagedIterable<>(listAsync(skiptoken, context)); + } + + /** + * Returns list of contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String skiptoken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skiptoken, + 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 contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String skiptoken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skiptoken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skiptoken) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of contact profiles by Resource Group. + * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String skiptoken = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String skiptoken, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of contact profiles by Resource Group. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String skiptoken = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skiptoken)); + } + + /** + * Returns list of contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String skiptoken, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skiptoken, context)); + } + + /** + * 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 ListContactProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 ListContactProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ListContactProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 ListContactProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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/ContactProfilesImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesImpl.java new file mode 100644 index 0000000000000..d45311cbb41c7 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactProfilesImpl.java @@ -0,0 +1,175 @@ +// 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; + +public final class ContactProfilesImpl implements ContactProfiles { + private static 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(String skiptoken, Context context) { + PagedIterable inner = this.serviceClient().list(skiptoken, 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, String skiptoken, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, skiptoken, 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..5b46bc3a0f4c7 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsClientImpl.java @@ -0,0 +1,1129 @@ +// 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.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 { + /** 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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @QueryParam("$skiptoken") String skiptoken, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @PathParam("contactName") String contactName, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @PathParam("contactName") String contactName, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @PathParam("contactName") String contactName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @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. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String spacecraftName, String skiptoken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + skiptoken, + 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 contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String spacecraftName, String skiptoken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + skiptoken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String spacecraftName, String skiptoken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, spacecraftName, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String spacecraftName) { + final String skiptoken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, spacecraftName, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String spacecraftName, String skiptoken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, spacecraftName, skiptoken, context), + nextLink -> listNextSinglePageAsync(nextLink, 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String spacecraftName) { + final String skiptoken = null; + return new PagedIterable<>(listAsync(resourceGroupName, spacecraftName, skiptoken)); + } + + /** + * Returns list of contacts by spacecraftName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param spacecraftName Spacecraft ID. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String spacecraftName, String skiptoken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, spacecraftName, skiptoken, 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + contactName, + 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + contactName, + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String spacecraftName, String contactName) { + return getWithResponseAsync(resourceGroupName, spacecraftName, contactName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + contactName, + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + contactName, + 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 the {@link PollerFlux} for polling of 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + contactName, + 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + contactName, + 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 {@link PollerFlux} for polling of long-running operation. + */ + @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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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(); + } + + /** + * 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 ListContacts API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 ListContacts API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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/ContactsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsImpl.java new file mode 100644 index 0000000000000..2015745e45794 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/ContactsImpl.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.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; + +public final class ContactsImpl implements Contacts { + private static 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, String skiptoken, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, spacecraftName, skiptoken, 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/OperationResultImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationResultImpl.java new file mode 100644 index 0000000000000..7ef9b7abd0f26 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationResultImpl.java @@ -0,0 +1,63 @@ +// 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.OperationResultInner; +import com.azure.resourcemanager.orbital.models.OperationResult; +import com.azure.resourcemanager.orbital.models.OperationResultErrorProperties; +import com.azure.resourcemanager.orbital.models.Status; +import java.time.OffsetDateTime; + +public final class OperationResultImpl implements OperationResult { + private OperationResultInner innerObject; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + OperationResultImpl( + OperationResultInner 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 Status status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationResultErrorProperties error() { + return this.innerModel().error(); + } + + public OperationResultInner 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..b419b89e5ea7a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsClientImpl.java @@ -0,0 +1,179 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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..d88b69fd78728 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// 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; + +public final class OperationsImpl implements Operations { + private static 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/OperationsResultsClientImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsClientImpl.java new file mode 100644 index 0000000000000..7b6cbadb1a2d6 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsClientImpl.java @@ -0,0 +1,306 @@ +// 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.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.OperationsResultsClient; +import com.azure.resourcemanager.orbital.fluent.models.OperationResultInner; +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 OperationsResultsClient. */ +public final class OperationsResultsClientImpl implements OperationsResultsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsResultsService service; + + /** The service client containing this operation class. */ + private final AzureOrbitalImpl client; + + /** + * Initializes an instance of OperationsResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsResultsClientImpl(AzureOrbitalImpl client) { + this.service = + RestProxy.create(OperationsResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureOrbitalOperationsResults to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureOrbitalOperatio") + private interface OperationsResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/locations/{location}/operationResults" + + "/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("location") String location, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 operation Result Entity along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync(String location, String operationId) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + location, + operationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 operation Result Entity along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync( + String location, String operationId, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId 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(), + this.client.getApiVersion(), + location, + operationId, + accept, + context); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 {@link PollerFlux} for polling of operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationResultInner> beginGetAsync( + String location, String operationId) { + Mono>> mono = getWithResponseAsync(location, operationId); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultInner.class, + OperationResultInner.class, + this.client.getContext()); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 {@link PollerFlux} for polling of operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationResultInner> beginGetAsync( + String location, String operationId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = getWithResponseAsync(location, operationId, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationResultInner.class, OperationResultInner.class, context); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 {@link SyncPoller} for polling of operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationResultInner> beginGet( + String location, String operationId) { + return beginGetAsync(location, operationId).getSyncPoller(); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 {@link SyncPoller} for polling of operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationResultInner> beginGet( + String location, String operationId, Context context) { + return beginGetAsync(location, operationId, context).getSyncPoller(); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 operation Result Entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String operationId) { + return beginGetAsync(location, operationId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 operation Result Entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String operationId, Context context) { + return beginGetAsync(location, operationId, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultInner get(String location, String operationId) { + return getAsync(location, operationId).block(); + } + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 operation Result Entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultInner get(String location, String operationId, Context context) { + return getAsync(location, operationId, context).block(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsImpl.java new file mode 100644 index 0000000000000..40dc52d4a19ee --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/OperationsResultsImpl.java @@ -0,0 +1,52 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.orbital.fluent.OperationsResultsClient; +import com.azure.resourcemanager.orbital.fluent.models.OperationResultInner; +import com.azure.resourcemanager.orbital.models.OperationResult; +import com.azure.resourcemanager.orbital.models.OperationsResults; + +public final class OperationsResultsImpl implements OperationsResults { + private static final ClientLogger LOGGER = new ClientLogger(OperationsResultsImpl.class); + + private final OperationsResultsClient innerClient; + + private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager; + + public OperationsResultsImpl( + OperationsResultsClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationResult get(String location, String operationId) { + OperationResultInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new OperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResult get(String location, String operationId, Context context) { + OperationResultInner inner = this.serviceClient().get(location, operationId, context); + if (inner != null) { + return new OperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationsResultsClient 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..4a2b0e9db9916 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +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.AvailableContacts; +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.SpacecraftsPropertiesProvisioningState; +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 SpacecraftsPropertiesProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String noradId() { + return this.innerModel().noradId(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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() + .updateTags(resourceGroupName, spacecraftName, updateParameters, Context.NONE); + return this; + } + + public Spacecraft apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSpacecrafts() + .updateTags(resourceGroupName, spacecraftName, updateParameters, context); + 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 PagedIterable listAvailableContacts(ContactParameters parameters) { + return serviceManager.spacecrafts().listAvailableContacts(resourceGroupName, spacecraftName, parameters); + } + + public PagedIterable 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 withProvisioningState(SpacecraftsPropertiesProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + 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..6bb9acc592472 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsClientImpl.java @@ -0,0 +1,1970 @@ +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.orbital.fluent.SpacecraftsClient; +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsInner; +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.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 { + /** 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, + @QueryParam("$skiptoken") String skiptoken, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$skiptoken") String skiptoken, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @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, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @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, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listAvailableContacts( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("spacecraftName") String spacecraftName, + @BodyParam("application/json") ContactParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableContactsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skiptoken) { + 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(), + skiptoken, + 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 spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skiptoken, 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(), + skiptoken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skiptoken) { + return new PagedFlux<>( + () -> listSinglePageAsync(skiptoken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of spacecrafts by subscription. + * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String skiptoken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(skiptoken), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String skiptoken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(skiptoken, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of spacecrafts by subscription. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String skiptoken = null; + return new PagedIterable<>(listAsync(skiptoken)); + } + + /** + * Returns list of spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String skiptoken, Context context) { + return new PagedIterable<>(listAsync(skiptoken, context)); + } + + /** + * Returns list of spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String skiptoken) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skiptoken, + 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 spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String skiptoken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + skiptoken, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skiptoken) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of spacecrafts by resource group. + * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String skiptoken = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String skiptoken, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, skiptoken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of spacecrafts by resource group. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String skiptoken = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skiptoken)); + } + + /** + * Returns list of spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String skiptoken, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skiptoken, 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String spacecraftName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, spacecraftName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 the {@link PollerFlux} for polling of 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + 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 {@link PollerFlux} for polling of long-running operation. + */ + @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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + 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 the {@link PollerFlux} for polling of customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SpacecraftInner> beginUpdateTagsAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, spacecraftName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SpacecraftInner.class, + SpacecraftInner.class, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SpacecraftInner> beginUpdateTagsAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, spacecraftName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SpacecraftInner.class, SpacecraftInner.class, 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 the {@link SyncPoller} for polling of customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SpacecraftInner> beginUpdateTags( + String resourceGroupName, String spacecraftName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, spacecraftName, parameters).getSyncPoller(); + } + + /** + * 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 the {@link SyncPoller} for polling of customer creates a spacecraft resource to schedule a contact. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SpacecraftInner> beginUpdateTags( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, spacecraftName, parameters, context).getSyncPoller(); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, spacecraftName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, spacecraftName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 SpacecraftInner updateTags( + String resourceGroupName, String spacecraftName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, spacecraftName, parameters, context).block(); + } + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableContactsSinglePageAsync( + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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 -> { + Mono>> mono = + service + .listAvailableContacts( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + parameters, + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AvailableContactsListResult.class, + AvailableContactsListResult.class, + this.client.getContext()) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableContactsSinglePageAsync( + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 (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); + Mono>> mono = + service + .listAvailableContacts( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + spacecraftName, + parameters, + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AvailableContactsListResult.class, + AvailableContactsListResult.class, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); + } + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableContactsAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + return new PagedFlux<>( + () -> listAvailableContactsSinglePageAsync(resourceGroupName, spacecraftName, parameters), + nextLink -> listAvailableContactsNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableContactsAsync( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + return new PagedFlux<>( + () -> listAvailableContactsSinglePageAsync(resourceGroupName, spacecraftName, parameters, context), + nextLink -> listAvailableContactsNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + return new PagedIterable<>(listAvailableContactsAsync(resourceGroupName, spacecraftName, parameters)); + } + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + return new PagedIterable<>(listAvailableContactsAsync(resourceGroupName, spacecraftName, parameters, context)); + } + + /** + * 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 ListSpacecrafts API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 ListSpacecrafts API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ListSpacecrafts API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 ListSpacecrafts API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ListAvailableContacts API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableContactsNextSinglePageAsync(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.listAvailableContactsNext(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 ListAvailableContacts API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableContactsNextSinglePageAsync( + 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 + .listAvailableContactsNext(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/SpacecraftsImpl.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsImpl.java new file mode 100644 index 0000000000000..d77a3180816d2 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/implementation/SpacecraftsImpl.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.SpacecraftsClient; +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsInner; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.azure.resourcemanager.orbital.models.AvailableContacts; +import com.azure.resourcemanager.orbital.models.ContactParameters; +import com.azure.resourcemanager.orbital.models.Spacecraft; +import com.azure.resourcemanager.orbital.models.Spacecrafts; + +public final class SpacecraftsImpl implements Spacecrafts { + private static 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(String skiptoken, Context context) { + PagedIterable inner = this.serviceClient().list(skiptoken, 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, String skiptoken, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, skiptoken, 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 PagedIterable listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters) { + PagedIterable inner = + this.serviceClient().listAvailableContacts(resourceGroupName, spacecraftName, parameters); + return Utils.mapPage(inner, inner1 -> new AvailableContactsImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters, Context context) { + PagedIterable inner = + this.serviceClient().listAvailableContacts(resourceGroupName, spacecraftName, parameters, context); + return Utils.mapPage(inner, inner1 -> new AvailableContactsImpl(inner1, this.manager())); + } + + 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..779f204ad9b2a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ActionType.java @@ -0,0 +1,35 @@ +// 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); + } + + /** + * Gets known ActionType values. + * + * @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/AuthorizedGroundstation.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AuthorizedGroundstation.java new file mode 100644 index 0000000000000..a8edb79ba3de0 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AuthorizedGroundstation.java @@ -0,0 +1,73 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.LocalDate; + +/** Authorized groundstation. */ +@Fluent +public final class AuthorizedGroundstation { + /* + * Groundstation name. + */ + @JsonProperty(value = "groundStation") + private String groundStation; + + /* + * Date of authorization expiration. + */ + @JsonProperty(value = "expirationDate") + private LocalDate expirationDate; + + /** + * Get the groundStation property: Groundstation name. + * + * @return the groundStation value. + */ + public String groundStation() { + return this.groundStation; + } + + /** + * Set the groundStation property: Groundstation name. + * + * @param groundStation the groundStation value to set. + * @return the AuthorizedGroundstation object itself. + */ + public AuthorizedGroundstation withGroundStation(String groundStation) { + this.groundStation = groundStation; + return this; + } + + /** + * Get the expirationDate property: Date of authorization expiration. + * + * @return the expirationDate value. + */ + public LocalDate expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: Date of authorization expiration. + * + * @param expirationDate the expirationDate value to set. + * @return the AuthorizedGroundstation object itself. + */ + public AuthorizedGroundstation withExpirationDate(LocalDate expirationDate) { + this.expirationDate = expirationDate; + 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/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..15be47c2f77ac --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContacts.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.resourcemanager.orbital.fluent.models.AvailableContactsInner; + +/** An immutable client-side representation of AvailableContacts. */ +public interface AvailableContacts { + /** + * Gets the spacecraft property: The reference to the spacecraft resource. + * + * @return the spacecraft value. + */ + AvailableContactsSpacecraft spacecraft(); + + /** + * Gets the groundStationName property: Name of Azure Ground Station. + * + * @return the groundStationName value. + */ + String groundStationName(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.AvailableContactsInner object. + * + * @return the inner object. + */ + AvailableContactsInner innerModel(); +} 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..02999ca1f78bb --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.orbital.fluent.models.AvailableContactsInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListAvailableContacts API service call. */ +@Fluent +public final class AvailableContactsListResult { + /* + * 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 AvailableContactsListResult object itself. + */ + public AvailableContactsListResult 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/AvailableContactsSpacecraft.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsSpacecraft.java new file mode 100644 index 0000000000000..e16b859b2e21c --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableContactsSpacecraft.java @@ -0,0 +1,28 @@ +// 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; + +/** The reference to the spacecraft resource. */ +@Fluent +public final class AvailableContactsSpacecraft extends ResourceReference { + /** {@inheritDoc} */ + @Override + public AvailableContactsSpacecraft withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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..76efc1ae34b25 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStation.java @@ -0,0 +1,45 @@ +// 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 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..8897e601277ab --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.orbital.fluent.models.AvailableGroundStationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the AvailableGroundStations API service call. */ +@Fluent +public final class AvailableGroundStationListResult { + /* + * 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/AvailableGroundStationPropertiesAutoGenerated.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationPropertiesAutoGenerated.java new file mode 100644 index 0000000000000..2cd3958aa4c77 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStationPropertiesAutoGenerated.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties object for Available groundstation. */ +@Fluent +public class AvailableGroundStationPropertiesAutoGenerated { + /* + * 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; + + /* + * Release Status of a ground station. + */ + @JsonProperty(value = "releaseMode") + private ReleaseMode releaseMode; + + /** + * 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 AvailableGroundStationPropertiesAutoGenerated object itself. + */ + public AvailableGroundStationPropertiesAutoGenerated 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 AvailableGroundStationPropertiesAutoGenerated object itself. + */ + public AvailableGroundStationPropertiesAutoGenerated 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 AvailableGroundStationPropertiesAutoGenerated object itself. + */ + public AvailableGroundStationPropertiesAutoGenerated 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 AvailableGroundStationPropertiesAutoGenerated object itself. + */ + public AvailableGroundStationPropertiesAutoGenerated 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 AvailableGroundStationPropertiesAutoGenerated object itself. + */ + public AvailableGroundStationPropertiesAutoGenerated withAltitudeMeters(Float altitudeMeters) { + this.altitudeMeters = altitudeMeters; + return this; + } + + /** + * Get the releaseMode property: Release Status of a ground station. + * + * @return the releaseMode value. + */ + public ReleaseMode releaseMode() { + return this.releaseMode; + } + + /** + * Set the releaseMode property: Release Status of a ground station. + * + * @param releaseMode the releaseMode value to set. + * @return the AvailableGroundStationPropertiesAutoGenerated object itself. + */ + public AvailableGroundStationPropertiesAutoGenerated withReleaseMode(ReleaseMode releaseMode) { + this.releaseMode = releaseMode; + 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/AvailableGroundStations.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStations.java new file mode 100644 index 0000000000000..a955dccdf3700 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/AvailableGroundStations.java @@ -0,0 +1,60 @@ +// 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(CapabilityParameter 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(CapabilityParameter 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 along with {@link Response}. + */ + Response getWithResponse(String groundStationName, Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/CapabilityParameter.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/CapabilityParameter.java new file mode 100644 index 0000000000000..9b9dca95c7438 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/CapabilityParameter.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CapabilityParameter. */ +public final class CapabilityParameter extends ExpandableStringEnum { + /** Static value EarthObservation for CapabilityParameter. */ + public static final CapabilityParameter EARTH_OBSERVATION = fromString("EarthObservation"); + + /** Static value Communication for CapabilityParameter. */ + public static final CapabilityParameter COMMUNICATION = fromString("Communication"); + + /** + * Creates or finds a CapabilityParameter from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapabilityParameter. + */ + @JsonCreator + public static CapabilityParameter fromString(String name) { + return fromString(name, CapabilityParameter.class); + } + + /** + * Gets known CapabilityParameter values. + * + * @return known CapabilityParameter values. + */ + public static Collection values() { + return values(CapabilityParameter.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..db4f879c38456 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contact.java @@ -0,0 +1,280 @@ +// 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 provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + ContactsPropertiesProvisioningState provisioningState(); + + /** + * Gets the status property: Status of a contact. + * + * @return the status value. + */ + ContactsStatus status(); + + /** + * Gets the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard). + * + * @return the reservationStartTime value. + */ + OffsetDateTime reservationStartTime(); + + /** + * Gets the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard). + * + * @return the reservationEndTime value. + */ + OffsetDateTime reservationEndTime(); + + /** + * Gets the rxStartTime property: Receive start time of a contact (ISO 8601 UTC standard). + * + * @return the rxStartTime value. + */ + OffsetDateTime rxStartTime(); + + /** + * Gets the rxEndTime property: Receive end time of a contact (ISO 8601 UTC standard). + * + * @return the rxEndTime value. + */ + OffsetDateTime rxEndTime(); + + /** + * Gets the txStartTime property: Transmit start time of a contact (ISO 8601 UTC standard). + * + * @return the txStartTime value. + */ + OffsetDateTime txStartTime(); + + /** + * Gets the txEndTime property: Transmit end time of a contact (ISO 8601 UTC standard). + * + * @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 antennaConfiguration property: The configuration associated with the allocated antenna. + * + * @return the antennaConfiguration value. + */ + ContactsPropertiesAntennaConfiguration antennaConfiguration(); + + /** + * Gets the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + ContactsPropertiesContactProfile 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.WithProvisioningState, + 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 provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The current state of the resource's creation, deletion, or + * modification.. + * + * @param provisioningState The current state of the resource's creation, deletion, or modification. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ContactsPropertiesProvisioningState provisioningState); + } + /** The stage of the Contact definition allowing to specify reservationStartTime. */ + interface WithReservationStartTime { + /** + * Specifies the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC + * standard).. + * + * @param reservationStartTime Reservation start time of a contact (ISO 8601 UTC standard). + * @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 (ISO 8601 UTC standard).. + * + * @param reservationEndTime Reservation end time of a contact (ISO 8601 UTC standard). + * @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(ContactsPropertiesContactProfile 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/ContactInstanceProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactInstanceProperties.java new file mode 100644 index 0000000000000..e643cbfc36ee9 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactInstanceProperties.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Contact Instance Properties. */ +@Immutable +public class ContactInstanceProperties { + /* + * 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 (ISO 8601 UTC standard). + */ + @JsonProperty(value = "txStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txStartTime; + + /* + * Time at which antenna transmit will be disabled (ISO 8601 UTC standard). + */ + @JsonProperty(value = "txEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime txEndTime; + + /* + * Earliest time to receive a signal (ISO 8601 UTC standard). + */ + @JsonProperty(value = "rxStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime rxStartTime; + + /* + * Time to lost receiving a signal (ISO 8601 UTC standard). + */ + @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 (ISO 8601 UTC standard). + * + * @return the txStartTime value. + */ + public OffsetDateTime txStartTime() { + return this.txStartTime; + } + + /** + * Get the txEndTime property: Time at which antenna transmit will be disabled (ISO 8601 UTC standard). + * + * @return the txEndTime value. + */ + public OffsetDateTime txEndTime() { + return this.txEndTime; + } + + /** + * Get the rxStartTime property: Earliest time to receive a signal (ISO 8601 UTC standard). + * + * @return the rxStartTime value. + */ + public OffsetDateTime rxStartTime() { + return this.rxStartTime; + } + + /** + * Get the rxEndTime property: Time to lost receiving a signal (ISO 8601 UTC standard). + * + * @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/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..72da63c0469f9 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.orbital.fluent.models.ContactInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListContacts API service call. */ +@Fluent +public final class ContactListResult { + /* + * 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..ebde8aaebaeea --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParameters.java @@ -0,0 +1,152 @@ +// 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.JsonProperty; +import java.time.OffsetDateTime; + +/** Parameters that define the contact resource. */ +@Fluent +public final class ContactParameters { + /* + * The reference to the contact profile resource. + */ + @JsonProperty(value = "contactProfile", required = true) + private ContactParametersContactProfile contactProfile; + + /* + * Name of Azure Ground Station. + */ + @JsonProperty(value = "groundStationName", required = true) + private String groundStationName; + + /* + * Start time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * End time of a contact (ISO 8601 UTC standard). + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /** + * Get the contactProfile property: The reference to the contact profile resource. + * + * @return the contactProfile value. + */ + public ContactParametersContactProfile 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(ContactParametersContactProfile 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 (ISO 8601 UTC standard). + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of a contact (ISO 8601 UTC standard). + * + * @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 (ISO 8601 UTC standard). + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of a contact (ISO 8601 UTC standard). + * + * @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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactParameters.class); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParametersContactProfile.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParametersContactProfile.java new file mode 100644 index 0000000000000..e99eaa0dc7620 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactParametersContactProfile.java @@ -0,0 +1,28 @@ +// 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; + +/** The reference to the contact profile resource. */ +@Fluent +public final class ContactParametersContactProfile extends ResourceReference { + /** {@inheritDoc} */ + @Override + public ContactParametersContactProfile withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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..74fa8a87433ea --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfile.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.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.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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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 { + /** + * 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); + } + } + /** + * 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..b4de2d166d043 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLink.java @@ -0,0 +1,208 @@ +// 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.JsonProperty; +import java.util.List; + +/** Contact Profile Link. */ +@Fluent +public final class ContactProfileLink { + /* + * Link name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Polarization. e.g. (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. It is the required G/T by the + * customer. Not used yet. + */ + @JsonProperty(value = "gainOverTemperature") + private Float gainOverTemperature; + + /* + * Effective Isotropic Radiated Power (EIRP) in dBW. It is the required + * EIRP by the customer. Not used yet. + */ + @JsonProperty(value = "eirpdBW") + private Float eirpdBW; + + /* + * Contact Profile Link Channel. + */ + @JsonProperty(value = "channels", required = true) + private List channels; + + /** + * Get the name property: Link name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Link name. + * + * @param name the name value to set. + * @return the ContactProfileLink object itself. + */ + public ContactProfileLink withName(String name) { + this.name = name; + return this; + } + + /** + * Get the polarization property: Polarization. e.g. (RHCP, LHCP). + * + * @return the polarization value. + */ + public Polarization polarization() { + return this.polarization; + } + + /** + * Set the polarization property: Polarization. e.g. (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. It is the required G/T by the customer. + * Not used yet. + * + * @return the gainOverTemperature value. + */ + public Float gainOverTemperature() { + return this.gainOverTemperature; + } + + /** + * Set the gainOverTemperature property: Gain To Noise Temperature in db/K. It is the required G/T by the customer. + * Not used yet. + * + * @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. It is the required EIRP by the + * customer. Not used yet. + * + * @return the eirpdBW value. + */ + public Float eirpdBW() { + return this.eirpdBW; + } + + /** + * Set the eirpdBW property: Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the + * customer. Not used yet. + * + * @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 (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ContactProfileLink")); + } + 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactProfileLink.class); +} 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..02684f3227122 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileLinkChannel.java @@ -0,0 +1,258 @@ +// 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.JsonProperty; + +/** Contact Profile Link Channel. */ +@Fluent +public final class ContactProfileLinkChannel { + /* + * Channel name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * 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; + + /* + * Copy of the modem configuration file such as Kratos QRadio. Only valid + * for uplink directions. If provided, the modem connects to the customer + * endpoint and accepts commands from the customer instead of a VITA.49 + * stream. + */ + @JsonProperty(value = "modulationConfiguration") + private String modulationConfiguration; + + /* + * Copy of the modem configuration file such as Kratos QRadio or Kratos + * QuantumRx. Only valid for downlink directions. If provided, the modem + * connects to the customer endpoint and sends demodulated data instead of + * a VITA.49 stream. + */ + @JsonProperty(value = "demodulationConfiguration") + private String demodulationConfiguration; + + /* + * Currently unused. + */ + @JsonProperty(value = "encodingConfiguration") + private String encodingConfiguration; + + /* + * Currently unused. + */ + @JsonProperty(value = "decodingConfiguration") + private String decodingConfiguration; + + /** + * Get the name property: Channel name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Channel name. + * + * @param name the name value to set. + * @return the ContactProfileLinkChannel object itself. + */ + public ContactProfileLinkChannel withName(String name) { + this.name = name; + return this; + } + + /** + * 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: Copy of the modem configuration file such as Kratos QRadio. Only valid + * for uplink directions. If provided, the modem connects to the customer endpoint and accepts commands from the + * customer instead of a VITA.49 stream. + * + * @return the modulationConfiguration value. + */ + public String modulationConfiguration() { + return this.modulationConfiguration; + } + + /** + * Set the modulationConfiguration property: Copy of the modem configuration file such as Kratos QRadio. Only valid + * for uplink directions. If provided, the modem connects to the customer endpoint and accepts commands from the + * customer instead of a VITA.49 stream. + * + * @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: Copy of the modem configuration file such as Kratos QRadio or Kratos + * QuantumRx. Only valid for downlink directions. If provided, the modem connects to the customer endpoint and sends + * demodulated data instead of a VITA.49 stream. + * + * @return the demodulationConfiguration value. + */ + public String demodulationConfiguration() { + return this.demodulationConfiguration; + } + + /** + * Set the demodulationConfiguration property: Copy of the modem configuration file such as Kratos QRadio or Kratos + * QuantumRx. Only valid for downlink directions. If provided, the modem connects to the customer endpoint and sends + * demodulated data instead of a VITA.49 stream. + * + * @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: Currently unused. + * + * @return the encodingConfiguration value. + */ + public String encodingConfiguration() { + return this.encodingConfiguration; + } + + /** + * Set the encodingConfiguration property: Currently unused. + * + * @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: Currently unused. + * + * @return the decodingConfiguration value. + */ + public String decodingConfiguration() { + return this.decodingConfiguration; + } + + /** + * Set the decodingConfiguration property: Currently unused. + * + * @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 (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ContactProfileLinkChannel")); + } + if (endPoint() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endPoint in model ContactProfileLinkChannel")); + } else { + endPoint().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactProfileLinkChannel.class); +} 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..d6fc901f371d5 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfileListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.orbital.fluent.models.ContactProfileInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListContactProfiles API service call. */ +@Fluent +public final class ContactProfileListResult { + /* + * 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..997df6edfb822 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfiles.java @@ -0,0 +1,164 @@ +// 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 along with {@link Response}. + */ + 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 by Subscription. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns list of contact profiles by Subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String skiptoken, Context context); + + /** + * Returns list of contact profiles by Resource Group. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns list of contact profiles by Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/ContactProfilesProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesProperties.java new file mode 100644 index 0000000000000..0ba4b726f21d0 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesProperties.java @@ -0,0 +1,236 @@ +// 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.JsonProperty; +import java.util.List; + +/** List of Contact Profile Resource Properties. */ +@Fluent +public class ContactProfilesProperties { + /* + * The current state of the resource's creation, deletion, or modification. + */ + @JsonProperty(value = "provisioningState") + private ContactProfilesPropertiesProvisioningState provisioningState; + + /* + * Minimum viable contact duration in ISO 8601 format. Used for listing the + * available contacts with a spacecraft at a given ground station. + */ + @JsonProperty(value = "minimumViableContactDuration") + private String minimumViableContactDuration; + + /* + * Minimum viable elevation for the contact in decimal degrees. Used for + * listing the available contacts with a spacecraft at a given ground + * station. + */ + @JsonProperty(value = "minimumElevationDegrees") + private Float minimumElevationDegrees; + + /* + * Auto-tracking configuration. + */ + @JsonProperty(value = "autoTrackingConfiguration") + private AutoTrackingConfiguration autoTrackingConfiguration; + + /* + * ARM resource identifier of the Event Hub used for telemetry. Requires + * granting Orbital Resource Provider the rights to send telemetry into the + * hub. + */ + @JsonProperty(value = "eventHubUri") + private String eventHubUri; + + /* + * Network configuration of customer virtual network. + */ + @JsonProperty(value = "networkConfiguration", required = true) + private ContactProfilesPropertiesNetworkConfiguration networkConfiguration; + + /* + * Links of the Contact Profile. Describes RF links, modem processing, and + * IP endpoints. + */ + @JsonProperty(value = "links", required = true) + private List links; + + /** + * Get the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + public ContactProfilesPropertiesProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @param provisioningState the provisioningState value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withProvisioningState( + ContactProfilesPropertiesProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. Used for + * listing the available contacts with a spacecraft at a given ground station. + * + * @return the minimumViableContactDuration value. + */ + public String minimumViableContactDuration() { + return this.minimumViableContactDuration; + } + + /** + * Set the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. Used for + * listing the available contacts with a spacecraft at a given ground station. + * + * @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. Used for + * listing the available contacts with a spacecraft at a given ground station. + * + * @return the minimumElevationDegrees value. + */ + public Float minimumElevationDegrees() { + return this.minimumElevationDegrees; + } + + /** + * Set the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. Used for + * listing the available contacts with a spacecraft at a given ground station. + * + * @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-tracking configuration. + * + * @return the autoTrackingConfiguration value. + */ + public AutoTrackingConfiguration autoTrackingConfiguration() { + return this.autoTrackingConfiguration; + } + + /** + * Set the autoTrackingConfiguration property: Auto-tracking 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 eventHubUri property: ARM resource identifier of the Event Hub used for telemetry. Requires granting + * Orbital Resource Provider the rights to send telemetry into the hub. + * + * @return the eventHubUri value. + */ + public String eventHubUri() { + return this.eventHubUri; + } + + /** + * Set the eventHubUri property: ARM resource identifier of the Event Hub used for telemetry. Requires granting + * Orbital Resource Provider the rights to send telemetry into the hub. + * + * @param eventHubUri the eventHubUri value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withEventHubUri(String eventHubUri) { + this.eventHubUri = eventHubUri; + return this; + } + + /** + * Get the networkConfiguration property: Network configuration of customer virtual network. + * + * @return the networkConfiguration value. + */ + public ContactProfilesPropertiesNetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: Network configuration of customer virtual network. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the ContactProfilesProperties object itself. + */ + public ContactProfilesProperties withNetworkConfiguration( + ContactProfilesPropertiesNetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the links property: Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints. + * + * @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 (networkConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkConfiguration in model ContactProfilesProperties")); + } else { + networkConfiguration().validate(); + } + if (links() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property links in model ContactProfilesProperties")); + } else { + links().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactProfilesProperties.class); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesNetworkConfiguration.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesNetworkConfiguration.java new file mode 100644 index 0000000000000..836c0f552c3ef --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesNetworkConfiguration.java @@ -0,0 +1,61 @@ +// 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.JsonProperty; + +/** Network configuration of customer virtual network. */ +@Fluent +public final class ContactProfilesPropertiesNetworkConfiguration { + /* + * ARM resource identifier of the subnet delegated to the + * Microsoft.Orbital/orbitalGateways. Needs to be at least a class C + * subnet, and should not have any IP created in it. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /** + * Get the subnetId property: ARM resource identifier of the subnet delegated to the + * Microsoft.Orbital/orbitalGateways. Needs to be at least a class C subnet, and should not have any IP created in + * it. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: ARM resource identifier of the subnet delegated to the + * Microsoft.Orbital/orbitalGateways. Needs to be at least a class C subnet, and should not have any IP created in + * it. + * + * @param subnetId the subnetId value to set. + * @return the ContactProfilesPropertiesNetworkConfiguration object itself. + */ + public ContactProfilesPropertiesNetworkConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model ContactProfilesPropertiesNetworkConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactProfilesPropertiesNetworkConfiguration.class); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesProvisioningState.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesProvisioningState.java new file mode 100644 index 0000000000000..0f6d8f30b691e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactProfilesPropertiesProvisioningState.java @@ -0,0 +1,51 @@ +// 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 ContactProfilesPropertiesProvisioningState. */ +public final class ContactProfilesPropertiesProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for ContactProfilesPropertiesProvisioningState. */ + public static final ContactProfilesPropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Succeeded for ContactProfilesPropertiesProvisioningState. */ + public static final ContactProfilesPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ContactProfilesPropertiesProvisioningState. */ + public static final ContactProfilesPropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ContactProfilesPropertiesProvisioningState. */ + public static final ContactProfilesPropertiesProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Updating for ContactProfilesPropertiesProvisioningState. */ + public static final ContactProfilesPropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ContactProfilesPropertiesProvisioningState. */ + public static final ContactProfilesPropertiesProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates or finds a ContactProfilesPropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContactProfilesPropertiesProvisioningState. + */ + @JsonCreator + public static ContactProfilesPropertiesProvisioningState fromString(String name) { + return fromString(name, ContactProfilesPropertiesProvisioningState.class); + } + + /** + * Gets known ContactProfilesPropertiesProvisioningState values. + * + * @return known ContactProfilesPropertiesProvisioningState values. + */ + public static Collection values() { + return values(ContactProfilesPropertiesProvisioningState.class); + } +} 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..d58c134e6cb9f --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Contacts.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.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 as paginated response with {@link PagedIterable}. + */ + 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 skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String spacecraftName, String skiptoken, 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/ContactsPropertiesAntennaConfiguration.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesAntennaConfiguration.java new file mode 100644 index 0000000000000..40f797f3e4605 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesAntennaConfiguration.java @@ -0,0 +1,76 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration associated with the allocated antenna. */ +@Fluent +public final class ContactsPropertiesAntennaConfiguration { + /* + * The destination IP a packet can be sent to. This would for example be + * the TCP endpoint you would send data to. + */ + @JsonProperty(value = "destinationIp") + private String destinationIp; + + /* + * List of Source IP + */ + @JsonProperty(value = "sourceIps") + private List sourceIps; + + /** + * Get the destinationIp property: The destination IP a packet can be sent to. This would for example be the TCP + * endpoint you would send data to. + * + * @return the destinationIp value. + */ + public String destinationIp() { + return this.destinationIp; + } + + /** + * Set the destinationIp property: The destination IP a packet can be sent to. This would for example be the TCP + * endpoint you would send data to. + * + * @param destinationIp the destinationIp value to set. + * @return the ContactsPropertiesAntennaConfiguration object itself. + */ + public ContactsPropertiesAntennaConfiguration withDestinationIp(String destinationIp) { + this.destinationIp = destinationIp; + return this; + } + + /** + * Get the sourceIps property: List of Source IP. + * + * @return the sourceIps value. + */ + public List sourceIps() { + return this.sourceIps; + } + + /** + * Set the sourceIps property: List of Source IP. + * + * @param sourceIps the sourceIps value to set. + * @return the ContactsPropertiesAntennaConfiguration object itself. + */ + public ContactsPropertiesAntennaConfiguration withSourceIps(List sourceIps) { + this.sourceIps = sourceIps; + 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/ContactsPropertiesContactProfile.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesContactProfile.java new file mode 100644 index 0000000000000..1c484ceb7d804 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesContactProfile.java @@ -0,0 +1,28 @@ +// 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; + +/** The reference to the contact profile resource. */ +@Fluent +public final class ContactsPropertiesContactProfile extends ResourceReference { + /** {@inheritDoc} */ + @Override + public ContactsPropertiesContactProfile withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesProvisioningState.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesProvisioningState.java new file mode 100644 index 0000000000000..f7d4f9043fd52 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsPropertiesProvisioningState.java @@ -0,0 +1,51 @@ +// 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 ContactsPropertiesProvisioningState. */ +public final class ContactsPropertiesProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for ContactsPropertiesProvisioningState. */ + public static final ContactsPropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Succeeded for ContactsPropertiesProvisioningState. */ + public static final ContactsPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ContactsPropertiesProvisioningState. */ + public static final ContactsPropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ContactsPropertiesProvisioningState. */ + public static final ContactsPropertiesProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Updating for ContactsPropertiesProvisioningState. */ + public static final ContactsPropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ContactsPropertiesProvisioningState. */ + public static final ContactsPropertiesProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates or finds a ContactsPropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContactsPropertiesProvisioningState. + */ + @JsonCreator + public static ContactsPropertiesProvisioningState fromString(String name) { + return fromString(name, ContactsPropertiesProvisioningState.class); + } + + /** + * Gets known ContactsPropertiesProvisioningState values. + * + * @return known ContactsPropertiesProvisioningState values. + */ + public static Collection values() { + return values(ContactsPropertiesProvisioningState.class); + } +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsStatus.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsStatus.java new file mode 100644 index 0000000000000..8da873eeaef37 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ContactsStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContactsStatus. */ +public final class ContactsStatus extends ExpandableStringEnum { + /** Static value scheduled for ContactsStatus. */ + public static final ContactsStatus SCHEDULED = fromString("scheduled"); + + /** Static value cancelled for ContactsStatus. */ + public static final ContactsStatus CANCELLED = fromString("cancelled"); + + /** Static value succeeded for ContactsStatus. */ + public static final ContactsStatus SUCCEEDED = fromString("succeeded"); + + /** Static value failed for ContactsStatus. */ + public static final ContactsStatus FAILED = fromString("failed"); + + /** Static value providerCancelled for ContactsStatus. */ + public static final ContactsStatus PROVIDER_CANCELLED = fromString("providerCancelled"); + + /** + * Creates or finds a ContactsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContactsStatus. + */ + @JsonCreator + public static ContactsStatus fromString(String name) { + return fromString(name, ContactsStatus.class); + } + + /** + * Gets known ContactsStatus values. + * + * @return known ContactsStatus values. + */ + public static Collection values() { + return values(ContactsStatus.class); + } +} 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..b84fe5f1ed863 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Direction.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.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); + } + + /** + * Gets known Direction values. + * + * @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..377d761fbb837 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/EndPoint.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer End point to store/retrieve data during a contact. */ +@Fluent +public final class EndPoint { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndPoint.class); +} 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..e3acd6dd35071 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationDisplay.java @@ -0,0 +1,89 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * 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..a5521e32048b4 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationListResult.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.annotation.Immutable; +import com.azure.resourcemanager.orbital.fluent.models.OperationInner; +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 { + /* + * 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/OperationResult.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResult.java new file mode 100644 index 0000000000000..160b25e39eaf9 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResult.java @@ -0,0 +1,74 @@ +// 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.OperationResultInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationResult. */ +public interface OperationResult { + /** + * Gets the id property: ID of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: The status of operation. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the startTime property: The operation start time (ISO 8601 UTC standard). + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The operation end time (ISO 8601 UTC standard). + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: Percentage completed. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the properties property: Operation result properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the error property: Operation result error properties. + * + * @return the error value. + */ + OperationResultErrorProperties error(); + + /** + * Gets the inner com.azure.resourcemanager.orbital.fluent.models.OperationResultInner object. + * + * @return the inner object. + */ + OperationResultInner innerModel(); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResultErrorProperties.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResultErrorProperties.java new file mode 100644 index 0000000000000..fcc42ce0f985a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationResultErrorProperties.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation result error properties. */ +@Immutable +public final class OperationResultErrorProperties { + /* + * The code of the error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the code property: The code of the error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * 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/Operations.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operations.java new file mode 100644 index 0000000000000..25c02b4f2a8cc --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Operations.java @@ -0,0 +1,33 @@ +// 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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationsResults.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationsResults.java new file mode 100644 index 0000000000000..9e5be0fa8b28b --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/OperationsResults.java @@ -0,0 +1,35 @@ +// 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; + +/** Resource collection API of OperationsResults. */ +public interface OperationsResults { + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async 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 operation Result Entity. + */ + OperationResult get(String location, String operationId); + + /** + * Returns operation results. + * + * @param location The name of Azure region. + * @param operationId The ID of an ongoing async operation. + * @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 operation Result Entity. + */ + OperationResult get(String location, String operationId, 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..ab29dfebb1b3e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Origin.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.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); + } + + /** + * Gets known Origin values. + * + * @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..8ed80f77dd41c --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Polarization.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.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 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); + } + + /** + * Gets known Polarization values. + * + * @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..aea4290fe3306 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Protocol.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.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); + } + + /** + * Gets known Protocol values. + * + * @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/ReleaseMode.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ReleaseMode.java new file mode 100644 index 0000000000000..00760caba7311 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ReleaseMode.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReleaseMode. */ +public final class ReleaseMode extends ExpandableStringEnum { + /** Static value Preview for ReleaseMode. */ + public static final ReleaseMode PREVIEW = fromString("Preview"); + + /** Static value GA for ReleaseMode. */ + public static final ReleaseMode GA = fromString("GA"); + + /** + * Creates or finds a ReleaseMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReleaseMode. + */ + @JsonCreator + public static ReleaseMode fromString(String name) { + return fromString(name, ReleaseMode.class); + } + + /** + * Gets known ReleaseMode values. + * + * @return known ReleaseMode values. + */ + public static Collection values() { + return values(ReleaseMode.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..0334a02b8b21e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/ResourceReference.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource Reference. */ +@Fluent +public class ResourceReference { + /* + * 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..bc23e0d96e93d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecraft.java @@ -0,0 +1,343 @@ +// 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.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 provisioningState property: The current state of the resource's creation, deletion, or modification. + * + * @return the provisioningState value. + */ + SpacecraftsPropertiesProvisioningState provisioningState(); + + /** + * Gets the noradId property: NORAD ID of the spacecraft. + * + * @return the noradId value. + */ + String noradId(); + + /** + * Gets the titleLine property: Title line of the two-line element set (TLE). + * + * @return the titleLine value. + */ + String titleLine(); + + /** + * Gets the tleLine1 property: Line 1 of the two-line element set (TLE). + * + * @return the tleLine1 value. + */ + String tleLine1(); + + /** + * Gets the tleLine2 property: Line 2 of the two-line element set (TLE). + * + * @return the tleLine2 value. + */ + String tleLine2(); + + /** + * Gets the links property: Immutable list of Spacecraft links. + * + * @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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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.WithProvisioningState, + 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 provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The current state of the resource's creation, deletion, or + * modification.. + * + * @param provisioningState The current state of the resource's creation, deletion, or modification. + * @return the next definition stage. + */ + WithCreate withProvisioningState(SpacecraftsPropertiesProvisioningState provisioningState); + } + /** 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 the two-line element set (TLE).. + * + * @param titleLine Title line of the two-line element set (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 the two-line element set (TLE).. + * + * @param tleLine1 Line 1 of the two-line element set (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 the two-line element set (TLE).. + * + * @param tleLine2 Line 2 of the two-line element set (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: Immutable list of Spacecraft links.. + * + * @param links Immutable list of Spacecraft links. + * @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); + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listAvailableContacts(ContactParameters parameters); + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable 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..1acfd17b4790a --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftLink.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of authorized spacecraft links per ground station and the expiration date of the authorization. */ +@Fluent +public final class SpacecraftLink { + /* + * Link name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * 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. e.g. (RHCP, LHCP). + */ + @JsonProperty(value = "polarization", required = true) + private Polarization polarization; + + /* + * Authorized Ground Stations + */ + @JsonProperty(value = "authorizations", access = JsonProperty.Access.WRITE_ONLY) + private List authorizations; + + /** + * Get the name property: Link name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Link name. + * + * @param name the name value to set. + * @return the SpacecraftLink object itself. + */ + public SpacecraftLink withName(String name) { + this.name = name; + return this; + } + + /** + * 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. e.g. (RHCP, LHCP). + * + * @return the polarization value. + */ + public Polarization polarization() { + return this.polarization; + } + + /** + * Set the polarization property: Polarization. e.g. (RHCP, LHCP). + * + * @param polarization the polarization value to set. + * @return the SpacecraftLink object itself. + */ + public SpacecraftLink withPolarization(Polarization polarization) { + this.polarization = polarization; + return this; + } + + /** + * Get the authorizations property: Authorized Ground Stations. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.authorizations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SpacecraftLink")); + } + 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")); + } + if (authorizations() != null) { + authorizations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SpacecraftLink.class); +} 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..e7da87632f2a8 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.orbital.fluent.models.SpacecraftInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListSpacecrafts API service call. */ +@Fluent +public final class SpacecraftListResult { + /* + * 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..26a7d24429f7d --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Spacecrafts.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.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 { + /** + * Returns list of spacecrafts by subscription. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns list of spacecrafts by subscription. + * + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String skiptoken, Context context); + + /** + * Returns list of spacecrafts by resource group. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns list of spacecrafts by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param skiptoken An opaque string that the resource provider uses to skip over previously-returned results. This + * is used when a previous list operation call returned a partial result. If a previous response contains a + * nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a + * starting point to use for subsequent calls. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String skiptoken, 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 along with {@link Response}. + */ + 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); + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listAvailableContacts( + String resourceGroupName, String spacecraftName, ContactParameters parameters); + + /** + * Returns list of available contacts. A contact is available if the spacecraft is visible from the ground station + * for more than the minimum viable contact duration provided in the contact profile. + * + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/SpacecraftsPropertiesProvisioningState.java b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftsPropertiesProvisioningState.java new file mode 100644 index 0000000000000..d183f3e09e575 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/SpacecraftsPropertiesProvisioningState.java @@ -0,0 +1,51 @@ +// 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 SpacecraftsPropertiesProvisioningState. */ +public final class SpacecraftsPropertiesProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for SpacecraftsPropertiesProvisioningState. */ + public static final SpacecraftsPropertiesProvisioningState CREATING = fromString("Creating"); + + /** Static value Succeeded for SpacecraftsPropertiesProvisioningState. */ + public static final SpacecraftsPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for SpacecraftsPropertiesProvisioningState. */ + public static final SpacecraftsPropertiesProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for SpacecraftsPropertiesProvisioningState. */ + public static final SpacecraftsPropertiesProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Updating for SpacecraftsPropertiesProvisioningState. */ + public static final SpacecraftsPropertiesProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for SpacecraftsPropertiesProvisioningState. */ + public static final SpacecraftsPropertiesProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates or finds a SpacecraftsPropertiesProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SpacecraftsPropertiesProvisioningState. + */ + @JsonCreator + public static SpacecraftsPropertiesProvisioningState fromString(String name) { + return fromString(name, SpacecraftsPropertiesProvisioningState.class); + } + + /** + * Gets known SpacecraftsPropertiesProvisioningState values. + * + * @return known SpacecraftsPropertiesProvisioningState values. + */ + public static Collection values() { + return values(SpacecraftsPropertiesProvisioningState.class); + } +} 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..b194ab9eadd3e --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/Status.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Status. */ +public final class Status extends ExpandableStringEnum { + /** Static value Succeeded for Status. */ + public static final Status SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for Status. */ + public static final Status CANCELED = fromString("Canceled"); + + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); + + /** Static value Running for Status. */ + public static final Status RUNNING = fromString("Running"); + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} 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..a06e60f1d82d3 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/main/java/com/azure/resourcemanager/orbital/models/TagsObject.java @@ -0,0 +1,49 @@ +// 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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + /* + * 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..bcf253269ffba --- /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/stable/2022-03-01/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("EASTUS2_0", 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..49997b2081d0d --- /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.CapabilityParameter; + +/** Samples for AvailableGroundStations List. */ +public final class AvailableGroundStationsListSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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(CapabilityParameter.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..d7136a19302cc --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesCreateOrUpdateSamples.java @@ -0,0 +1,25 @@ +// 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; + +/** Samples for ContactProfiles CreateOrUpdate. */ +public final class ContactProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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("CONTOSO-CP") + .withRegion("eastus2") + .withExistingResourceGroup("contoso-Rgp") + .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..470468e475ea9 --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO-CP", 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..d9d33f2b93740 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/ContactProfilesGetByResourceGroupSamples.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 GetByResourceGroup. */ +public final class ContactProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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("contoso-Rgp", "CONTOSO-CP", 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..e1740daac39af --- /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/stable/2022-03-01/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("contoso-Rgp", "opaqueString", 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..c02c1e28f2f04 --- /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/stable/2022-03-01/examples/ContactProfilesBySubscriptionList.json + */ + /** + * Sample code: List of Contact Profiles. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfContactProfiles(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contactProfiles().list("opaqueString", 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..7de7bbf6c132a --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO-CP", 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..fb5867e7d369d --- /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.ContactsPropertiesContactProfile; +import java.time.OffsetDateTime; + +/** Samples for Contacts Create. */ +public final class ContactsCreateSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT") + .withReservationStartTime(OffsetDateTime.parse("2022-03-02T10:58:30Z")) + .withReservationEndTime(OffsetDateTime.parse("2022-03-02T11:10:45Z")) + .withGroundStationName("EASTUS2_0") + .withContactProfile( + new ContactsPropertiesContactProfile() + .withId( + "/subscriptions/c1be1141-a7c9-4aac-9608-3c2e2f1152c3/resourceGroups/contoso-Rgp/providers/Microsoft.Orbital/contactProfiles/CONTOSO-CP")) + .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..418cf0d529a89 --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", "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..7e044500d415e --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", "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..ac16364e75604 --- /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/stable/2022-03-01/examples/ContactsBySpacecraftNameList.json + */ + /** + * Sample code: List of Spacecraft. + * + * @param manager Entry point to OrbitalManager. + */ + public static void listOfSpacecraft(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.contacts().list("contoso-Rgp", "CONTOSO_SAT", "opaqueString", 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..510a523d45b50 --- /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/stable/2022-03-01/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/OperationsResultsGetSamples.java b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsResultsGetSamples.java new file mode 100644 index 0000000000000..b49bfca45a026 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/OperationsResultsGetSamples.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 OperationsResults Get. */ +public final class OperationsResultsGetSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/examples/OperationResultsGet.json + */ + /** + * Sample code: KustoOperationResultsGet. + * + * @param manager Entry point to OrbitalManager. + */ + public static void kustoOperationResultsGet(com.azure.resourcemanager.orbital.OrbitalManager manager) { + manager.operationsResults().get("eastus2", "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", 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..69dc7c7ebbb85 --- /dev/null +++ b/sdk/orbital/azure-resourcemanager-orbital/src/samples/java/com/azure/resourcemanager/orbital/generated/SpacecraftsCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// 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/stable/2022-03-01/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("CONTOSO_SAT") + .withRegion("eastus2") + .withExistingResourceGroup("contoso-Rgp") + .withNoradId("36411") + .withTitleLine("CONTOSO_SAT") + .withTleLine1("1 27424U 02022A 22167.05119303 .00000638 00000+0 15103-3 0 9994") + .withTleLine2("2 27424 98.2477 108.9546 0000928 92.9194 327.0802 14.57300770 69982") + .withLinks( + Arrays + .asList( + new SpacecraftLink() + .withName("uplink_lhcp1") + .withCenterFrequencyMHz(2250f) + .withBandwidthMHz(2f) + .withDirection(Direction.UPLINK) + .withPolarization(Polarization.LHCP), + new SpacecraftLink() + .withName("downlink_rhcp1") + .withCenterFrequencyMHz(8160f) + .withBandwidthMHz(15f) + .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..3ff99065a72ca --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", 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..c0436e0651ffb --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", 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..6471d3628442a --- /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.ContactParametersContactProfile; +import java.time.OffsetDateTime; + +/** Samples for Spacecrafts ListAvailableContacts. */ +public final class SpacecraftsListAvailableContactsSamples { + /* + * x-ms-original-file: specification/orbital/resource-manager/Microsoft.Orbital/stable/2022-03-01/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( + "contoso-Rgp", + "CONTOSO_SAT", + new ContactParameters() + .withContactProfile( + new ContactParametersContactProfile() + .withId( + "/subscriptions/c1be1141-a7c9-4aac-9608-3c2e2f1152c3/resourceGroups/contoso-Rgp/providers/Microsoft.Orbital/contactProfiles/CONTOSO-CP")) + .withGroundStationName("EASTUS2_0") + .withStartTime(OffsetDateTime.parse("2022-03-01T11:30:00Z")) + .withEndTime(OffsetDateTime.parse("2022-03-02T11:30: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..f5be436037b92 --- /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/stable/2022-03-01/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("contoso-Rgp", "opaqueString", 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..3521a5f6c3a1e --- /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/stable/2022-03-01/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("opaqueString", 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..0f8f23b92e972 --- /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/stable/2022-03-01/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("contoso-Rgp", "CONTOSO_SAT", 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..0e36adaa09544 --- /dev/null +++ b/sdk/orbital/ci.yml @@ -0,0 +1,47 @@ +# 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 + +parameters: + - name: release_azureresourcemanagerorbital + displayName: azure-resourcemanager-orbital + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: orbital + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-orbital + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerorbital + releaseInBatch: ${{ parameters.release_azureresourcemanagerorbital }} diff --git a/sdk/orbital/pom.xml b/sdk/orbital/pom.xml new file mode 100644 index 0000000000000..fa21163afc13c --- /dev/null +++ b/sdk/orbital/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-orbital-service + pom + 1.0.0 + + + azure-resourcemanager-orbital + +