1// Copyright (c) Microsoft Corporation. All rights reserved. 2// Licensed under the MIT License. See License.txt in the project root for license information. 3 4package testdata 5 6import ( 7 "context" 8 "net/http" 9 10 "github.com/Azure/azure-sdk-for-go/version" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/azure" 13) 14 15// content lifted from redis 16 17const ( 18 DefaultBaseURI = "https://management.azure.com" 19) 20 21type DayOfWeek string 22 23const ( 24 Everyday DayOfWeek = "Everyday" 25 Friday DayOfWeek = "Friday" 26 Monday DayOfWeek = "Monday" 27 Saturday DayOfWeek = "Saturday" 28 Sunday DayOfWeek = "Sunday" 29 Thursday DayOfWeek = "Thursday" 30 Tuesday DayOfWeek = "Tuesday" 31 Wednesday DayOfWeek = "Wednesday" 32 Weekend DayOfWeek = "Weekend" 33) 34 35type KeyType string 36 37const ( 38 Primary KeyType = "Primary" 39 Secondary KeyType = "Secondary" 40 Backup = KeyType("Backup") 41) 42 43type BaseClient struct { 44 autorest.Client 45 BaseURI string 46 SubscriptionID string 47} 48 49type Client struct { 50 BaseClient 51} 52 53func DoNothing() { 54} 55 56func DoNothingWithParam(foo int) { 57} 58 59func New(subscriptionID string) BaseClient { 60 return NewWithBaseURI(DefaultBaseURI, subscriptionID) 61} 62 63func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { 64 return BaseClient{ 65 Client: autorest.NewClientWithUserAgent(UserAgent()), 66 BaseURI: baseURI, 67 SubscriptionID: subscriptionID, 68 } 69} 70 71func UserAgent() string { 72 return "Azure-SDK-For-Go/" + version.Number + " redis/2017-10-01" 73} 74 75type CreateParameters struct { 76 *CreateProperties `json:"properties,omitempty"` 77 Zones *[]string `json:"zones,omitempty"` 78 Location *string `json:"location,omitempty"` 79 Tags map[string]*string `json:"tags"` 80} 81 82func (cp CreateParameters) MarshalJSON() ([]byte, error) { 83 return nil, nil 84} 85 86func (cp *CreateParameters) UnmarshalJSON(body []byte) error { 87 return nil 88} 89 90type CreateProperties struct { 91 SubnetID *string `json:"subnetId,omitempty"` 92 StaticIP *string `json:"staticIP,omitempty"` 93 RedisConfiguration map[string]*string `json:"redisConfiguration"` 94 EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` 95 TenantSettings map[string]*string `json:"tenantSettings"` 96 ShardCount *int32 `json:"shardCount,omitempty"` 97} 98 99type DeleteFuture struct { 100 azure.Future 101 req *http.Request 102} 103 104func (future DeleteFuture) Result(client Client) (ar autorest.Response, err error) { 105 return 106} 107 108type ListResult struct { 109 autorest.Response `json:"-"` 110 Value *[]ResourceType `json:"value,omitempty"` 111 NextLink *string `json:"nextLink,omitempty"` 112} 113 114func (lr ListResult) IsEmpty() bool { 115 return lr.Value == nil || len(*lr.Value) == 0 116} 117 118type ListResultPage struct { 119 fn func(ListResult) (ListResult, error) 120 lr ListResult 121} 122 123func (page *ListResultPage) Next() error { 124 return nil 125} 126 127func (page ListResultPage) NotDone() bool { 128 return !page.lr.IsEmpty() 129} 130 131func (page ListResultPage) Response() ListResult { 132 return page.lr 133} 134 135func (page ListResultPage) Values() []ResourceType { 136 return *page.lr.Value 137} 138 139type ResourceType struct { 140 autorest.Response `json:"-"` 141 Zones *[]string `json:"zones,omitempty"` 142 Tags map[string]*string `json:"tags"` 143 Location *string `json:"location,omitempty"` 144 ID *string `json:"id,omitempty"` 145 Name *string `json:"name,omitempty"` 146 Type *string `json:"type,omitempty"` 147} 148 149func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { 150 return 151} 152 153func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { 154 const APIVersion = "2017-10-01" 155 return nil, nil 156} 157 158func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { 159 return 160} 161 162func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 163 return 164} 165 166func (client Client) List(ctx context.Context) (result ListResultPage, err error) { 167 return 168} 169 170func (client Client) ListPreparer(ctx context.Context) (*http.Request, error) { 171 const APIVersion = "2017-10-01" 172 return nil, nil 173} 174 175func (client Client) ListSender(req *http.Request) (*http.Response, error) { 176 return nil, nil 177} 178 179func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { 180 return 181} 182 183func (client Client) listNextResults(lastResults ListResult) (result ListResult, err error) { 184 return 185} 186 187type SomeInterface interface { 188 One() 189 Two(bool) 190 Three() string 191 Four(int) error 192 Five(int, bool) (int, error) 193} 194