Class: Mediaflux::NamespaceDestroyRequest
- Defined in:
 - app/models/mediaflux/namespace_destroy_request.rb
 
Overview
Destroy a MediaFlux namespace and everything in it
Instance Attribute Summary collapse
- 
  
    
      #description  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute description.
 - 
  
    
      #namespace  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute namespace.
 - 
  
    
      #store  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute store.
 
Attributes inherited from Request
Class Method Summary collapse
- 
  
    
      .service  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
Specifies the Mediaflux service to use when destroying namespaces.
 
Instance Method Summary collapse
- #destroy ⇒ Object
 - 
  
    
      #initialize(session_token:, namespace:, ignore_missing: false)  ⇒ NamespaceDestroyRequest 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Constructor.
 
Methods inherited from Request
build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml
Constructor Details
#initialize(session_token:, namespace:, ignore_missing: false) ⇒ NamespaceDestroyRequest
Constructor
      14 15 16 17 18  | 
    
      # File 'app/models/mediaflux/namespace_destroy_request.rb', line 14 def initialize(session_token:, namespace:, ignore_missing: false) super(session_token: session_token) @namespace = namespace @ignore_missing = ignore_missing end  | 
  
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
      8 9 10  | 
    
      # File 'app/models/mediaflux/namespace_destroy_request.rb', line 8 def description @description end  | 
  
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
      8 9 10  | 
    
      # File 'app/models/mediaflux/namespace_destroy_request.rb', line 8 def namespace @namespace end  | 
  
#store ⇒ Object (readonly)
Returns the value of attribute store.
      8 9 10  | 
    
      # File 'app/models/mediaflux/namespace_destroy_request.rb', line 8 def store @store end  | 
  
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use when destroying namespaces
      33 34 35  | 
    
      # File 'app/models/mediaflux/namespace_destroy_request.rb', line 33 def self.service "asset.namespace.hard.destroy" end  | 
  
Instance Method Details
#destroy ⇒ Object
      20 21 22 23 24 25 26 27 28 29  | 
    
      # File 'app/models/mediaflux/namespace_destroy_request.rb', line 20 def destroy resolve if error? if response_error.fetch(:message, "").include?("does not exist or is not accessible") && @ignore_missing # nothing to do else raise(StandardError, "call to service 'asset.namespace.hard.destroy' failed: The namespace #{namespace} does not exist or is not accessible") end end end  |