// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.

package armplanetarycomputer_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/planetarycomputer/armplanetarycomputer"
	"log"
)

// Generated from example definition: 2026-04-15/GeoCatalogs_Create.json
func ExampleGeoCatalogsClient_BeginCreate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armplanetarycomputer.NewClientFactory("cd9b6cdf-dcf0-4dca-ab19-82be07b74704", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGeoCatalogsClient().BeginCreate(ctx, "MyResourceGroup", "MyCatalog", armplanetarycomputer.GeoCatalog{
		Properties: &armplanetarycomputer.GeoCatalogProperties{
			Tier:                              to.Ptr(armplanetarycomputer.CatalogTierBasic),
			AutoGeneratedDomainNameLabelScope: to.Ptr(armplanetarycomputer.AutoGeneratedDomainNameLabelScopeNoReuse),
		},
		Identity: &armplanetarycomputer.ManagedServiceIdentity{
			Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
				"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": {},
			},
		},
		Tags: map[string]*string{
			"MyTag": to.Ptr("MyValue"),
		},
		Location: to.Ptr("eastus"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res = armplanetarycomputer.GeoCatalogsClientCreateResponse{
	// 	GeoCatalog: armplanetarycomputer.GeoCatalog{
	// 		Properties: &armplanetarycomputer.GeoCatalogProperties{
	// 			Tier: to.Ptr(armplanetarycomputer.CatalogTierBasic),
	// 			CatalogURI: to.Ptr("https://mycatalog-0123456789abcdef.geocatalog.spatio.azure.com/"),
	// 			ProvisioningState: to.Ptr(armplanetarycomputer.ProvisioningStateSucceeded),
	// 			AutoGeneratedDomainNameLabelScope: to.Ptr(armplanetarycomputer.AutoGeneratedDomainNameLabelScopeNoReuse),
	// 		},
	// 		Identity: &armplanetarycomputer.ManagedServiceIdentity{
	// 			Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
	// 			UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
	// 				"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": &armplanetarycomputer.UserAssignedIdentity{
	// 					PrincipalID: to.Ptr("1b1424a8-4d17-4a72-b47f-d1d401c1e2fd"),
	// 					ClientID: to.Ptr("c57c7b17-2c5e-4996-8169-c74d026ffc5d"),
	// 				},
	// 			},
	// 		},
	// 		Tags: map[string]*string{
	// 			"MyTag": to.Ptr("MyValue"),
	// 		},
	// 		Location: to.Ptr("eastus"),
	// 		ID: to.Ptr("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.Orbital/geoCatalogs/MyCatalog"),
	// 		Name: to.Ptr("MyCatalog"),
	// 		Type: to.Ptr("Microsoft.Orbital/geoCatalogs"),
	// 		SystemData: &armplanetarycomputer.SystemData{
	// 			CreatedBy: to.Ptr("Catalog User"),
	// 			CreatedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("Catalog User"),
	// 			LastModifiedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-04-15/GeoCatalogs_Delete.json
func ExampleGeoCatalogsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armplanetarycomputer.NewClientFactory("cd9b6cdf-dcf0-4dca-ab19-82be07b74704", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGeoCatalogsClient().BeginDelete(ctx, "MyResourceGroup", "MyCatalog", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
}

// Generated from example definition: 2026-04-15/GeoCatalogs_Get.json
func ExampleGeoCatalogsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armplanetarycomputer.NewClientFactory("cd9b6cdf-dcf0-4dca-ab19-82be07b74704", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGeoCatalogsClient().Get(ctx, "MyResourceGroup", "MyCatalog", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res = armplanetarycomputer.GeoCatalogsClientGetResponse{
	// 	GeoCatalog: armplanetarycomputer.GeoCatalog{
	// 		Properties: &armplanetarycomputer.GeoCatalogProperties{
	// 			Tier: to.Ptr(armplanetarycomputer.CatalogTierBasic),
	// 			CatalogURI: to.Ptr("https://mycatalog-0123456789abcdef.geocatalog.spatio.azure.com/"),
	// 			ProvisioningState: to.Ptr(armplanetarycomputer.ProvisioningStateSucceeded),
	// 			AutoGeneratedDomainNameLabelScope: to.Ptr(armplanetarycomputer.AutoGeneratedDomainNameLabelScopeNoReuse),
	// 		},
	// 		Identity: &armplanetarycomputer.ManagedServiceIdentity{
	// 			Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
	// 			UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
	// 				"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": &armplanetarycomputer.UserAssignedIdentity{
	// 					PrincipalID: to.Ptr("1b1424a8-4d17-4a72-b47f-d1d401c1e2fd"),
	// 					ClientID: to.Ptr("c57c7b17-2c5e-4996-8169-c74d026ffc5d"),
	// 				},
	// 			},
	// 		},
	// 		Tags: map[string]*string{
	// 			"MyTag": to.Ptr("MyValue"),
	// 		},
	// 		Location: to.Ptr("eastus"),
	// 		ID: to.Ptr("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.Orbital/geoCatalogs/MyCatalog"),
	// 		Name: to.Ptr("MyCatalog"),
	// 		Type: to.Ptr("Microsoft.Orbital/geoCatalogs"),
	// 		SystemData: &armplanetarycomputer.SystemData{
	// 			CreatedBy: to.Ptr("Catalog User"),
	// 			CreatedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("Catalog User"),
	// 			LastModifiedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-04-15/GeoCatalogs_ListByResourceGroup.json
func ExampleGeoCatalogsClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armplanetarycomputer.NewClientFactory("cd9b6cdf-dcf0-4dca-ab19-82be07b74704", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGeoCatalogsClient().NewListByResourceGroupPager("MyResourceGroup", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armplanetarycomputer.GeoCatalogsClientListByResourceGroupResponse{
		// 	GeoCatalogListResult: armplanetarycomputer.GeoCatalogListResult{
		// 		Value: []*armplanetarycomputer.GeoCatalog{
		// 			{
		// 				Properties: &armplanetarycomputer.GeoCatalogProperties{
		// 					Tier: to.Ptr(armplanetarycomputer.CatalogTierBasic),
		// 					CatalogURI: to.Ptr("https://mycatalog-0123456789abcdef.geocatalog.spatio.azure.com/"),
		// 					ProvisioningState: to.Ptr(armplanetarycomputer.ProvisioningStateSucceeded),
		// 					AutoGeneratedDomainNameLabelScope: to.Ptr(armplanetarycomputer.AutoGeneratedDomainNameLabelScopeNoReuse),
		// 				},
		// 				Identity: &armplanetarycomputer.ManagedServiceIdentity{
		// 					Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
		// 					UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
		// 						"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": &armplanetarycomputer.UserAssignedIdentity{
		// 							PrincipalID: to.Ptr("1b1424a8-4d17-4a72-b47f-d1d401c1e2fd"),
		// 							ClientID: to.Ptr("c57c7b17-2c5e-4996-8169-c74d026ffc5d"),
		// 						},
		// 					},
		// 				},
		// 				Tags: map[string]*string{
		// 					"MyTag": to.Ptr("MyValue"),
		// 				},
		// 				Location: to.Ptr("eastus"),
		// 				ID: to.Ptr("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.Orbital/geoCatalogs/MyCatalog"),
		// 				Name: to.Ptr("MyCatalog"),
		// 				Type: to.Ptr("Microsoft.Orbital/geoCatalogs"),
		// 				SystemData: &armplanetarycomputer.SystemData{
		// 					CreatedBy: to.Ptr("Catalog User"),
		// 					CreatedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("Catalog User"),
		// 					LastModifiedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 		NextLink: to.Ptr("https://microsoft.com/a"),
		// 	},
		// }
	}
}

// Generated from example definition: 2026-04-15/GeoCatalogs_ListBySubscription.json
func ExampleGeoCatalogsClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armplanetarycomputer.NewClientFactory("cd9b6cdf-dcf0-4dca-ab19-82be07b74704", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGeoCatalogsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armplanetarycomputer.GeoCatalogsClientListBySubscriptionResponse{
		// 	GeoCatalogListResult: armplanetarycomputer.GeoCatalogListResult{
		// 		Value: []*armplanetarycomputer.GeoCatalog{
		// 			{
		// 				Properties: &armplanetarycomputer.GeoCatalogProperties{
		// 					Tier: to.Ptr(armplanetarycomputer.CatalogTierBasic),
		// 					CatalogURI: to.Ptr("https://mycatalog-0123456789abcdef.geocatalog.spatio.azure.com/"),
		// 					ProvisioningState: to.Ptr(armplanetarycomputer.ProvisioningStateSucceeded),
		// 					AutoGeneratedDomainNameLabelScope: to.Ptr(armplanetarycomputer.AutoGeneratedDomainNameLabelScopeNoReuse),
		// 				},
		// 				Identity: &armplanetarycomputer.ManagedServiceIdentity{
		// 					Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
		// 					UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
		// 						"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": &armplanetarycomputer.UserAssignedIdentity{
		// 							PrincipalID: to.Ptr("1b1424a8-4d17-4a72-b47f-d1d401c1e2fd"),
		// 							ClientID: to.Ptr("c57c7b17-2c5e-4996-8169-c74d026ffc5d"),
		// 						},
		// 					},
		// 				},
		// 				Tags: map[string]*string{
		// 					"MyTag": to.Ptr("MyValue"),
		// 				},
		// 				Location: to.Ptr("eastus"),
		// 				ID: to.Ptr("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.Orbital/geoCatalogs/MyCatalog"),
		// 				Name: to.Ptr("MyCatalog"),
		// 				Type: to.Ptr("Microsoft.Orbital/geoCatalogs"),
		// 				SystemData: &armplanetarycomputer.SystemData{
		// 					CreatedBy: to.Ptr("Catalog User"),
		// 					CreatedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("Catalog User"),
		// 					LastModifiedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 		NextLink: to.Ptr("https://microsoft.com/a"),
		// 	},
		// }
	}
}

// Generated from example definition: 2026-04-15/GeoCatalogs_Update.json
func ExampleGeoCatalogsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armplanetarycomputer.NewClientFactory("cd9b6cdf-dcf0-4dca-ab19-82be07b74704", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGeoCatalogsClient().BeginUpdate(ctx, "MyResourceGroup", "MyCatalog", armplanetarycomputer.GeoCatalogUpdate{
		Tags: map[string]*string{
			"MyTag": to.Ptr("MyValue"),
		},
		Identity: &armplanetarycomputer.ManagedServiceIdentityUpdate{
			Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
				"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": {},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res = armplanetarycomputer.GeoCatalogsClientUpdateResponse{
	// 	GeoCatalog: armplanetarycomputer.GeoCatalog{
	// 		Properties: &armplanetarycomputer.GeoCatalogProperties{
	// 			Tier: to.Ptr(armplanetarycomputer.CatalogTierBasic),
	// 			CatalogURI: to.Ptr("https://mycatalog-0123456789abcdef.geocatalog.spatio.azure.com/"),
	// 			ProvisioningState: to.Ptr(armplanetarycomputer.ProvisioningStateSucceeded),
	// 			AutoGeneratedDomainNameLabelScope: to.Ptr(armplanetarycomputer.AutoGeneratedDomainNameLabelScopeNoReuse),
	// 		},
	// 		Identity: &armplanetarycomputer.ManagedServiceIdentity{
	// 			Type: to.Ptr(armplanetarycomputer.ManagedServiceIdentityTypeUserAssigned),
	// 			UserAssignedIdentities: map[string]*armplanetarycomputer.UserAssignedIdentity{
	// 				"/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity": &armplanetarycomputer.UserAssignedIdentity{
	// 					PrincipalID: to.Ptr("1b1424a8-4d17-4a72-b47f-d1d401c1e2fd"),
	// 					ClientID: to.Ptr("c57c7b17-2c5e-4996-8169-c74d026ffc5d"),
	// 				},
	// 			},
	// 		},
	// 		Tags: map[string]*string{
	// 			"MyTag": to.Ptr("MyValue"),
	// 		},
	// 		Location: to.Ptr("eastus"),
	// 		ID: to.Ptr("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.Orbital/geoCatalogs/MyCatalog"),
	// 		Name: to.Ptr("MyCatalog"),
	// 		Type: to.Ptr("Microsoft.Orbital/geoCatalogs"),
	// 		SystemData: &armplanetarycomputer.SystemData{
	// 			CreatedBy: to.Ptr("Catalog User"),
	// 			CreatedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("Catalog User"),
	// 			LastModifiedByType: to.Ptr(armplanetarycomputer.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T18:34:22.271Z"); return t}()),
	// 		},
	// 	},
	// }
}
