{"action":"created","issue":{"url":"https://api.github.com/repos/stripe/stripe-java/issues/264","labels_url":"https://api.github.com/repos/stripe/stripe-java/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/stripe/stripe-java/issues/264/comments","events_url":"https://api.github.com/repos/stripe/stripe-java/issues/264/events","html_url":"https://github.com/stripe/stripe-java/issues/264","id":128043095,"number":264,"title":"InvoiceLineItemCollection provided by getLines doesn't get same auth request options with autoPagingIterable","user":{"login":"keithblaha","id":1039863,"avatar_url":"https://avatars.githubusercontent.com/u/1039863?v=3","gravatar_id":"","url":"https://api.github.com/users/keithblaha","html_url":"https://github.com/keithblaha","followers_url":"https://api.github.com/users/keithblaha/followers","following_url":"https://api.github.com/users/keithblaha/following{/other_user}","gists_url":"https://api.github.com/users/keithblaha/gists{/gist_id}","starred_url":"https://api.github.com/users/keithblaha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithblaha/subscriptions","organizations_url":"https://api.github.com/users/keithblaha/orgs","repos_url":"https://api.github.com/users/keithblaha/repos","events_url":"https://api.github.com/users/keithblaha/events{/privacy}","received_events_url":"https://api.github.com/users/keithblaha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-21T23:09:22Z","updated_at":"2016-01-25T23:18:32Z","closed_at":null,"body":"I'm using this library in a multithreaded environment against various keys granted via oauth by Stripe users for my app, so I provide the appropriate key in request options for each call I make. However, it seems like some of the models' methods don't copy these credentials on additional requests that are made.\r\n\r\ne.g., I call Invoice.list passing my request options, and then on each invoice I call getLines and use the autoPagingIterable to access all invoice line items. However, for any invoice with enough line items such that an additional request is needed I get an exception like this:\r\n\r\n```\r\njava.lang.RuntimeException: Unable to lazy-load stripe objects\r\nCaused by: com.stripe.exception.AuthenticationException: No API key provided. (HINT: set your API key using 'Stripe.apiKey = <API-KEY>'. You can generate API keys from the Stripe web interface. See https://stripe.com/api for details or email support@stripe.com if you have questions.\r\n```\r\n\r\ne: I'm using 1.41.0"},"comment":{"url":"https://api.github.com/repos/stripe/stripe-java/issues/comments/174725144","html_url":"https://github.com/stripe/stripe-java/issues/264#issuecomment-174725144","issue_url":"https://api.github.com/repos/stripe/stripe-java/issues/264","id":174725144,"user":{"login":"brandur","id":96890,"avatar_url":"https://avatars.githubusercontent.com/u/96890?v=3","gravatar_id":"","url":"https://api.github.com/users/brandur","html_url":"https://github.com/brandur","followers_url":"https://api.github.com/users/brandur/followers","following_url":"https://api.github.com/users/brandur/following{/other_user}","gists_url":"https://api.github.com/users/brandur/gists{/gist_id}","starred_url":"https://api.github.com/users/brandur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandur/subscriptions","organizations_url":"https://api.github.com/users/brandur/orgs","repos_url":"https://api.github.com/users/brandur/repos","events_url":"https://api.github.com/users/brandur/events{/privacy}","received_events_url":"https://api.github.com/users/brandur/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T23:18:32Z","updated_at":"2016-01-25T23:18:32Z","body":"@keithblaha Thanks for the repro! That definitely helps me a lot.\r\n\r\nOkay, I see what's going on here. The auto-paginator essentially relies on passing parameters and options off to new `StripeCollection` instances that are created in order to produce a chain of successful auths. The problem here is that subcollections (e.g. invoice items) that are instantiated below a parent resource item (e.g. invoices) are not handed new parameters or options and therefore cannot paginate. I'm taking a look now to see what we can do about it."}}