| 1 | package scwscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ |
| 2 | |
| 3 | import ( |
| 4 | "contextscip-go gomod github.com/golang/go/src go1.17 context/" |
| 5 | |
| 6 | "github.com/scaleway/scaleway-sdk-go/internal/authscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/internal/auth`/" |
| 7 | ) |
| 8 | |
| 9 | // RequestOption is a function that applies options to a ScalewayRequest. |
| 10 | type RequestOptionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/RequestOption# func(*ScalewayRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#) |
| 11 | |
| 12 | // WithContext request option sets the context of a ScalewayRequest |
| 13 | func WithContextscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/WithContext().(ctx contextscip-go gomod github.com/golang/go/src go1.17 context/.Contextscip-go gomod github.com/golang/go/src go1.17 context/Context#) RequestOptionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/RequestOption# { |
| 14 | return func(s *ScalewayRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#) { |
| 15 | s.ctxscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#ctx. = ctx |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | // WithAllPages aggregate all pages in the response of a List request. |
| 20 | // Will error when pagination is not supported on the request. |
| 21 | func WithAllPagesscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/WithAllPages().() RequestOptionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/RequestOption# { |
| 22 | return func(s *ScalewayRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#) { |
| 23 | s.allPagesscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#allPages. = true |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | // WithAuthRequest overwrites the client access key and secret key used in the request. |
| 28 | func WithAuthRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/WithAuthRequest().(accessKey, secretKey string) RequestOptionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/RequestOption# { |
| 29 | return func(s *ScalewayRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#) { |
| 30 | s.authscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#auth. = authscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/internal/auth`/.NewTokenscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/internal/auth`/NewToken().(accessKey, secretKey) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | // WithZones aggregate results from requested zones in the response of a List request. |
| 35 | // response rows are sorted by zone using order of given zones |
| 36 | // Will error when pagination is not supported on the request. |
| 37 | func WithZonesscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/WithZones().(zones ...Zonescip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/Zone#) RequestOptionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/RequestOption# { |
| 38 | return func(s *ScalewayRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#) { |
| 39 | s.zonesscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#zones. = append(s.zonesscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#zones., zones...) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // WithRegions aggregate results from requested regions in the response of a List request. |
| 44 | // response rows are sorted by region using order of given regions |
| 45 | // Will error when pagination is not supported on the request. |
| 46 | func WithRegionsscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/WithRegions().(regions ...Regionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/Region#) RequestOptionscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/RequestOption# { |
| 47 | return func(s *ScalewayRequestscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#) { |
| 48 | s.regionsscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#regions. = append(s.regionsscip-go gomod github.com/scaleway/scaleway-sdk-go . `github.com/scaleway/scaleway-sdk-go/scw`/ScalewayRequest#regions., regions...) |
| 49 | } |
| 50 | } |