Skip to content

Commit

Permalink
Change generated client package name and version (#52)
Browse files Browse the repository at this point in the history
* feat(dependecy): change generated client package name and version

* change(lint): fix lint issue (#53)
  • Loading branch information
dfana01 authored Jan 12, 2023
1 parent 05cb22c commit d1f7acc
Show file tree
Hide file tree
Showing 31 changed files with 105 additions and 104 deletions.
6 changes: 3 additions & 3 deletions integration_tests/ads/test_ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from pinterest.ads.ads import Ad

from pinterest.generated.client.exceptions import ApiValueError
from pinterest.generated.client.exceptions import NotFoundException
from pinterest.generated.client.model.entity_status import EntityStatus
from openapi_generated.pinterest_client.exceptions import ApiValueError
from openapi_generated.pinterest_client.exceptions import NotFoundException
from openapi_generated.pinterest_client.model.entity_status import EntityStatus

from integration_tests.base_test import BaseTestCase
from integration_tests.config import DEFAULT_PIN_ID, DEFAULT_AD_ACCOUNT_ID
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/ads/test_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from unittest.mock import patch

from pinterest.generated.client.model.objective_type import ObjectiveType
from pinterest.generated.client.exceptions import ApiValueError
from pinterest.generated.client.exceptions import NotFoundException
from openapi_generated.pinterest_client.model.objective_type import ObjectiveType
from openapi_generated.pinterest_client.exceptions import ApiValueError
from openapi_generated.pinterest_client.exceptions import NotFoundException

from pinterest.ads.ad_groups import AdGroup
from pinterest.ads.campaigns import Campaign
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/ads/test_customer_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from unittest.mock import patch

from pinterest.generated.client.exceptions import ApiValueError
from openapi_generated.pinterest_client.exceptions import ApiValueError

from pinterest.ads.customer_lists import CustomerList

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/ads/test_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pinterest.ads.keywords import Keyword
from pinterest.utils.sdk_exceptions import SdkException

from pinterest.generated.client.model.match_type_response import MatchTypeResponse
from openapi_generated.pinterest_client.model.match_type_response import MatchTypeResponse


class TestCreateKeyword(BaseTestCase):
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pinterest import config

from pinterest.generated.client.exceptions import UnauthorizedException
from openapi_generated.pinterest_client.exceptions import UnauthorizedException

from pinterest.organic.boards import Board
from pinterest.client import PinterestSDKClient
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/organic/test_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from unittest.mock import patch
from parameterized import parameterized

from pinterest.generated.client.exceptions import NotFoundException
from openapi_generated.pinterest_client.exceptions import NotFoundException

from pinterest.organic.boards import Board
from pinterest.organic.boards import BoardSection
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/organic/test_pins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
from parameterized import parameterized

from pinterest.generated.client.exceptions import NotFoundException
from openapi_generated.pinterest_client.exceptions import NotFoundException

from pinterest.organic.pins import Pin

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/utils/organic_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Provide helper and utility functions for Organic Endpoints Integration Testing
"""
from pinterest.generated.client.api.boards_api import BoardsApi
from pinterest.generated.client.model.board import Board as GeneratedBoard
from openapi_generated.pinterest_client.api.boards_api import BoardsApi
from openapi_generated.pinterest_client.model.board import Board as GeneratedBoard

from pinterest.client import PinterestSDKClient

Expand Down
12 changes: 6 additions & 6 deletions pinterest/ads/ad_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"""
from __future__ import annotations

from pinterest.generated.client.model.country import Country
from pinterest.generated.client.model.ad_account_owner import AdAccountOwner
from pinterest.generated.client.model.currency import Currency
from openapi_generated.pinterest_client.model.country import Country
from openapi_generated.pinterest_client.model.ad_account_owner import AdAccountOwner
from openapi_generated.pinterest_client.model.currency import Currency

from pinterest.generated.client.api.ad_accounts_api import AdAccountsApi
from pinterest.generated.client.model.ad_account import AdAccount as GeneratedAdAccount
from pinterest.generated.client.model.ad_account_create_request import AdAccountCreateRequest
from openapi_generated.pinterest_client.api.ad_accounts_api import AdAccountsApi
from openapi_generated.pinterest_client.model.ad_account import AdAccount as GeneratedAdAccount
from openapi_generated.pinterest_client.model.ad_account_create_request import AdAccountCreateRequest

from pinterest.client import PinterestSDKClient
from pinterest.ads.campaigns import Campaign
Expand Down
12 changes: 6 additions & 6 deletions pinterest/ads/ad_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"""
from __future__ import annotations

from pinterest.generated.client.api.ad_groups_api import AdGroupsApi
from openapi_generated.pinterest_client.api.ad_groups_api import AdGroupsApi

from pinterest.generated.client.model.action_type import ActionType
from pinterest.generated.client.model.budget_type import BudgetType
from pinterest.generated.client.model.ad_group_response import AdGroupResponse
from pinterest.generated.client.model.ad_group_create_request import AdGroupCreateRequest
from pinterest.generated.client.model.ad_group_update_request import AdGroupUpdateRequest
from openapi_generated.pinterest_client.model.action_type import ActionType
from openapi_generated.pinterest_client.model.budget_type import BudgetType
from openapi_generated.pinterest_client.model.ad_group_response import AdGroupResponse
from openapi_generated.pinterest_client.model.ad_group_create_request import AdGroupCreateRequest
from openapi_generated.pinterest_client.model.ad_group_update_request import AdGroupUpdateRequest

from pinterest.client import PinterestSDKClient
from pinterest.utils.base_model import PinterestBaseModel
Expand Down
12 changes: 6 additions & 6 deletions pinterest/ads/ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"""
from __future__ import annotations

from pinterest.generated.client.api.ads_api import AdsApi
from openapi_generated.pinterest_client.api.ads_api import AdsApi

from pinterest.generated.client.model.ad_response import AdResponse
from pinterest.generated.client.model.ad_create_request import AdCreateRequest
from pinterest.generated.client.model.creative_type import CreativeType
from pinterest.generated.client.model.entity_status import EntityStatus
from pinterest.generated.client.model.ad_update_request import AdUpdateRequest
from openapi_generated.pinterest_client.model.ad_response import AdResponse
from openapi_generated.pinterest_client.model.ad_create_request import AdCreateRequest
from openapi_generated.pinterest_client.model.creative_type import CreativeType
from openapi_generated.pinterest_client.model.entity_status import EntityStatus
from openapi_generated.pinterest_client.model.ad_update_request import AdUpdateRequest

from pinterest.client import PinterestSDKClient
from pinterest.utils.base_model import PinterestBaseModel
Expand Down
16 changes: 8 additions & 8 deletions pinterest/ads/audiences.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"""
from __future__ import annotations

from pinterest.generated.client.model.audience_type import AudienceType
from openapi_generated.pinterest_client.model.audience_type import AudienceType

from pinterest.generated.client.api.audiences_api import AudiencesApi
from openapi_generated.pinterest_client.api.audiences_api import AudiencesApi

from pinterest.generated.client.model.audience_create_request import AudienceCreateRequest
from pinterest.generated.client.model.audience_update_request import AudienceUpdateRequest
from openapi_generated.pinterest_client.model.audience_create_request import AudienceCreateRequest
from openapi_generated.pinterest_client.model.audience_update_request import AudienceUpdateRequest

from pinterest.generated.client.model.audience import Audience as GeneratedAudience
from pinterest.generated.client.model.audience_rule import AudienceRule
from pinterest.generated.client.model.audience_update_operation_type import AudienceUpdateOperationType
from pinterest.generated.client.model.objective_type import ObjectiveType
from openapi_generated.pinterest_client.model.audience import Audience as GeneratedAudience
from openapi_generated.pinterest_client.model.audience_rule import AudienceRule
from openapi_generated.pinterest_client.model.audience_update_operation_type import AudienceUpdateOperationType
from openapi_generated.pinterest_client.model.objective_type import ObjectiveType

from pinterest.client import PinterestSDKClient
from pinterest.utils.base_model import PinterestBaseModel
Expand Down
10 changes: 5 additions & 5 deletions pinterest/ads/campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"""
from __future__ import annotations

from pinterest.generated.client.api.campaigns_api import CampaignsApi
from openapi_generated.pinterest_client.api.campaigns_api import CampaignsApi

from pinterest.generated.client.model.campaign_response import CampaignResponse
from pinterest.generated.client.model.campaign_create_request import CampaignCreateRequest
from pinterest.generated.client.model.campaign_update_request import CampaignUpdateRequest
from openapi_generated.pinterest_client.model.campaign_response import CampaignResponse
from openapi_generated.pinterest_client.model.campaign_create_request import CampaignCreateRequest
from openapi_generated.pinterest_client.model.campaign_update_request import CampaignUpdateRequest

from pinterest.generated.client.model.objective_type import ObjectiveType
from openapi_generated.pinterest_client.model.objective_type import ObjectiveType

from pinterest.ads.ad_groups import AdGroup
from pinterest.client import PinterestSDKClient
Expand Down
10 changes: 5 additions & 5 deletions pinterest/ads/customer_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"""
from __future__ import annotations

from pinterest.generated.client.model.user_list_type import UserListType
from openapi_generated.pinterest_client.model.user_list_type import UserListType

from pinterest.generated.client.api.customer_lists_api import CustomerListsApi
from openapi_generated.pinterest_client.api.customer_lists_api import CustomerListsApi

from pinterest.generated.client.model.customer_list_request import CustomerListRequest
from pinterest.generated.client.model.customer_list import CustomerList as GeneratedCustomerList
from pinterest.generated.client.model.customer_list_update_request import CustomerListUpdateRequest
from openapi_generated.pinterest_client.model.customer_list_request import CustomerListRequest
from openapi_generated.pinterest_client.model.customer_list import CustomerList as GeneratedCustomerList
from openapi_generated.pinterest_client.model.customer_list_update_request import CustomerListUpdateRequest

from pinterest.client import PinterestSDKClient
from pinterest.utils.base_model import PinterestBaseModel
Expand Down
16 changes: 8 additions & 8 deletions pinterest/ads/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"""
from __future__ import annotations

from pinterest.generated.client.api.keywords_api import KeywordsApi
from pinterest.generated.client.model.match_type import MatchType
from pinterest.generated.client.model.keywords_common import KeywordsCommon
from pinterest.generated.client.model.keywords_request import KeywordsRequest
from pinterest.generated.client.model.keyword import Keyword as GeneratedKeyword
from pinterest.generated.client.model.match_type_response import MatchTypeResponse
from pinterest.generated.client.model.keyword_update_body import KeywordUpdateBody
from pinterest.generated.client.model.keyword_update import KeywordUpdate
from openapi_generated.pinterest_client.api.keywords_api import KeywordsApi
from openapi_generated.pinterest_client.model.match_type import MatchType
from openapi_generated.pinterest_client.model.keywords_common import KeywordsCommon
from openapi_generated.pinterest_client.model.keywords_request import KeywordsRequest
from openapi_generated.pinterest_client.model.keyword import Keyword as GeneratedKeyword
from openapi_generated.pinterest_client.model.match_type_response import MatchTypeResponse
from openapi_generated.pinterest_client.model.keyword_update_body import KeywordUpdateBody
from openapi_generated.pinterest_client.model.keyword_update import KeywordUpdate

from pinterest.client import PinterestSDKClient
from pinterest.utils.sdk_exceptions import SdkException
Expand Down
4 changes: 2 additions & 2 deletions pinterest/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
from importlib import reload

from pinterest.generated.client.configuration import Configuration
from pinterest.generated.client.api_client import ApiClient
from openapi_generated.pinterest_client.configuration import Configuration
from openapi_generated.pinterest_client.api_client import ApiClient
from pinterest import config
from pinterest.utils.refresh_access_token import get_new_access_token
from pinterest.utils.sdk_exceptions import SdkException
Expand Down
8 changes: 4 additions & 4 deletions pinterest/organic/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"""
from __future__ import annotations

from pinterest.generated.client.api.boards_api import BoardsApi
from pinterest.generated.client.model.board import Board as GeneratedBoard
from pinterest.generated.client.model.board_update import BoardUpdate
from openapi_generated.pinterest_client.api.boards_api import BoardsApi
from openapi_generated.pinterest_client.model.board import Board as GeneratedBoard
from openapi_generated.pinterest_client.model.board_update import BoardUpdate

from pinterest.generated.client.model.board_section import BoardSection as GeneratedBoardSection
from openapi_generated.pinterest_client.model.board_section import BoardSection as GeneratedBoardSection

from pinterest.organic.pins import Pin

Expand Down
6 changes: 3 additions & 3 deletions pinterest/organic/pins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"""
from __future__ import annotations

from pinterest.generated.client.api.pins_api import PinsApi
from pinterest.generated.client.model.pin import Pin as GeneratedPin
from pinterest.generated.client.model.inline_object import InlineObject
from openapi_generated.pinterest_client.api.pins_api import PinsApi
from openapi_generated.pinterest_client.model.pin import Pin as GeneratedPin
from openapi_generated.pinterest_client.model.inline_object import InlineObject

from pinterest.client import PinterestSDKClient
from pinterest.utils.base_model import PinterestBaseModel
Expand Down
3 changes: 2 additions & 1 deletion pinterest/utils/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"""
from typing import Callable

from openapi_generated.pinterest_client.exceptions import ApiTypeError

from pinterest.client import PinterestSDKClient

from pinterest.utils.error_handling import verify_api_response
from pinterest.utils.bookmark import Bookmark

from pinterest.generated.client.exceptions import ApiTypeError


class PinterestBaseModel:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pinterest-Generated-Client==0.1.4
Pinterest-Generated-Client==0.1.5
python-dateutil==2.8.2
six==1.16.0
urllib3==1.26.12
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"python-dateutil",
"python-dotenv==0.20.0",
"six==1.16.0",
"Pinterest-Generated-Client==0.1.4"
"Pinterest-Generated-Client==0.1.5"
]

long_description = (Path(__file__).parent / "README.md").read_text()
Expand Down
12 changes: 6 additions & 6 deletions tests/src/pinterest/ads/test_ad_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from unittest import TestCase
from unittest.mock import patch

from pinterest.generated.client.model.ad_account import AdAccount as GeneratedAdAccount
from pinterest.generated.client.model.customer_list import CustomerList as GeneratedCustomerList
from pinterest.generated.client.model.country import Country
from pinterest.generated.client.model.ad_account_owner import AdAccountOwner
from pinterest.generated.client.model.currency import Currency
from openapi_generated.pinterest_client.model.ad_account import AdAccount as GeneratedAdAccount
from openapi_generated.pinterest_client.model.customer_list import CustomerList as GeneratedCustomerList
from openapi_generated.pinterest_client.model.country import Country
from openapi_generated.pinterest_client.model.ad_account_owner import AdAccountOwner
from openapi_generated.pinterest_client.model.currency import Currency

from pinterest.generated.client.model.campaign_response import CampaignResponse
from openapi_generated.pinterest_client.model.campaign_response import CampaignResponse

from pinterest.ads.ad_accounts import AdAccount
from pinterest.ads.campaigns import Campaign
Expand Down
8 changes: 4 additions & 4 deletions tests/src/pinterest/ads/test_ad_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from unittest import TestCase
from unittest.mock import patch

from pinterest.generated.client.model.ad_response import AdResponse
from pinterest.generated.client.model.ad_group_response import AdGroupResponse
from pinterest.generated.client.model.ad_group_array_response import AdGroupArrayResponse
from pinterest.generated.client.model.ad_group_array_response_element import AdGroupArrayResponseElement
from openapi_generated.pinterest_client.model.ad_response import AdResponse
from openapi_generated.pinterest_client.model.ad_group_response import AdGroupResponse
from openapi_generated.pinterest_client.model.ad_group_array_response import AdGroupArrayResponse
from openapi_generated.pinterest_client.model.ad_group_array_response_element import AdGroupArrayResponseElement

from pinterest.ads.ad_groups import AdGroup
from pinterest.ads.ads import Ad
Expand Down
10 changes: 5 additions & 5 deletions tests/src/pinterest/ads/test_ads.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from unittest import TestCase
from unittest.mock import patch

from pinterest.generated.client.model.ad_response import AdResponse
from pinterest.generated.client.model.entity_status import EntityStatus
from pinterest.generated.client.model.ad_array_response import AdArrayResponse
from pinterest.generated.client.model.ad_array_response_element import AdArrayResponseElement
from pinterest.generated.client.model.exception import Exception as ModelException
from openapi_generated.pinterest_client.model.ad_response import AdResponse
from openapi_generated.pinterest_client.model.entity_status import EntityStatus
from openapi_generated.pinterest_client.model.ad_array_response import AdArrayResponse
from openapi_generated.pinterest_client.model.ad_array_response_element import AdArrayResponseElement
from openapi_generated.pinterest_client.model.exception import Exception as ModelException

from pinterest.ads.ads import Ad

Expand Down
4 changes: 2 additions & 2 deletions tests/src/pinterest/ads/test_audiences.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from unittest import TestCase
from unittest.mock import patch

from pinterest.generated.client.model.audience import Audience as GeneratedAudience
from pinterest.generated.client.model.audience_rule import AudienceRule
from openapi_generated.pinterest_client.model.audience import Audience as GeneratedAudience
from openapi_generated.pinterest_client.model.audience_rule import AudienceRule

from pinterest.ads.audiences import Audience

Expand Down
12 changes: 6 additions & 6 deletions tests/src/pinterest/ads/test_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from unittest import TestCase
from unittest.mock import patch

from pinterest.generated.client.model.campaign_response import CampaignResponse
from pinterest.generated.client.model.campaign_create_response import CampaignCreateResponse
from pinterest.generated.client.model.campaign_create_response_item import CampaignCreateResponseItem
from pinterest.generated.client.model.campaign_create_response_data import CampaignCreateResponseData
from pinterest.generated.client.model.campaign_update_response import CampaignUpdateResponse
from pinterest.generated.client.model.objective_type import ObjectiveType
from openapi_generated.pinterest_client.model.campaign_response import CampaignResponse
from openapi_generated.pinterest_client.model.campaign_create_response import CampaignCreateResponse
from openapi_generated.pinterest_client.model.campaign_create_response_item import CampaignCreateResponseItem
from openapi_generated.pinterest_client.model.campaign_create_response_data import CampaignCreateResponseData
from openapi_generated.pinterest_client.model.campaign_update_response import CampaignUpdateResponse
from openapi_generated.pinterest_client.model.objective_type import ObjectiveType

from pinterest.ads.campaigns import Campaign

Expand Down
2 changes: 1 addition & 1 deletion tests/src/pinterest/ads/test_customer_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from unittest.mock import patch
from webbrowser import get

from pinterest.generated.client.model.customer_list import CustomerList as GeneratedCustomerList
from openapi_generated.pinterest_client.model.customer_list import CustomerList as GeneratedCustomerList

from pinterest.ads.customer_lists import CustomerList

Expand Down
Loading

0 comments on commit d1f7acc

Please sign in to comment.