From d1993f2feddb25262f83f32ea168a3b6088aa9f8 Mon Sep 17 00:00:00 2001 From: tcai Date: Mon, 9 Dec 2019 16:47:01 -0800 Subject: [PATCH] Remove license_models Remove license_models from SearchImages and SearchImagesCreative. Remove license_models unit tests to reflect the new behavior --- lib/Search/SearchImages.rb | 2 +- lib/Search/SearchImagesCreative.rb | 2 +- unit_tests/SearchImagesCreativeTests.rb | 12 ------------ unit_tests/SearchImagesTests.rb | 12 ------------ 4 files changed, 2 insertions(+), 26 deletions(-) diff --git a/lib/Search/SearchImages.rb b/lib/Search/SearchImages.rb index 4d94d80..cfef54b 100644 --- a/lib/Search/SearchImages.rb +++ b/lib/Search/SearchImages.rb @@ -6,7 +6,7 @@ class SearchImages < RequestBase API_ROUTE = "/v3/search/images" # mashery endpoint QUERY_PARAMS_NAMES = ["age_of_people","artists","collection_codes","collections_filter_type","color","compositions","embed_content_only","ethnicity","event_ids","exclude_nudity","fields", - "file_types","graphical_styles","keyword_ids","license_models","minimum_size","number_of_people","orientations","page","page_size","phrase","prestige_content_only","product_types", + "file_types","graphical_styles","keyword_ids","minimum_size","number_of_people","orientations","page","page_size","phrase","prestige_content_only","product_types", "sort_order","specific_people"] QUERY_PARAMS_NAMES.each do |key| diff --git a/lib/Search/SearchImagesCreative.rb b/lib/Search/SearchImagesCreative.rb index 8bc7346..7870a6a 100644 --- a/lib/Search/SearchImagesCreative.rb +++ b/lib/Search/SearchImagesCreative.rb @@ -6,7 +6,7 @@ class SearchImagesCreative < RequestBase API_ROUTE = "/v3/search/images/creative" # mashery endpoint QUERY_PARAMS_NAMES = ["age_of_people","artists","collection_codes","collections_filter_type","color","compositions","embed_content_only","ethnicity","exclude_nudity","fields","file_types", - "graphical_styles","keyword_ids","license_models","minimum_size","number_of_people","orientations","page","page_size","phrase","prestige_content_only","product_types", + "graphical_styles","keyword_ids","minimum_size","number_of_people","orientations","page","page_size","phrase","prestige_content_only","product_types", "sort_order"] QUERY_PARAMS_NAMES.each do |key| diff --git a/unit_tests/SearchImagesCreativeTests.rb b/unit_tests/SearchImagesCreativeTests.rb index d6702a9..7a03496 100644 --- a/unit_tests/SearchImagesCreativeTests.rb +++ b/unit_tests/SearchImagesCreativeTests.rb @@ -178,18 +178,6 @@ def test_search_images_creative_with_keyword_ids assert_equal({"message" => "success"}, search_results.to_hash ) end - def test_search_images_creative_with_license_models - stub_request(:get, "https://api.gettyimages.com/v3/search/images/creative").with(query: {"license_models" => ["rightsmanaged", "royaltyfree"].join(",")}) - .to_return(body: '{ "message": "success" }') - - apiClient = ApiClient.new("api key", "api secret") - search_results = apiClient.search_images_creative() - .with_license_models(["rightsmanaged", "royaltyfree"]) - .execute() - - assert_equal({"message" => "success"}, search_results.to_hash ) - end - def test_search_images_creative_with_minimum_size stub_request(:get, "https://api.gettyimages.com/v3/search/images/creative").with(query: {"minimum_size" => "small"}) .to_return(body: '{ "message": "success" }') diff --git a/unit_tests/SearchImagesTests.rb b/unit_tests/SearchImagesTests.rb index 261ea7b..75ffa34 100644 --- a/unit_tests/SearchImagesTests.rb +++ b/unit_tests/SearchImagesTests.rb @@ -191,18 +191,6 @@ def test_search_images_with_keyword_ids assert_equal({"message" => "success"}, search_results.to_hash ) end - def test_search_images_with_license_models - stub_request(:get, "https://api.gettyimages.com/v3/search/images").with(query: {"license_models" => ["rightsmanaged", "royaltyfree"].join(",")}) - .to_return(body: '{ "message": "success" }') - - apiClient = ApiClient.new("api key", "api secret") - search_results = apiClient.search_images() - .with_license_models(["rightsmanaged", "royaltyfree"]) - .execute() - - assert_equal({"message" => "success"}, search_results.to_hash ) - end - def test_search_images_with_minimum_size stub_request(:get, "https://api.gettyimages.com/v3/search/images").with(query: {"minimum_size" => "small"}) .to_return(body: '{ "message": "success" }')