@@ -40,6 +40,18 @@ func NewQueueClientWithConfigurationProvider(configProvider common.Configuration
40
40
return newQueueClientFromBaseClient (baseClient , provider )
41
41
}
42
42
43
+ // NewQueueClientWithConfigurationProviderWithEndpoint Creates a new default Queue client with the given configuration provider and the Queue endpoint.
44
+ // the configuration provider will be used for the default signer as well as reading the region
45
+ func NewQueueClientWithConfigurationProviderWithEndpoint (configProvider common.ConfigurationProvider , endpoint string ) (client QueueClient , err error ) {
46
+ client , err = NewQueueClientWithConfigurationProvider (configProvider )
47
+ if err != nil {
48
+ return client , err
49
+ }
50
+
51
+ client .SetEndpoint (endpoint )
52
+ return client , nil
53
+ }
54
+
43
55
// NewQueueClientWithOboToken Creates a new default Queue client with the given configuration provider.
44
56
// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer
45
57
//
@@ -53,6 +65,20 @@ func NewQueueClientWithOboToken(configProvider common.ConfigurationProvider, obo
53
65
return newQueueClientFromBaseClient (baseClient , configProvider )
54
66
}
55
67
68
+ // NewQueueClientWithOboTokenWithEndpoint Creates a new default Queue client with the given configuration provider and endpoint.
69
+ // The obotoken will be added to default headers and signed; the configuration provider will be used for the signer
70
+ //
71
+ // as well as reading the region
72
+ func NewQueueClientWithOboTokenWithEndpoint (configProvider common.ConfigurationProvider , oboToken , endpoint string ) (client QueueClient , err error ) {
73
+ client , err = NewQueueClientWithOboToken (configProvider , oboToken )
74
+ if err != nil {
75
+ return client , err
76
+ }
77
+
78
+ client .SetEndpoint (endpoint )
79
+ return client , nil
80
+ }
81
+
56
82
func newQueueClientFromBaseClient (baseClient common.BaseClient , configProvider common.ConfigurationProvider ) (client QueueClient , err error ) {
57
83
// Queue service default circuit breaker is enabled
58
84
baseClient .Configuration .CircuitBreaker = common .NewCircuitBreaker (common .DefaultCircuitBreakerSettingWithServiceName ("Queue" ))
@@ -66,10 +92,16 @@ func newQueueClientFromBaseClient(baseClient common.BaseClient, configProvider c
66
92
}
67
93
68
94
// SetRegion overrides the region of this client.
95
+ // Deprecated: SetReion is deprecated because each Queue's endpoint is different
69
96
func (client * QueueClient ) SetRegion (region string ) {
70
97
client .Host = common .StringToRegion (region ).EndpointForTemplate ("queue" , "https://messaging.{region}.oci.{secondLevelDomain}" )
71
98
}
72
99
100
+ // SetEndpoint overrides the endpoint of this client.
101
+ func (client * QueueClient ) SetEndpoint (endpoint string ) {
102
+ client .Host = endpoint
103
+ }
104
+
73
105
// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid
74
106
func (client * QueueClient ) setConfigurationProvider (configProvider common.ConfigurationProvider ) error {
75
107
if ok , err := common .IsConfigurationProviderValid (configProvider ); ! ok {
0 commit comments