lib/oci/announcements_service/announcements_preferences_client.rb
# Updates the preferences of the tenancy regarding receiving announcements by email.
#
# @param [String] preference_id The ID of the preference.
# @param [OCI::AnnouncementsService::Models::UpdateAnnouncementsPreferencesDetails] announcements_preference_details The object that contains details about tenancy preferences for receiving announcements by email.
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
#   retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about
#   a particular request, please provide the complete request ID.
#
# @option opts [String] :if_match The locking version, used for optimistic concurrency control.
# @return [Response] A Response object with data of type {OCI::AnnouncementsService::Models::AnnouncementsPreferencesSummary AnnouncementsPreferencesSummary}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/announcementsservice/update_announcements_preference.rb.html) to see an example of how to use update_announcements_preference API.
Updates the preferences of the tenancy regarding receiving announcements by email.
Updates the preferences of the tenancy regarding receiving announcements by email .
def update_announcements_preference(preference_id, announcements_preference_details, opts = {})
      logger.debug 'Calling operation AnnouncementsPreferencesClient#update_announcements_preference.' if logger
      raise "Missing the required parameter 'preference_id' when calling update_announcements_preference." if preference_id.nil?
      raise "Missing the required parameter 'announcements_preference_details' when calling update_announcements_preference." if announcements_preference_details.nil?
      raise "Parameter value for 'preference_id' must not be blank" if OCI::Internal::Util.blank_string?(preference_id)
      path = '/announcementsPreferences/{preferenceId}'.sub('{preferenceId}', preference_id.to_s)
      operation_signing_strategy = :standard
      query_params = {}
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
      header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
      post_body = @api_client.object_to_http_body(announcements_preference_details)
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AnnouncementsPreferencesClient#update_announcements_preference') do
        @api_client.call_api(
          :PUT,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'OCI::AnnouncementsService::Models::AnnouncementsPreferencesSummary'
        )
      end
    end
def update_announcements_preference ( preference_id , announcements_preference_details , opts = { } ) logger . debug 'Calling operation AnnouncementsPreferencesClient#update_announcements_preference.' if logger raise "Missing the required parameter 'preference_id' when calling update_announcements_preference." if preference_id . nil? raise "Missing the required parameter 'announcements_preference_details' when calling update_announcements_preference." if announcements_preference_details . nil? raise "Parameter value for 'preference_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( preference_id ) path = '/announcementsPreferences/{preferenceId}' . sub ( '{preferenceId}' , preference_id . to_s ) operation_signing_strategy = :standard query_params = { } header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' header_params [ :' opc-request-id ' ] = opts [ :opc_request_id ] if opts [ :opc_request_id ] header_params [ :' if-match ' ] = opts [ :if_match ] if opts [ :if_match ] post_body = @api_client . object_to_http_body ( announcements_preference_details ) OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'AnnouncementsPreferencesClient#update_announcements_preference' ) do @api_client . call_api ( :PUT , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'OCI::AnnouncementsService::Models::AnnouncementsPreferencesSummary' ) end end
Updates the preferences of the tenancy regarding receiving announcements by email.
Updates the preferences of the tenancy regarding receiving announcements by email .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type {OCI::AnnouncementsService::Models::AnnouncementsPreferencesSummary AnnouncementsPreferencesSummary}
A Response object with data of type { OCI :: AnnouncementsService :: Models :: AnnouncementsPreferencesSummary AnnouncementsPreferencesSummary }
Response
preference_id
announcements_preference_details
opts
:if_match The locking version, used for optimistic concurrency control.
: if_match The locking version used for optimistic concurrency control .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use update_announcements_preference API.
Click [ here ] to see an example of how to use update_announcements_preference API .