// 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 armdisconnectedoperations_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/disconnectedoperations/armdisconnectedoperations"
	"log"
)

// Generated from example definition: 2026-03-15/Artifacts_Get_MaximumSet_Gen.json
func ExampleArtifactsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdisconnectedoperations.NewClientFactory("301DCB09-82EC-4777-A56C-6FFF26BCC814", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactsClient().Get(ctx, "rgdisconnectedoperations", "J_3-_S--_-UM_-_7w11", "PMY-", "-8Y-Us1BNNG6-H5w6-2--RP", 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 = armdisconnectedoperations.ArtifactsClientGetResponse{
	// 	Artifact: armdisconnectedoperations.Artifact{
	// 		Properties: &armdisconnectedoperations.ArtifactProperties{
	// 			ProvisioningState: to.Ptr(armdisconnectedoperations.ResourceProvisioningStateSucceeded),
	// 			ArtifactOrder: to.Ptr[int32](1),
	// 			Title: to.Ptr("artifact pat 1"),
	// 			Description: to.Ptr("the first part of the image"),
	// 			Size: to.Ptr[int64](22),
	// 		},
	// 		ID: to.Ptr("/subscriptions/1F6CACA0-5FFA-47AD-94FD-42368F71E49E/resourceGroups/rgdisconnectedOperations/providers/Microsoft.Edge/disconnectedOperations/demo-resource"),
	// 		Name: to.Ptr("demo-resource"),
	// 		Type: to.Ptr("Microsoft.Edge/disconnectedOperations/images/artifacts"),
	// 		SystemData: &armdisconnectedoperations.SystemData{
	// 			CreatedBy: to.Ptr("bwpmoygkcv"),
	// 			CreatedByType: to.Ptr(armdisconnectedoperations.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-05-14T19:03:52.617Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("tottbcqgtvsjebkejjlhxibnaifijd"),
	// 			LastModifiedByType: to.Ptr(armdisconnectedoperations.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-05-14T19:03:52.617Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-03-15/Artifact_ListByParent_MaximumSet_Gen.json
func ExampleArtifactsClient_NewListByParentPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdisconnectedoperations.NewClientFactory("301DCB09-82EC-4777-A56C-6FFF26BCC814", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewArtifactsClient().NewListByParentPager("rgdisconnectedoperations", "XOn_Y-7_M-46E-Y", "2v5Q3mNihPV88C882LnbQO8", 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 = armdisconnectedoperations.ArtifactsClientListByParentResponse{
		// 	ArtifactListResult: armdisconnectedoperations.ArtifactListResult{
		// 		Value: []*armdisconnectedoperations.Artifact{
		// 			{
		// 				Properties: &armdisconnectedoperations.ArtifactProperties{
		// 					ProvisioningState: to.Ptr(armdisconnectedoperations.ResourceProvisioningStateSucceeded),
		// 					ArtifactOrder: to.Ptr[int32](1),
		// 					Title: to.Ptr("artifact pat 1"),
		// 					Description: to.Ptr("the first part of the image"),
		// 					Size: to.Ptr[int64](22),
		// 				},
		// 				ID: to.Ptr("/subscriptions/1F6CACA0-5FFA-47AD-94FD-42368F71E49E/resourceGroups/rgdisconnectedOperations/providers/Microsoft.Edge/disconnectedOperations/demo-resource"),
		// 				Name: to.Ptr("demo-resource"),
		// 				Type: to.Ptr("Microsoft.Edge/disconnectedOperations/images/artifacts"),
		// 				SystemData: &armdisconnectedoperations.SystemData{
		// 					CreatedBy: to.Ptr("bwpmoygkcv"),
		// 					CreatedByType: to.Ptr(armdisconnectedoperations.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-05-14T19:03:52.617Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("tottbcqgtvsjebkejjlhxibnaifijd"),
		// 					LastModifiedByType: to.Ptr(armdisconnectedoperations.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-05-14T19:03:52.617Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 		NextLink: to.Ptr("https://microsoft.com/a"),
		// 	},
		// }
	}
}

// Generated from example definition: 2026-03-15/Artifact_ListDownloadUri_MaximumSet_Gen.json
func ExampleArtifactsClient_ListDownloadURI() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdisconnectedoperations.NewClientFactory("301DCB09-82EC-4777-A56C-6FFF26BCC814", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactsClient().ListDownloadURI(ctx, "rgdisconnectedoperations", "L4z_-S", "B-Ra--W0", "artifact1", 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 = armdisconnectedoperations.ArtifactsClientListDownloadURIResponse{
	// 	ArtifactDownloadResult: armdisconnectedoperations.ArtifactDownloadResult{
	// 		ProvisioningState: to.Ptr(armdisconnectedoperations.ResourceProvisioningStateSucceeded),
	// 		ArtifactOrder: to.Ptr[int32](1),
	// 		Title: to.Ptr("artifact pat 1"),
	// 		Description: to.Ptr("the first part of the image"),
	// 		Size: to.Ptr[int64](29000),
	// 		DownloadLink: to.Ptr("https://microsoft.com/a"),
	// 		LinkExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-05-14T19:03:53.740Z"); return t}()),
	// 	},
	// }
}
