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) 41 42type BaseClient struct { 43 autorest.Client 44 BaseURI string 45 SubscriptionID string 46} 47 48type Client struct { 49 BaseClient 50} 51 52func DoNothing() { 53} 54 55func DoNothingWithParam(foo int) { 56} 57 58func New(subscriptionID string) BaseClient { 59 return NewWithBaseURI(DefaultBaseURI, subscriptionID) 60} 61 62func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { 63 return BaseClient{ 64 Client: autorest.NewClientWithUserAgent(UserAgent()), 65 BaseURI: baseURI, 66 SubscriptionID: subscriptionID, 67 } 68} 69 70func UserAgent() string { 71 return "Azure-SDK-For-Go/" + version.Number + " redis/2017-10-01" 72} 73 74type CreateParameters struct { 75 *CreateProperties `json:"properties,omitempty"` 76 Zones *[]string `json:"zones,omitempty"` 77 Location *string `json:"location,omitempty"` 78 Tags map[string]*string `json:"tags"` 79} 80 81func (cp CreateParameters) MarshalJSON() ([]byte, error) { 82 return nil, nil 83} 84 85func (cp *CreateParameters) UnmarshalJSON(body []byte) error { 86 return nil 87} 88 89type CreateProperties struct { 90 SubnetID *string `json:"subnetId,omitempty"` 91 StaticIP *string `json:"staticIP,omitempty"` 92 RedisConfiguration map[string]*string `json:"redisConfiguration"` 93 EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` 94 TenantSettings map[string]*string `json:"tenantSettings"` 95 ShardCount *int32 `json:"shardCount,omitempty"` 96} 97 98type DeleteFuture struct { 99 azure.Future 100 req *http.Request 101} 102 103func (future DeleteFuture) Result(client Client) (ar autorest.Response, err error) { 104 return 105} 106 107type ListResult struct { 108 autorest.Response `json:"-"` 109 Value *[]ResourceType `json:"value,omitempty"` 110 NextLink *string `json:"nextLink,omitempty"` 111} 112 113func (lr ListResult) IsEmpty() bool { 114 return lr.Value == nil || len(*lr.Value) == 0 115} 116 117type ListResultPage struct { 118 fn func(ListResult) (ListResult, error) 119 lr ListResult 120} 121 122func (page *ListResultPage) Next() error { 123 return nil 124} 125 126func (page ListResultPage) NotDone() bool { 127 return !page.lr.IsEmpty() 128} 129 130func (page ListResultPage) Response() ListResult { 131 return page.lr 132} 133 134func (page ListResultPage) Values() []ResourceType { 135 return *page.lr.Value 136} 137 138type ResourceType struct { 139 autorest.Response `json:"-"` 140 Zones *[]string `json:"zones,omitempty"` 141 Tags map[string]*string `json:"tags"` 142 Location *string `json:"location,omitempty"` 143 ID *string `json:"id,omitempty"` 144 Name *string `json:"name,omitempty"` 145 Type *string `json:"type,omitempty"` 146} 147 148func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { 149 return 150} 151 152func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { 153 const APIVersion = "2017-10-01" 154 return nil, nil 155} 156 157func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { 158 return 159} 160 161func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 162 return 163} 164 165func (client Client) List(ctx context.Context) (result ListResultPage, err error) { 166 return 167} 168 169func (client Client) ListPreparer(ctx context.Context) (*http.Request, error) { 170 const APIVersion = "2017-10-01" 171 return nil, nil 172} 173 174func (client Client) ListSender(req *http.Request) (*http.Response, error) { 175 return nil, nil 176} 177 178func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { 179 return 180} 181 182func (client Client) listNextResults(lastResults ListResult) (result ListResult, err error) { 183 return 184} 185 186type SomeInterface interface { 187 One() 188 Two(bool) 189} 190 191type AnotherInterface interface { 192 One() 193} 194