// Path: azure-resourcemanager-relay/src/main/java/bio/terra/cloudres/azure/resourcemanager/relay/RelayManagerOperation.java
// public enum RelayManagerOperation implements CloudOperation {
//   AZURE_CREATE_RELAY,
//   AZURE_CREATE_RELAY_HYBRID_CONNNECTION
// }
// 
// Path: azure-resourcemanager-relay/src/main/java/bio/terra/cloudres/azure/resourcemanager/relay/data/CreateRelayRequestData.java
// @AutoValue
// public abstract class CreateRelayRequestData extends BaseRelayRequestData {
// 
//   /** The region of the resource. */
//   public abstract Region region();
// 
//   @Override
//   public final CloudOperation cloudOperation() {
//     return RelayManagerOperation.AZURE_CREATE_RELAY;
//   }
// 
//   @Override
//   public final Optional<CloudResourceUid> resourceUidCreation() {
//     return Optional.of(
//         new CloudResourceUid()
//             .azureRelay(
//                 new AzureRelay()
//                     .resourceGroup(
//                         new AzureResourceGroup()
//                             .tenantId(tenantId())
//                             .subscriptionId(subscriptionId())
//                             .resourceGroupName(resourceGroupName()))
//                     .relayName(name())));
//   }
// 
//   public static Builder builder() {
//     return new AutoValue_CreateRelayRequestData.Builder();
//   }
// 
//   @AutoValue.Builder
//   public abstract static class Builder {
//     public abstract Builder setName(String value);
// 
//     public abstract Builder setRegion(Region value);
// 
//     public abstract Builder setTenantId(String value);
// 
//     public abstract Builder setSubscriptionId(String value);
// 
//     public abstract Builder setResourceGroupName(String value);
// 
//     public abstract CreateRelayRequestData build();
//   }
// 
//   @Override
//   public JsonObject serialize() {
//     JsonObject requestData = super.serializeCommon();
//     requestData.addProperty("region", region().name());
//     return requestData;
//   }
// }


import static org.junit.jupiter.api.Assertions.assertEquals;
import bio.terra.cloudres.azure.resourcemanager.relay.RelayManagerOperation;
import bio.terra.cloudres.azure.resourcemanager.relay.data.CreateRelayRequestData;
import com.azure.core.management.Region;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
package bio.terra.cloudres.azure.resourcemanager.compute;



@Tag("unit")
public class RelayManagerRequestDataTest {

  @Test
  public void serializeCreateAzureRelay() {
    CreateRelayRequestData create =
        CreateRelayRequestData.builder()
            .setName("my-relay")
            .setTenantId("my-tenant")
            .setSubscriptionId("my-sub")
            .setResourceGroupName("my-rg")
            .setRegion(Region.US_EAST)
            .build();

    assertEquals(RelayManagerOperation.AZURE_CREATE_RELAY, create.cloudOperation());
    assertEquals(
        "{\"tenantId\":\"my-tenant\",\"subscriptionId\":\"my-sub\",\"resourceGroupName\":\"my-rg\",\"name\":\"my-relay\",\"region\":\"eastus\"}",
        create.serialize().toString());
  }

  @Test
  public void serializeCreateAzureRelayHybridConnection() {
    CreateRelayRequestData create =
        CreateRelayRequestData.builder()
            .setName("my-relay-hc")
            .setTenantId("my-tenant")
            .setSubscriptionId("my-sub")
            .setResourceGroupName("my-rg")
            .setRegion(Region.US_EAST)
            .build();

// Path: azure-resourcemanager-relay/src/main/java/bio/terra/cloudres/azure/resourcemanager/relay/RelayManagerOperation.java
// public enum RelayManagerOperation implements CloudOperation {
//   AZURE_CREATE_RELAY,
//   AZURE_CREATE_RELAY_HYBRID_CONNNECTION
// }
// 
// Path: azure-resourcemanager-relay/src/main/java/bio/terra/cloudres/azure/resourcemanager/relay/data/CreateRelayRequestData.java
// @AutoValue
// public abstract class CreateRelayRequestData extends BaseRelayRequestData {
// 
//   /** The region of the resource. */
//   public abstract Region region();
// 
//   @Override
//   public final CloudOperation cloudOperation() {
//     return RelayManagerOperation.AZURE_CREATE_RELAY;
//   }
// 
//   @Override
//   public final Optional<CloudResourceUid> resourceUidCreation() {
//     return Optional.of(
//         new CloudResourceUid()
//             .azureRelay(
//                 new AzureRelay()
//                     .resourceGroup(
//                         new AzureResourceGroup()
//                             .tenantId(tenantId())
//                             .subscriptionId(subscriptionId())
//                             .resourceGroupName(resourceGroupName()))
//                     .relayName(name())));
//   }
// 
//   public static Builder builder() {
//     return new AutoValue_CreateRelayRequestData.Builder();
//   }
// 
//   @AutoValue.Builder
//   public abstract static class Builder {
//     public abstract Builder setName(String value);
// 
//     public abstract Builder setRegion(Region value);
// 
//     public abstract Builder setTenantId(String value);
// 
//     public abstract Builder setSubscriptionId(String value);
// 
//     public abstract Builder setResourceGroupName(String value);
// 
//     public abstract CreateRelayRequestData build();
//   }
// 
//   @Override
//   public JsonObject serialize() {
//     JsonObject requestData = super.serializeCommon();
//     requestData.addProperty("region", region().name());
//     return requestData;
//   }
// }


// Path: azure-resourcemanager-relay/src/test/java/bio/terra/cloudres/azure/resourcemanager/compute/RelayManagerRequestDataTest.java
import static org.junit.jupiter.api.Assertions.assertEquals;
import bio.terra.cloudres.azure.resourcemanager.relay.RelayManagerOperation;
import bio.terra.cloudres.azure.resourcemanager.relay.data.CreateRelayRequestData;
import com.azure.core.management.Region;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

package bio.terra.cloudres.azure.resourcemanager.compute;



@Tag("unit")
public class RelayManagerRequestDataTest {

  @Test
  public void serializeCreateAzureRelay() {
    CreateRelayRequestData create =
        CreateRelayRequestData.builder()
            .setName("my-relay")
            .setTenantId("my-tenant")
            .setSubscriptionId("my-sub")
            .setResourceGroupName("my-rg")
            .setRegion(Region.US_EAST)
            .build();

    assertEquals(RelayManagerOperation.AZURE_CREATE_RELAY, create.cloudOperation());
    assertEquals(
        "{\"tenantId\":\"my-tenant\",\"subscriptionId\":\"my-sub\",\"resourceGroupName\":\"my-rg\",\"name\":\"my-relay\",\"region\":\"eastus\"}",
        create.serialize().toString());
  }

  @Test
  public void serializeCreateAzureRelayHybridConnection() {
    CreateRelayRequestData create =
        CreateRelayRequestData.builder()
            .setName("my-relay-hc")
            .setTenantId("my-tenant")
            .setSubscriptionId("my-sub")
            .setResourceGroupName("my-rg")
            .setRegion(Region.US_EAST)
            .build();

    assertEquals(RelayManagerOperation.AZURE_CREATE_RELAY, create.cloudOperation());