Reputation: 646
I'm using the Google URL Shortner API, https://code.google.com/p/google-api-dotnet-client/wiki/APIs#URL_Shortener_API, and need to set the quotaUser parameter. This should be do-able via the service.ServiceParameters dictionary and quotaUser is already a key in the dictionary, but it's read only so I can't set the value of quotaUser to what I need it to be. Any thoughts on how to accomplish this? I don't see why they would provide the dictionary but then no way to set the values in it.
Upvotes: 0
Views: 488
Reputation: 3512
Each service request contains QuotaUser property, so you can set as you want. For example look in following sample code:
var service = new UrlshortenerService(new BaseClientService.Initializer()
{
Authenticator = auth,
ApplicationName = "PUT_HERE_YOUR_APP_NAME",
});
// some code here...
// create the request set its quota and execute
var request = service.Url.List();
request.QuotaUser = "PUT_HERE_YOUR_QUOTA"
UrlHistory result = request.Execute();
Take a look in our UrlshortenerService sample here for full sample for how to use Urlshortener service (I added the QuotaUser property after line 72)
Upvotes: 1