Skip to content

Commit

Permalink
videoanalyzer: updating to the latest embedded sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Nov 12, 2021
1 parent cfa47b7 commit ef67b84
Show file tree
Hide file tree
Showing 21 changed files with 230 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ func (id AccessPoliciesId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Access Policies ID
func (id AccessPoliciesId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("providers", "providers", "providers"),
resourceids.ResourceProviderSegment("microsoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("videoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.UserSpecifiedSegment("accountName", "accountValue"),
resourceids.StaticSegment("accessPolicies", "accessPolicies", "accessPolicies"),
resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"),
resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyValue"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,18 @@ func TestParseAccessPoliciesIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForAccessPoliciesId(t *testing.T) {
segments := AccessPoliciesId{}.Segments()
if len(segments) == 0 {
t.Fatalf("AccessPoliciesId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ func (id EdgeModuleId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Edge Module ID
func (id EdgeModuleId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("providers", "providers", "providers"),
resourceids.ResourceProviderSegment("microsoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("videoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.UserSpecifiedSegment("accountName", "accountValue"),
resourceids.StaticSegment("edgeModules", "edgeModules", "edgeModules"),
resourceids.StaticSegment("staticEdgeModules", "edgeModules", "edgeModules"),
resourceids.UserSpecifiedSegment("edgeModuleName", "edgeModuleValue"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,18 @@ func TestParseEdgeModuleIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForEdgeModuleId(t *testing.T) {
segments := EdgeModuleId{}.Segments()
if len(segments) == 0 {
t.Fatalf("EdgeModuleId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ func (id LocationId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Location ID
func (id LocationId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("providers", "providers", "providers"),
resourceids.ResourceProviderSegment("microsoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("locations", "locations", "locations"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("staticLocations", "locations", "locations"),
resourceids.UserSpecifiedSegment("locationName", "locationValue"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,18 @@ func TestParseLocationIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForLocationId(t *testing.T) {
segments := LocationId{}.Segments()
if len(segments) == 0 {
t.Fatalf("LocationId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func (id ResourceGroupId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Resource Group ID
func (id ResourceGroupId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,18 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForResourceGroupId(t *testing.T) {
segments := ResourceGroupId{}.Segments()
if len(segments) == 0 {
t.Fatalf("ResourceGroupId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (id SubscriptionId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Subscription ID
func (id SubscriptionId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,18 @@ func TestParseSubscriptionIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForSubscriptionId(t *testing.T) {
segments := SubscriptionId{}.Segments()
if len(segments) == 0 {
t.Fatalf("SubscriptionId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ func (id VideoId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Video ID
func (id VideoId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("providers", "providers", "providers"),
resourceids.ResourceProviderSegment("microsoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("videoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.UserSpecifiedSegment("accountName", "accountValue"),
resourceids.StaticSegment("videos", "videos", "videos"),
resourceids.StaticSegment("staticVideos", "videos", "videos"),
resourceids.UserSpecifiedSegment("videoName", "videoValue"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,18 @@ func TestParseVideoIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForVideoId(t *testing.T) {
segments := VideoId{}.Segments()
if len(segments) == 0 {
t.Fatalf("VideoId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ func (id VideoAnalyzerId) ID() string {
// Segments returns a slice of Resource ID Segments which comprise this Video Analyzer ID
func (id VideoAnalyzerId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("subscriptions", "subscriptions", "subscriptions"),
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("resourceGroups", "resourceGroups", "resourceGroups"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("providers", "providers", "providers"),
resourceids.ResourceProviderSegment("microsoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("videoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"),
resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"),
resourceids.UserSpecifiedSegment("accountName", "accountValue"),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,18 @@ func TestParseVideoAnalyzerIDInsensitively(t *testing.T) {

}
}

func TestSegmentsForVideoAnalyzerId(t *testing.T) {
segments := VideoAnalyzerId{}.Segments()
if len(segments) == 0 {
t.Fatalf("VideoAnalyzerId has no segments")
}

uniqueNames := make(map[string]struct{}, 0)
for _, segment := range segments {
uniqueNames[segment.Name] = struct{}{}
}
if len(uniqueNames) != len(segments) {
t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import (
"fmt"
)

var _ TokenKey = EccTokenKey{}

type EccTokenKey struct {
Alg AccessPolicyEccAlgo `json:"alg"`
X string `json:"x"`
Y string `json:"y"`

// Fields inherited from TokenKey
Kid string `json:"kid"`
}

var _ json.Marshaler = EccTokenKey{}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
package videoanalyzer

import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/dates"
)

type EdgeModuleProvisioningToken struct {
ExpirationDate *string `json:"expirationDate,omitempty"`
Token *string `json:"token,omitempty"`
}

func (o EdgeModuleProvisioningToken) GetExpirationDateAsTime() (*time.Time, error) {
if o.ExpirationDate == nil {
return nil, nil
}
return dates.ParseAsFormat(o.ExpirationDate, "2006-01-02T15:04:05Z07:00")
}

func (o EdgeModuleProvisioningToken) SetExpirationDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.ExpirationDate = &formatted
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import (
"fmt"
)

var _ AuthenticationBase = JwtAuthentication{}

type JwtAuthentication struct {
Audiences *[]string `json:"audiences,omitempty"`
Claims *[]TokenClaim `json:"claims,omitempty"`
Issuers *[]string `json:"issuers,omitempty"`
Keys *[]TokenKey `json:"keys,omitempty"`

// Fields inherited from AuthenticationBase
}

var _ json.Marshaler = JwtAuthentication{}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package videoanalyzer

import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/dates"
)

type ListProvisioningTokenInput struct {
ExpirationDate string `json:"expirationDate"`
}

func (o ListProvisioningTokenInput) GetExpirationDateAsTime() (*time.Time, error) {
return dates.ParseAsFormat(&o.ExpirationDate, "2006-01-02T15:04:05Z07:00")
}

func (o ListProvisioningTokenInput) SetExpirationDateAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.ExpirationDate = formatted
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import (
"fmt"
)

var _ TokenKey = RsaTokenKey{}

type RsaTokenKey struct {
Alg AccessPolicyRsaAlgo `json:"alg"`
E string `json:"e"`
N string `json:"n"`

// Fields inherited from TokenKey
Kid string `json:"kid"`
}

var _ json.Marshaler = RsaTokenKey{}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package videoanalyzer

import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/dates"
)

type SystemData struct {
CreatedAt *string `json:"createdAt,omitempty"`
CreatedBy *string `json:"createdBy,omitempty"`
Expand All @@ -8,3 +14,27 @@ type SystemData struct {
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"`
}

func (o SystemData) GetCreatedAtAsTime() (*time.Time, error) {
if o.CreatedAt == nil {
return nil, nil
}
return dates.ParseAsFormat(o.CreatedAt, "2006-01-02T15:04:05Z07:00")
}

func (o SystemData) SetCreatedAtAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.CreatedAt = &formatted
}

func (o SystemData) GetLastModifiedAtAsTime() (*time.Time, error) {
if o.LastModifiedAt == nil {
return nil, nil
}
return dates.ParseAsFormat(o.LastModifiedAt, "2006-01-02T15:04:05Z07:00")
}

func (o SystemData) SetLastModifiedAtAsTime(input time.Time) {
formatted := input.Format("2006-01-02T15:04:05Z07:00")
o.LastModifiedAt = &formatted
}
Loading

0 comments on commit ef67b84

Please sign in to comment.