armconfidentialledger

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 14 Imported by: 3

README

Azure Confidential Ledger Module for Go

PkgGoDev

The armconfidentialledger module provides operations for working with Azure Confidential Ledger.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Confidential Ledger module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/confidentialledger/armconfidentialledger

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Confidential Ledger. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Confidential Ledger module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armconfidentialledger.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armconfidentialledger.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Confidential Ledger label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AADBasedSecurityPrincipal

type AADBasedSecurityPrincipal struct {
	// LedgerRole associated with the Security Principal of Ledger
	LedgerRoleName *LedgerRoleName

	// UUID/GUID based Principal Id of the Security Principal
	PrincipalID *string

	// UUID/GUID based Tenant Id of the Security Principal
	TenantID *string
}

AADBasedSecurityPrincipal - AAD based security principal with associated Ledger RoleName

func (AADBasedSecurityPrincipal) MarshalJSON added in v1.1.0

func (a AADBasedSecurityPrincipal) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AADBasedSecurityPrincipal.

func (*AADBasedSecurityPrincipal) UnmarshalJSON added in v1.1.0

func (a *AADBasedSecurityPrincipal) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AADBasedSecurityPrincipal.

type CertBasedSecurityPrincipal

type CertBasedSecurityPrincipal struct {
	// Public key of the user cert (.pem or .cer)
	Cert *string

	// LedgerRole associated with the Security Principal of Ledger
	LedgerRoleName *LedgerRoleName
}

CertBasedSecurityPrincipal - Cert based security principal with Ledger RoleName

func (CertBasedSecurityPrincipal) MarshalJSON added in v1.1.0

func (c CertBasedSecurityPrincipal) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CertBasedSecurityPrincipal.

func (*CertBasedSecurityPrincipal) UnmarshalJSON added in v1.1.0

func (c *CertBasedSecurityPrincipal) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CertBasedSecurityPrincipal.

type CheckNameAvailabilityReason

type CheckNameAvailabilityReason string

CheckNameAvailabilityReason - The reason why the given name is not available.

const (
	CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
	CheckNameAvailabilityReasonInvalid       CheckNameAvailabilityReason = "Invalid"
)

func PossibleCheckNameAvailabilityReasonValues

func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason

PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// The name of the resource for which availability needs to be checked.
	Name *string

	// The resource type.
	Type *string
}

CheckNameAvailabilityRequest - The check availability request body.

func (CheckNameAvailabilityRequest) MarshalJSON added in v1.1.0

func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.

func (*CheckNameAvailabilityRequest) UnmarshalJSON added in v1.1.0

func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest.

type CheckNameAvailabilityResponse

type CheckNameAvailabilityResponse struct {
	// Detailed reason why the given name is available.
	Message *string

	// Indicates if the resource name is available.
	NameAvailable *bool

	// The reason why the given name is not available.
	Reason *CheckNameAvailabilityReason
}

CheckNameAvailabilityResponse - The check availability result.

func (CheckNameAvailabilityResponse) MarshalJSON added in v1.1.0

func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse.

func (*CheckNameAvailabilityResponse) UnmarshalJSON added in v1.1.0

func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse.

type Client added in v0.2.0

type Client struct {
	// contains filtered or unexported fields
}

Client contains the methods for the ConfidentialLedger group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.2.0

func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*Client) CheckNameAvailability added in v0.2.0

func (client *Client) CheckNameAvailability(ctx context.Context, nameAvailabilityRequest CheckNameAvailabilityRequest, options *ClientCheckNameAvailabilityOptions) (ClientCheckNameAvailabilityResponse, error)

CheckNameAvailability - To check whether a resource name is available. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-13

  • nameAvailabilityRequest - Name availability request payload.
  • options - ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/CheckNameAvailability.json

package main

import (
	"context"
	"log"

	"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/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CheckNameAvailability(ctx, armconfidentialledger.CheckNameAvailabilityRequest{
		Name: to.Ptr("sample-name"),
		Type: to.Ptr("Microsoft.ConfidentialLedger/ledgers"),
	}, 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.CheckNameAvailabilityResponse = armconfidentialledger.CheckNameAvailabilityResponse{
	// 	NameAvailable: to.Ptr(true),
	// }
}
Output:

type ClientCheckNameAvailabilityOptions added in v0.2.0

type ClientCheckNameAvailabilityOptions struct {
}

ClientCheckNameAvailabilityOptions contains the optional parameters for the Client.CheckNameAvailability method.

type ClientCheckNameAvailabilityResponse added in v0.2.0

type ClientCheckNameAvailabilityResponse struct {
	// The check availability result.
	CheckNameAvailabilityResponse
}

ClientCheckNameAvailabilityResponse contains the response from method Client.CheckNameAvailability.

type ClientFactory added in v1.1.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewClient added in v1.1.0

func (c *ClientFactory) NewClient() *Client

NewClient creates a new instance of Client.

func (*ClientFactory) NewLedgerClient added in v1.1.0

func (c *ClientFactory) NewLedgerClient() *LedgerClient

NewLedgerClient creates a new instance of LedgerClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type ConfidentialLedger

type ConfidentialLedger struct {
	// The Azure location where the Confidential Ledger is running.
	Location *string

	// Properties of Confidential Ledger Resource.
	Properties *LedgerProperties

	// Additional tags for Confidential Ledger
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource Id for the resource.
	ID *string

	// READ-ONLY; Name of the Resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

ConfidentialLedger - Confidential Ledger. Contains the properties of Confidential Ledger Resource.

func (ConfidentialLedger) MarshalJSON

func (c ConfidentialLedger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConfidentialLedger.

func (*ConfidentialLedger) UnmarshalJSON added in v1.1.0

func (c *ConfidentialLedger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConfidentialLedger.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type LedgerClient

type LedgerClient struct {
	// contains filtered or unexported fields
}

LedgerClient contains the methods for the Ledger group. Don't use this type directly, use NewLedgerClient() instead.

func NewLedgerClient

func NewLedgerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LedgerClient, error)

NewLedgerClient creates a new instance of LedgerClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*LedgerClient) BeginCreate

func (client *LedgerClient) BeginCreate(ctx context.Context, resourceGroupName string, ledgerName string, confidentialLedger ConfidentialLedger, options *LedgerClientBeginCreateOptions) (*runtime.Poller[LedgerClientCreateResponse], error)

BeginCreate - Creates a Confidential Ledger with the specified ledger parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-13

  • resourceGroupName - The name of the resource group.
  • ledgerName - Name of the Confidential Ledger
  • confidentialLedger - Confidential Ledger Create Request Body
  • options - LedgerClientBeginCreateOptions contains the optional parameters for the LedgerClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/ConfidentialLedger_Create.json

package main

import (
	"context"
	"log"

	"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/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLedgerClient().BeginCreate(ctx, "DummyResourceGroupName", "DummyLedgerName", armconfidentialledger.ConfidentialLedger{
		Location: to.Ptr("EastUS"),
		Tags: map[string]*string{
			"additionalProps1": to.Ptr("additional properties"),
		},
		Properties: &armconfidentialledger.LedgerProperties{
			AADBasedSecurityPrincipals: []*armconfidentialledger.AADBasedSecurityPrincipal{
				{
					LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameAdministrator),
					PrincipalID:    to.Ptr("34621747-6fc8-4771-a2eb-72f31c461f2e"),
					TenantID:       to.Ptr("bce123b9-2b7b-4975-8360-5ca0b9b1cd08"),
				}},
			CertBasedSecurityPrincipals: []*armconfidentialledger.CertBasedSecurityPrincipal{
				{
					Cert:           to.Ptr("-----BEGIN CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END CERTIFICATE-----"),
					LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameReader),
				}},
			LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
		},
	}, 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 pull 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.ConfidentialLedger = armconfidentialledger.ConfidentialLedger{
	// 	Name: to.Ptr("DummyLedgerName"),
	// 	Type: to.Ptr("Microsoft.ConfidentialLedger/ledgers"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/providers/Microsoft.ConfidentialLedger/ledgers/DummyLedgerName"),
	// 	SystemData: &armconfidentialledger.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.123Z"); return t}()),
	// 		CreatedBy: to.Ptr("ledgerAdmin@contoso.com"),
	// 		CreatedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin1")),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-02T00:00:00.123Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("ledgerAdmin2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin2")),
	// 	},
	// 	Location: to.Ptr("EastUS"),
	// 	Tags: map[string]*string{
	// 		"additionalProps1": to.Ptr("additional properties"),
	// 	},
	// 	Properties: &armconfidentialledger.LedgerProperties{
	// 		AADBasedSecurityPrincipals: []*armconfidentialledger.AADBasedSecurityPrincipal{
	// 			{
	// 				LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameAdministrator),
	// 				PrincipalID: to.Ptr("34621747-6fc8-4771-a2eb-72f31c461f2e"),
	// 				TenantID: to.Ptr("bce123b9-2b7b-4975-8360-5ca0b9b1cd08"),
	// 		}},
	// 		CertBasedSecurityPrincipals: []*armconfidentialledger.CertBasedSecurityPrincipal{
	// 			{
	// 				Cert: to.Ptr("-----BEGIN CERTIFICATE-----\nMIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n-----END CERTIFICATE-----"),
	// 				LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameReader),
	// 		}},
	// 		IdentityServiceURI: to.Ptr("https://dummy.accledger.identity.com/DummyLedgerName"),
	// 		LedgerInternalNamespace: to.Ptr("dummyNamespace"),
	// 		LedgerName: to.Ptr("DummyLedgerName"),
	// 		LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
	// 		LedgerURI: to.Ptr("https://dummy.accledger.domain.com/DummyLedgerName"),
	// 		ProvisioningState: to.Ptr(armconfidentialledger.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*LedgerClient) BeginDelete

func (client *LedgerClient) BeginDelete(ctx context.Context, resourceGroupName string, ledgerName string, options *LedgerClientBeginDeleteOptions) (*runtime.Poller[LedgerClientDeleteResponse], error)

BeginDelete - Deletes an existing Confidential Ledger. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-13

  • resourceGroupName - The name of the resource group.
  • ledgerName - Name of the Confidential Ledger
  • options - LedgerClientBeginDeleteOptions contains the optional parameters for the LedgerClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/ConfidentialLedger_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLedgerClient().BeginDelete(ctx, "DummyResourceGroupName", "DummyLedgerName", 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 pull the result: %v", err)
	}
}
Output:

func (*LedgerClient) BeginUpdate

func (client *LedgerClient) BeginUpdate(ctx context.Context, resourceGroupName string, ledgerName string, confidentialLedger ConfidentialLedger, options *LedgerClientBeginUpdateOptions) (*runtime.Poller[LedgerClientUpdateResponse], error)

BeginUpdate - Updates properties of Confidential Ledger If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-13

  • resourceGroupName - The name of the resource group.
  • ledgerName - Name of the Confidential Ledger
  • confidentialLedger - Confidential Ledger request body for Updating Ledger
  • options - LedgerClientBeginUpdateOptions contains the optional parameters for the LedgerClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/ConfidentialLedger_Update.json

package main

import (
	"context"
	"log"

	"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/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLedgerClient().BeginUpdate(ctx, "DummyResourceGroupName", "DummyLedgerName", armconfidentialledger.ConfidentialLedger{
		Location: to.Ptr("EastUS"),
		Tags: map[string]*string{
			"additionProps2":   to.Ptr("additional property value"),
			"additionalProps1": to.Ptr("additional properties"),
		},
		Properties: &armconfidentialledger.LedgerProperties{
			AADBasedSecurityPrincipals: []*armconfidentialledger.AADBasedSecurityPrincipal{
				{
					LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameAdministrator),
					PrincipalID:    to.Ptr("34621747-6fc8-4771-a2eb-72f31c461f2e"),
					TenantID:       to.Ptr("bce123b9-2b7b-4975-8360-5ca0b9b1cd08"),
				}},
			CertBasedSecurityPrincipals: []*armconfidentialledger.CertBasedSecurityPrincipal{
				{
					Cert:           to.Ptr("-----BEGIN CERTIFICATE-----\nMIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n-----END CERTIFICATE-----"),
					LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameReader),
				}},
			LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
		},
	}, 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 pull 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.ConfidentialLedger = armconfidentialledger.ConfidentialLedger{
	// 	Name: to.Ptr("DummyLedgerName"),
	// 	Type: to.Ptr("Microsoft.ConfidentialLedger/ledgers"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/providers/Microsoft.ConfidentialLedger/ledgers/DummyLedgerName"),
	// 	SystemData: &armconfidentialledger.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.123Z"); return t}()),
	// 		CreatedBy: to.Ptr("ledgerAdmin@contoso.com"),
	// 		CreatedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin1")),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-02T00:00:00.123Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("ledgerAdmin2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin2")),
	// 	},
	// 	Location: to.Ptr("EastUS"),
	// 	Tags: map[string]*string{
	// 		"additionProps2": to.Ptr("additional property value"),
	// 		"additionalProps1": to.Ptr("additional properties"),
	// 	},
	// 	Properties: &armconfidentialledger.LedgerProperties{
	// 		AADBasedSecurityPrincipals: []*armconfidentialledger.AADBasedSecurityPrincipal{
	// 			{
	// 				LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameAdministrator),
	// 				PrincipalID: to.Ptr("34621747-6fc8-4771-a2eb-72f31c461f2e"),
	// 				TenantID: to.Ptr("bce123b9-2b7b-4975-8360-5ca0b9b1cd08"),
	// 		}},
	// 		CertBasedSecurityPrincipals: []*armconfidentialledger.CertBasedSecurityPrincipal{
	// 			{
	// 				Cert: to.Ptr("-----BEGIN CERTIFICATE-----\nMIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n-----END CERTIFICATE-----"),
	// 				LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameReader),
	// 		}},
	// 		IdentityServiceURI: to.Ptr("https://identity.confidential-ledger.core.azure.com/ledgerIdentity/dummyledgername"),
	// 		LedgerInternalNamespace: to.Ptr("dummyNamespace"),
	// 		LedgerName: to.Ptr("DummyLedgerName"),
	// 		LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
	// 		LedgerURI: to.Ptr("https://dummyledgername.confidential-ledger.azure.com"),
	// 		ProvisioningState: to.Ptr(armconfidentialledger.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*LedgerClient) Get

func (client *LedgerClient) Get(ctx context.Context, resourceGroupName string, ledgerName string, options *LedgerClientGetOptions) (LedgerClientGetResponse, error)

Get - Retrieves the properties of a Confidential Ledger. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-05-13

  • resourceGroupName - The name of the resource group.
  • ledgerName - Name of the Confidential Ledger
  • options - LedgerClientGetOptions contains the optional parameters for the LedgerClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/ConfidentialLedger_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLedgerClient().Get(ctx, "DummyResourceGroupName", "DummyLedgerName", 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.ConfidentialLedger = armconfidentialledger.ConfidentialLedger{
	// 	Name: to.Ptr("DummyLedgerName"),
	// 	Type: to.Ptr("Microsoft.ConfidentialLedger/ledgers"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/providers/Microsoft.ConfidentialLedger/ledgers/DummyLedgerName"),
	// 	SystemData: &armconfidentialledger.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.123Z"); return t}()),
	// 		CreatedBy: to.Ptr("ledgerAdmin@contoso.com"),
	// 		CreatedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin1")),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-02T00:00:00.123Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("ledgerAdmin2@outlook.com"),
	// 		LastModifiedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin2")),
	// 	},
	// 	Location: to.Ptr("EastUS"),
	// 	Tags: map[string]*string{
	// 		"additionalProps1": to.Ptr("additional properties"),
	// 	},
	// 	Properties: &armconfidentialledger.LedgerProperties{
	// 		AADBasedSecurityPrincipals: []*armconfidentialledger.AADBasedSecurityPrincipal{
	// 			{
	// 				LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameAdministrator),
	// 				PrincipalID: to.Ptr("34621747-6fc8-4771-a2eb-72f31c461f2e"),
	// 				TenantID: to.Ptr("bce123b9-2b7b-4975-8360-5ca0b9b1cd08"),
	// 		}},
	// 		IdentityServiceURI: to.Ptr("https://dummy.accledger.identity.com/DummyLedgerName"),
	// 		LedgerInternalNamespace: to.Ptr("dummyNamespace"),
	// 		LedgerName: to.Ptr("DummyLedgerName"),
	// 		LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
	// 		LedgerURI: to.Ptr("https://dummy.accledger.domain.com/DummyLedgerName"),
	// 		ProvisioningState: to.Ptr(armconfidentialledger.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*LedgerClient) NewListByResourceGroupPager added in v0.4.0

func (client *LedgerClient) NewListByResourceGroupPager(resourceGroupName string, options *LedgerClientListByResourceGroupOptions) *runtime.Pager[LedgerClientListByResourceGroupResponse]

NewListByResourceGroupPager - Retrieves the properties of all Confidential Ledgers.

Generated from API version 2022-05-13

  • resourceGroupName - The name of the resource group.
  • options - LedgerClientListByResourceGroupOptions contains the optional parameters for the LedgerClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/ConfidentialLedger_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLedgerClient().NewListByResourceGroupPager("DummyResourceGroupName", &armconfidentialledger.LedgerClientListByResourceGroupOptions{Filter: 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.List = armconfidentialledger.List{
		// 	Value: []*armconfidentialledger.ConfidentialLedger{
		// 		{
		// 			Name: to.Ptr("DummyLedgerName"),
		// 			Type: to.Ptr("Microsoft.ConfidentialLedger/ledgers"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/providers/Microsoft.ConfidentialLedger/ledgers/DummyLedgerName"),
		// 			SystemData: &armconfidentialledger.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.123Z"); return t}()),
		// 				CreatedBy: to.Ptr("ledgerAdmin@contoso.com"),
		// 				CreatedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin1")),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-02T00:00:00.123Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("ledgerAdmin2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin2")),
		// 			},
		// 			Location: to.Ptr("EastUS"),
		// 			Tags: map[string]*string{
		// 				"additionalProps1": to.Ptr("additional properties"),
		// 			},
		// 			Properties: &armconfidentialledger.LedgerProperties{
		// 				AADBasedSecurityPrincipals: []*armconfidentialledger.AADBasedSecurityPrincipal{
		// 					{
		// 						LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameAdministrator),
		// 						PrincipalID: to.Ptr("34621747-6fc8-4771-a2eb-72f31c461f2e"),
		// 						TenantID: to.Ptr("bce123b9-2b7b-4975-8360-5ca0b9b1cd08"),
		// 				}},
		// 				IdentityServiceURI: to.Ptr("https://dummy.accledger.identity.com/DummyLedgerName"),
		// 				LedgerInternalNamespace: to.Ptr("dummyNamespace"),
		// 				LedgerName: to.Ptr("DummyLedgerName"),
		// 				LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
		// 				LedgerURI: to.Ptr("https://dummy.accledger.domain.com/DummyLedgerName"),
		// 				ProvisioningState: to.Ptr(armconfidentialledger.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LedgerClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Retrieves the properties of all Confidential Ledgers.

Generated from API version 2022-05-13

  • options - LedgerClientListBySubscriptionOptions contains the optional parameters for the LedgerClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/ConfidentialLedger_ListBySub.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLedgerClient().NewListBySubscriptionPager(&armconfidentialledger.LedgerClientListBySubscriptionOptions{Filter: 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.List = armconfidentialledger.List{
		// 	Value: []*armconfidentialledger.ConfidentialLedger{
		// 		{
		// 			Name: to.Ptr("DummyLedgerName"),
		// 			Type: to.Ptr("Microsoft.ConfidentialLedger/ledgers"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/providers/Microsoft.ConfidentialLedger/ledgers/DummyLedgerName"),
		// 			SystemData: &armconfidentialledger.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.123Z"); return t}()),
		// 				CreatedBy: to.Ptr("ledgerAdmin@contoso.com"),
		// 				CreatedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin1")),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-02T00:00:00.123Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("ledgerAdmin2@outlook.com"),
		// 				LastModifiedByType: to.Ptr(armconfidentialledger.CreatedByType("Admin2")),
		// 			},
		// 			Location: to.Ptr("EastUS"),
		// 			Tags: map[string]*string{
		// 				"additionalProps1": to.Ptr("additional properties"),
		// 			},
		// 			Properties: &armconfidentialledger.LedgerProperties{
		// 				CertBasedSecurityPrincipals: []*armconfidentialledger.CertBasedSecurityPrincipal{
		// 					{
		// 						Cert: to.Ptr("-----BEGIN CERTIFICATE-----\nMIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n-----END CERTIFICATE-----"),
		// 						LedgerRoleName: to.Ptr(armconfidentialledger.LedgerRoleNameReader),
		// 				}},
		// 				IdentityServiceURI: to.Ptr("https://dummy.accledger.identity.com/DummyLedgerName"),
		// 				LedgerInternalNamespace: to.Ptr("dummyNamespace"),
		// 				LedgerName: to.Ptr("DummyLedgerName"),
		// 				LedgerType: to.Ptr(armconfidentialledger.LedgerTypePublic),
		// 				LedgerURI: to.Ptr("https://dummy.accledger.domain.com/DummyLedgerName"),
		// 				ProvisioningState: to.Ptr(armconfidentialledger.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type LedgerClientBeginCreateOptions added in v0.2.0

type LedgerClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LedgerClientBeginCreateOptions contains the optional parameters for the LedgerClient.BeginCreate method.

type LedgerClientBeginDeleteOptions added in v0.2.0

type LedgerClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LedgerClientBeginDeleteOptions contains the optional parameters for the LedgerClient.BeginDelete method.

type LedgerClientBeginUpdateOptions added in v0.2.0

type LedgerClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LedgerClientBeginUpdateOptions contains the optional parameters for the LedgerClient.BeginUpdate method.

type LedgerClientCreateResponse added in v0.2.0

type LedgerClientCreateResponse struct {
	// Confidential Ledger. Contains the properties of Confidential Ledger Resource.
	ConfidentialLedger
}

LedgerClientCreateResponse contains the response from method LedgerClient.BeginCreate.

type LedgerClientDeleteResponse added in v0.2.0

type LedgerClientDeleteResponse struct {
}

LedgerClientDeleteResponse contains the response from method LedgerClient.BeginDelete.

type LedgerClientGetOptions added in v0.2.0

type LedgerClientGetOptions struct {
}

LedgerClientGetOptions contains the optional parameters for the LedgerClient.Get method.

type LedgerClientGetResponse added in v0.2.0

type LedgerClientGetResponse struct {
	// Confidential Ledger. Contains the properties of Confidential Ledger Resource.
	ConfidentialLedger
}

LedgerClientGetResponse contains the response from method LedgerClient.Get.

type LedgerClientListByResourceGroupOptions added in v0.2.0

type LedgerClientListByResourceGroupOptions struct {
	// The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'
	Filter *string
}

LedgerClientListByResourceGroupOptions contains the optional parameters for the LedgerClient.NewListByResourceGroupPager method.

type LedgerClientListByResourceGroupResponse added in v0.2.0

type LedgerClientListByResourceGroupResponse struct {
	// Object that includes an array of Confidential Ledgers and a possible link for next set.
	List
}

LedgerClientListByResourceGroupResponse contains the response from method LedgerClient.NewListByResourceGroupPager.

type LedgerClientListBySubscriptionOptions added in v0.2.0

type LedgerClientListBySubscriptionOptions struct {
	// The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'
	Filter *string
}

LedgerClientListBySubscriptionOptions contains the optional parameters for the LedgerClient.NewListBySubscriptionPager method.

type LedgerClientListBySubscriptionResponse added in v0.2.0

type LedgerClientListBySubscriptionResponse struct {
	// Object that includes an array of Confidential Ledgers and a possible link for next set.
	List
}

LedgerClientListBySubscriptionResponse contains the response from method LedgerClient.NewListBySubscriptionPager.

type LedgerClientUpdateResponse added in v0.2.0

type LedgerClientUpdateResponse struct {
	// Confidential Ledger. Contains the properties of Confidential Ledger Resource.
	ConfidentialLedger
}

LedgerClientUpdateResponse contains the response from method LedgerClient.BeginUpdate.

type LedgerProperties

type LedgerProperties struct {
	// Array of all AAD based Security Principals.
	AADBasedSecurityPrincipals []*AADBasedSecurityPrincipal

	// Array of all cert based Security Principals.
	CertBasedSecurityPrincipals []*CertBasedSecurityPrincipal

	// Type of Confidential Ledger
	LedgerType *LedgerType

	// READ-ONLY; Endpoint for accessing network identity.
	IdentityServiceURI *string

	// READ-ONLY; Internal namespace for the Ledger
	LedgerInternalNamespace *string

	// READ-ONLY; Unique name for the Confidential Ledger.
	LedgerName *string

	// READ-ONLY; Endpoint for calling Ledger Service.
	LedgerURI *string

	// READ-ONLY; Provisioning state of Ledger Resource
	ProvisioningState *ProvisioningState
}

LedgerProperties - Additional Confidential Ledger properties.

func (LedgerProperties) MarshalJSON

func (l LedgerProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LedgerProperties.

func (*LedgerProperties) UnmarshalJSON added in v1.1.0

func (l *LedgerProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LedgerProperties.

type LedgerRoleName

type LedgerRoleName string

LedgerRoleName - LedgerRole associated with the Security Principal of Ledger

const (
	LedgerRoleNameAdministrator LedgerRoleName = "Administrator"
	LedgerRoleNameContributor   LedgerRoleName = "Contributor"
	LedgerRoleNameReader        LedgerRoleName = "Reader"
)

func PossibleLedgerRoleNameValues

func PossibleLedgerRoleNameValues() []LedgerRoleName

PossibleLedgerRoleNameValues returns the possible values for the LedgerRoleName const type.

type LedgerType

type LedgerType string

LedgerType - Type of the ledger. Private means transaction data is encrypted.

const (
	LedgerTypePrivate LedgerType = "Private"
	LedgerTypePublic  LedgerType = "Public"
	LedgerTypeUnknown LedgerType = "Unknown"
)

func PossibleLedgerTypeValues

func PossibleLedgerTypeValues() []LedgerType

PossibleLedgerTypeValues returns the possible values for the LedgerType const type.

type List added in v0.2.0

type List struct {
	// The URL the client should use to fetch the next page (per server side paging).
	NextLink *string

	// List of Confidential Ledgers
	Value []*ConfidentialLedger
}

List - Object that includes an array of Confidential Ledgers and a possible link for next set.

func (List) MarshalJSON added in v0.2.0

func (l List) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type List.

func (*List) UnmarshalJSON added in v1.1.0

func (l *List) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type List.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Retrieves a list of available API operations

Generated from API version 2022-05-13

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/792db17291c758b2bfdbbc0d35d0e2f5b5a1bd05/specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/stable/2022-05-13/examples/Operations_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/confidentialledger/armconfidentialledger"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armconfidentialledger.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(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.ResourceProviderOperationList = armconfidentialledger.ResourceProviderOperationList{
		// 	Value: []*armconfidentialledger.ResourceProviderOperationDefinition{
		// 		{
		// 			Name: to.Ptr("Microsoft.ConfidentialLedger/ledgers/read"),
		// 			Display: &armconfidentialledger.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("View the properties of a Confidential Ledger"),
		// 				Operation: to.Ptr("Get Confidential Ledger properties"),
		// 				Resource: to.Ptr("ledger"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// List containing this Resource Provider's available operations.
	ResourceProviderOperationList
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type ProvisioningState

type ProvisioningState string

ProvisioningState - Object representing ProvisioningState for Confidential Ledger.

const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUnknown   ProvisioningState = "Unknown"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type ResourceProviderOperationDefinition

type ResourceProviderOperationDefinition struct {
	// Details about the operations
	Display *ResourceProviderOperationDisplay

	// Indicates whether the operation is data action or not.
	IsDataAction *bool

	// Resource provider operation name.
	Name *string
}

ResourceProviderOperationDefinition - Describes the Resource Provider Operation.

func (ResourceProviderOperationDefinition) MarshalJSON added in v1.1.0

func (r ResourceProviderOperationDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDefinition.

func (*ResourceProviderOperationDefinition) UnmarshalJSON added in v1.1.0

func (r *ResourceProviderOperationDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDefinition.

type ResourceProviderOperationDisplay

type ResourceProviderOperationDisplay struct {
	// Description of the resource provider operation.
	Description *string

	// Name of the resource provider operation.
	Operation *string

	// Name of the resource provider.
	Provider *string

	// Name of the resource type.
	Resource *string
}

ResourceProviderOperationDisplay - Describes the properties of the Operation.

func (ResourceProviderOperationDisplay) MarshalJSON added in v1.1.0

func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay.

func (*ResourceProviderOperationDisplay) UnmarshalJSON added in v1.1.0

func (r *ResourceProviderOperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay.

type ResourceProviderOperationList

type ResourceProviderOperationList struct {
	// READ-ONLY; The URI that can be used to request the next page for list of Azure operations.
	NextLink *string

	// READ-ONLY; Resource provider operations list.
	Value []*ResourceProviderOperationDefinition
}

ResourceProviderOperationList - List containing this Resource Provider's available operations.

func (ResourceProviderOperationList) MarshalJSON

func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList.

func (*ResourceProviderOperationList) UnmarshalJSON added in v1.1.0

func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL