Class: Twilio::REST::Memory::V1::StoreInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/memory/v1/store.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, store_id: nil) ⇒ StoreInstance

Initialize the StoreInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Store resource.

  • sid (String) —

    The SID of the Call resource to fetch.



601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 601

def initialize(version, payload , store_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'message' => payload['message'],
        'status_url' => payload['status_url'],
        'display_name' => payload['display_name'],
        'description' => payload['description'],
        'id' => payload['id'],
        'status' => payload['status'],
        'intelligence_service_id' => payload['intelligence_service_id'],
        'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i,
        'data_as_of' => Twilio.deserialize_iso8601_datetime(payload['data_as_of']),
        'stores' => payload['stores'],
        'meta' => payload['meta'],
    }

    # Context
    @instance_context = nil
    @params = { 'store_id' => store_id  || @properties['store_id']  , }
end

Instance Method Details

#context ⇒ StoreContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



630
631
632
633
634
635
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 630

def context
    unless @instance_context
        @instance_context = StoreContext.new(@version , @params['store_id'])
    end
    @instance_context
end

#data_as_of ⇒ Time

Returns The time up to which data sent to this Memory Store has been processed by downstream systems. Equals the time the Memory Store was created when no data has been processed yet. Omitted when no value is available. Represents a high water mark for ingested data.

Returns:

  • (Time) —

    The time up to which data sent to this Memory Store has been processed by downstream systems. Equals the time the Memory Store was created when no data has been processed yet. Omitted when no value is available. Represents a high water mark for ingested data.



687
688
689
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 687

def data_as_of
    @properties['data_as_of']
end

#delete ⇒ Boolean

Delete the StoreInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



706
707
708
709
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 706

def delete

    context.delete
end

#description ⇒ String

Returns A human readable description of this resource, up to 128 characters.

Returns:

  • (String) —

    A human readable description of this resource, up to 128 characters.



657
658
659
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 657

def description
    @properties['description']
end

#display_name ⇒ String

Returns Provides a unique and addressable name to be assigned to this Store. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.

Returns:

  • (String) —

    Provides a unique and addressable name to be assigned to this Store. This name is assigned by the developer and can be used in addition to the ID. It is intended to be human-readable and unique within the account.



651
652
653
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 651

def display_name
    @properties['display_name']
end

#fetch ⇒ StoreInstance

Fetch the StoreInstance

Returns:



714
715
716
717
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 714

def fetch

    context.fetch
end

#id ⇒ String

Returns The unique identifier for the Memory Store.

Returns:

  • (String) —

    The unique identifier for the Memory Store



663
664
665
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 663

def id
    @properties['id']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



744
745
746
747
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 744

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Memory.V1.StoreInstance #{values}>"
end

#intelligence_service_id ⇒ String

Returns The ID of the associated intelligence service that was provisioned for memory extraction.

Returns:

  • (String) —

    The ID of the associated intelligence service that was provisioned for memory extraction.



675
676
677
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 675

def intelligence_service_id
    @properties['intelligence_service_id']
end

#message ⇒ String

Returns:

  • (String)


639
640
641
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 639

def message
    @properties['message']
end

#meta ⇒ Meta

Returns:

  • (Meta)


699
700
701
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 699

def meta
    @properties['meta']
end

#patch(if_match: :unset, patch_store_request: nil) ⇒ StoreInstance

Patch the StoreInstance

Parameters:

  • if_match (String) (defaults to: :unset) —

    Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites.

  • patch_store_request (PatchStoreRequest) (defaults to: nil)

Returns:



724
725
726
727
728
729
730
731
732
733
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 724

def patch(
  if_match: :unset,
  patch_store_request: nil
)

    context.patch(
        if_match: if_match, 
        patch_store_request: patch_store_request, 
    )
end

#status ⇒ String

Returns The current status of the Memory Store. A store begins in the QUEUED state as it is scheduled for processing. It then moves to PROVISIONING at the beginning of processing. It transitions to ACTIVE once all dependent resources are provisioned, including Conversational Intelligence capabilities. If there is an issue provisioning resources, the store will move to the FAILED state.

Returns:

  • (String) —

    The current status of the Memory Store. A store begins in the QUEUED state as it is scheduled for processing. It then moves to PROVISIONING at the beginning of processing. It transitions to ACTIVE once all dependent resources are provisioned, including Conversational Intelligence capabilities. If there is an issue provisioning resources, the store will move to the FAILED state.



669
670
671
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 669

def status
    @properties['status']
end

#status_url ⇒ String

Returns URI to check operation status.

Returns:

  • (String) —

    URI to check operation status.



645
646
647
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 645

def status_url
    @properties['status_url']
end

#stores ⇒ Array<String>

Returns List of Memory Store IDs associated with the Twilio account.

Returns:

  • (Array<String>) —

    List of Memory Store IDs associated with the Twilio account.



693
694
695
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 693

def stores
    @properties['stores']
end

#to_s ⇒ Object

Provide a user friendly representation



737
738
739
740
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 737

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Memory.V1.StoreInstance #{values}>"
end

#version ⇒ String

Returns The current version number of the Memory Store. Incremented on each successful update.

Returns:

  • (String) —

    The current version number of the Memory Store. Incremented on each successful update.



681
682
683
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 681

def version
    @properties['version']
end