Skip to content

Latest commit

 

History

History
257 lines (234 loc) · 10.3 KB

File metadata and controls

257 lines (234 loc) · 10.3 KB

Code snippets and samples

Operations

Organizations

Operations_List

/**
 * Samples for Operations List.
 */
public final class OperationsListSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Operations_List_MaximumSet_Gen.json
     */
    /**
     * Sample code: Operations_List - generated by [MaximumSet] rule.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void operationsListGeneratedByMaximumSetRule(com.azure.resourcemanager.astro.AstroManager manager) {
        manager.operations().list(com.azure.core.util.Context.NONE);
    }
}

Organizations_CreateOrUpdate

import com.azure.resourcemanager.astro.models.LiftrBaseDataOrganizationProperties;
import com.azure.resourcemanager.astro.models.LiftrBaseDataPartnerOrganizationProperties;
import com.azure.resourcemanager.astro.models.LiftrBaseMarketplaceDetails;
import com.azure.resourcemanager.astro.models.LiftrBaseOfferDetails;
import com.azure.resourcemanager.astro.models.LiftrBaseSingleSignOnProperties;
import com.azure.resourcemanager.astro.models.LiftrBaseUserDetails;
import com.azure.resourcemanager.astro.models.ManagedServiceIdentity;
import com.azure.resourcemanager.astro.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.astro.models.MarketplaceSubscriptionStatus;
import com.azure.resourcemanager.astro.models.SingleSignOnStates;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * Samples for Organizations CreateOrUpdate.
 */
public final class OrganizationsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Organizations_CreateOrUpdate_MaximumSet_Gen.json
     */
    /**
     * Sample code: Organizations_CreateOrUpdate - generated by [MaximumSet] rule.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void
        organizationsCreateOrUpdateGeneratedByMaximumSetRule(com.azure.resourcemanager.astro.AstroManager manager) {
        manager.organizations().define("U.1-:7").withRegion("mhqthlsatwvqkl").withExistingResourceGroup("rgastronomer")
            .withTags(mapOf())
            .withProperties(new LiftrBaseDataOrganizationProperties()
                .withMarketplace(new LiftrBaseMarketplaceDetails().withSubscriptionId("ntthclydlpqmasr")
                    .withSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START)
                    .withOfferDetails(new LiftrBaseOfferDetails().withPublisherId("gfsqxygpnerxmvols")
                        .withOfferId("krzkefmpxztqyusidzgpchfaswuyce").withPlanId("kndxzygsanuiqzwbfbbvoipv")
                        .withPlanName("pwqjwlq").withTermUnit("xyygyzcazkuelz").withTermId("pwds")))
                .withUser(new LiftrBaseUserDetails().withFirstName("nfh").withLastName("lazfbstcccykibvcrxpmglqam")
                    .withEmailAddress(".K_@e7N-g1.xjqnbPs").withUpn("xtutvycpxjrtoftx").withPhoneNumber("inxkscllh"))
                .withPartnerOrganizationProperties(
                    new LiftrBaseDataPartnerOrganizationProperties().withOrganizationId("lskgzdmziusgrsucv")
                        .withWorkspaceId("vcrupxwpaba").withOrganizationName("3-").withWorkspaceName("9.:06")
                        .withSingleSignOnProperties(new LiftrBaseSingleSignOnProperties()
                            .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("mklfypyujwumgwdzae")
                            .withSingleSignOnUrl("ymmtzkyghvinvhgnqlzwrr").withAadDomains(Arrays.asList("kfbleh")))))
            .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)
                .withUserAssignedIdentities(mapOf()))
            .create();
    }

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

Organizations_Delete

/**
 * Samples for Organizations Delete.
 */
public final class OrganizationsDeleteSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Organizations_Delete_MaximumSet_Gen.json
     */
    /**
     * Sample code: Organizations_Delete - generated by [MaximumSet] rule.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void
        organizationsDeleteGeneratedByMaximumSetRule(com.azure.resourcemanager.astro.AstroManager manager) {
        manager.organizations().delete("rgastronomer", "q:", com.azure.core.util.Context.NONE);
    }
}

Organizations_GetByResourceGroup

/**
 * Samples for Organizations GetByResourceGroup.
 */
public final class OrganizationsGetByResourceGroupSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Organizations_Get_MaximumSet_Gen.json
     */
    /**
     * Sample code: Organizations_Get - generated by [MaximumSet] rule.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void organizationsGetGeneratedByMaximumSetRule(com.azure.resourcemanager.astro.AstroManager manager) {
        manager.organizations().getByResourceGroupWithResponse("rgastronomer", "S PS",
            com.azure.core.util.Context.NONE);
    }
}

Organizations_List

/**
 * Samples for Organizations List.
 */
public final class OrganizationsListSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Organizations_ListBySubscription_MaximumSet_Gen.json
     */
    /**
     * Sample code: Organizations_ListBySubscription - generated by [MaximumSet] rule.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void
        organizationsListBySubscriptionGeneratedByMaximumSetRule(com.azure.resourcemanager.astro.AstroManager manager) {
        manager.organizations().list(com.azure.core.util.Context.NONE);
    }
}

Organizations_ListByResourceGroup

/**
 * Samples for Organizations ListByResourceGroup.
 */
public final class OrganizationsListByResourceGroupSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Organizations_ListByResourceGroup_MaximumSet_Gen.json
     */
    /**
     * Sample code: Organizations_ListByResourceGroup - generated by [MaximumSet] rule.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void organizationsListByResourceGroupGeneratedByMaximumSetRule(
        com.azure.resourcemanager.astro.AstroManager manager) {
        manager.organizations().listByResourceGroup("rgastronomer", com.azure.core.util.Context.NONE);
    }
}

Organizations_Update

import com.azure.resourcemanager.astro.models.LiftrBaseDataPartnerOrganizationPropertiesUpdate;
import com.azure.resourcemanager.astro.models.LiftrBaseSingleSignOnProperties;
import com.azure.resourcemanager.astro.models.LiftrBaseUserDetailsUpdate;
import com.azure.resourcemanager.astro.models.ManagedServiceIdentity;
import com.azure.resourcemanager.astro.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.astro.models.OrganizationResource;
import com.azure.resourcemanager.astro.models.OrganizationResourceUpdateProperties;
import com.azure.resourcemanager.astro.models.SingleSignOnStates;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * Samples for Organizations Update.
 */
public final class OrganizationsUpdateSamples {
    /*
     * x-ms-original-file: specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/
     * Organizations_Update_MaximumSet_Gen.json
     */
    /**
     * Sample code: Organizations_Update.
     * 
     * @param manager Entry point to AstroManager.
     */
    public static void organizationsUpdate(com.azure.resourcemanager.astro.AstroManager manager) {
        OrganizationResource resource = manager.organizations()
            .getByResourceGroupWithResponse("rgastronomer", "6.", com.azure.core.util.Context.NONE).getValue();
        resource.update().withTags(mapOf("key1474", "fakeTokenPlaceholder"))
            .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)
                .withUserAssignedIdentities(mapOf()))
            .withProperties(new OrganizationResourceUpdateProperties()
                .withUser(new LiftrBaseUserDetailsUpdate().withFirstName("qeuofehzypzljgcuysugefbgxde")
                    .withLastName("g").withEmailAddress(".K_@e7N-g1.xjqnbPs").withUpn("uwtprzdfpsqmktx")
                    .withPhoneNumber("aqpyxznvqpgkzohevynofrjdfgoo"))
                .withPartnerOrganizationProperties(new LiftrBaseDataPartnerOrganizationPropertiesUpdate()
                    .withOrganizationId("lrtmbkvyvvoszhjevohkmyjhfyty").withWorkspaceId("xsepuskdhejaadusyxq")
                    .withOrganizationName("U2P_").withWorkspaceName("L.-y_--:")
                    .withSingleSignOnProperties(new LiftrBaseSingleSignOnProperties()
                        .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("mklfypyujwumgwdzae")
                        .withSingleSignOnUrl("ymmtzkyghvinvhgnqlzwrr").withAadDomains(Arrays.asList("kfbleh")))))
            .apply();
    }

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