@@ -383,6 +383,78 @@ def self.autofeed_settings_service_available? version: :v1beta, transport: :grpc
383383 false
384384 end
385385
386+ ##
387+ # Create a new client object for AutomaticImprovementsService.
388+ #
389+ # By default, this returns an instance of
390+ # [Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client](https://rubydoc.info/gems/google-shopping-merchant-accounts-v1beta/Google/Shopping/Merchant/Accounts/V1beta/AutomaticImprovementsService/Client)
391+ # for a gRPC client for version V1beta of the API.
392+ # However, you can specify a different API version by passing it in the
393+ # `version` parameter. If the AutomaticImprovementsService service is
394+ # supported by that API version, and the corresponding gem is available, the
395+ # appropriate versioned client will be returned.
396+ # You can also specify a different transport by passing `:rest` or `:grpc` in
397+ # the `transport` parameter.
398+ #
399+ # Raises an exception if the currently installed versioned client gem for the
400+ # given API version does not support the given transport of the AutomaticImprovementsService service.
401+ # You can determine whether the method will succeed by calling
402+ # {Google::Shopping::Merchant::Accounts.automatic_improvements_service_available?}.
403+ #
404+ # ## About AutomaticImprovementsService
405+ #
406+ # Service to manage the automatic improvements of an account. The automatic
407+ # improvements of the account can be used to automatically update products,
408+ # improve images and shipping.
409+ #
410+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
411+ # Defaults to `:v1beta`.
412+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
413+ # @return [::Object] A client object for the specified version.
414+ #
415+ def self . automatic_improvements_service version : :v1beta , transport : :grpc , &block
416+ require "google/shopping/merchant/accounts/#{ version . to_s . downcase } "
417+
418+ package_name = Google ::Shopping ::Merchant ::Accounts
419+ . constants
420+ . select { |sym | sym . to_s . downcase == version . to_s . downcase . tr ( "_" , "" ) }
421+ . first
422+ service_module = Google ::Shopping ::Merchant ::Accounts . const_get ( package_name ) . const_get ( :AutomaticImprovementsService )
423+ service_module = service_module . const_get ( :Rest ) if transport == :rest
424+ service_module . const_get ( :Client ) . new ( &block )
425+ end
426+
427+ ##
428+ # Determines whether the AutomaticImprovementsService service is supported by the current client.
429+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Accounts.automatic_improvements_service}.
430+ # If false, that method will raise an exception. This could happen if the given
431+ # API version does not exist or does not support the AutomaticImprovementsService service,
432+ # or if the versioned client gem needs an update to support the AutomaticImprovementsService service.
433+ #
434+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
435+ # Defaults to `:v1beta`.
436+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
437+ # @return [boolean] Whether the service is available.
438+ #
439+ def self . automatic_improvements_service_available? version : :v1beta , transport : :grpc
440+ require "google/shopping/merchant/accounts/#{ version . to_s . downcase } "
441+ package_name = Google ::Shopping ::Merchant ::Accounts
442+ . constants
443+ . select { |sym | sym . to_s . downcase == version . to_s . downcase . tr ( "_" , "" ) }
444+ . first
445+ return false unless package_name
446+ service_module = Google ::Shopping ::Merchant ::Accounts . const_get package_name
447+ return false unless service_module . const_defined? :AutomaticImprovementsService
448+ service_module = service_module . const_get :AutomaticImprovementsService
449+ if transport == :rest
450+ return false unless service_module . const_defined? :Rest
451+ service_module = service_module . const_get :Rest
452+ end
453+ service_module . const_defined? :Client
454+ rescue ::LoadError
455+ false
456+ end
457+
386458 ##
387459 # Create a new client object for BusinessIdentityService.
388460 #
0 commit comments