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.



564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 564

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,
        'stores' => payload['stores'],
        'meta' => payload['meta'],
    }

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

Instance Method Details

#contextStoreContext

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

Returns:



592
593
594
595
596
597
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 592

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

#descriptionString

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.



619
620
621
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 619

def description
    @properties['description']
end

#display_nameString

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.



613
614
615
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 613

def display_name
    @properties['display_name']
end

#fetchStoreInstance

Fetch the StoreInstance

Returns:



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

def fetch

    context.fetch
end

#idString

Returns The unique identifier for the Memory Store.

Returns:

  • (String)

    The unique identifier for the Memory Store



625
626
627
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 625

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#intelligence_service_idString

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.



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

def intelligence_service_id
    @properties['intelligence_service_id']
end

#messageString

Returns:

  • (String)


601
602
603
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 601

def message
    @properties['message']
end

#metaMeta

Returns:

  • (Meta)


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

def meta
    @properties['meta']
end

#patch(if_match: :unset, patch_store_request: :unset) ⇒ 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: :unset)

Returns:



672
673
674
675
676
677
678
679
680
681
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 672

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

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

#statusString

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.



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

def status
    @properties['status']
end

#status_urlString

Returns URI to check operation status.

Returns:

  • (String)

    URI to check operation status.



607
608
609
# File 'lib/twilio-ruby/rest/memory/v1/store.rb', line 607

def status_url
    @properties['status_url']
end

#storesArray<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.



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

def stores
    @properties['stores']
end

#to_sObject

Provide a user friendly representation



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

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

#versionString

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.



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

def version
    @properties['version']
end