Class: Rallio::Review

Inherits:
Base
  • Object
show all
Defined in:
lib/rallio/review.rb

Overview

Represents a review object as it comes from Rallio.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

app_credentials

Instance Attribute Details

#account_idInteger


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#account_nameString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#can_replytrue, false


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#commentsArray<Hash>


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#idInteger


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#likedtrue, false


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#location_image_urlString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#location_nameString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#messageString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#networkString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#posted_atDateTime


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#ratingInteger


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#review_replyString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#review_reply_atDateTime


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#urlString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#user_imageString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#user_nameString


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

Class Method Details

.all(query_params: {}, access_token:) ⇒ Array<Rallio::Review>

Retreives reviews. All query_params are optional. If no query_params are passed in all reviews accessible to user are returned.

Options Hash (query_params:):

  • :page (String)

    results page

  • :account_id (String)

    filter results to one or more accounts, should be seperated by commas

  • :franchisor_id (String)

    filter results to a single franchisor

  • :network (String)

    filter results to one network, possible choices are facebook, google_places, yelp

  • :start_date (String)

    iso8601 date to start on

  • :end_date (String)

    iso8601 date to end on

  • :rating (String)

    filter by rating


73
74
75
76
77
# File 'lib/rallio/review.rb', line 73

def self.all(query_params: {}, access_token:)
  headers = { 'Authorization' => "Bearer #{access_token}" }
  response = self.get("/reviews", query: query_params, headers: headers)
  response.parsed_response['reviews'].map { |r| new(r) }
end

Instance Method Details

#reply(message:, access_token:) ⇒ Hash

Replies to review.


84
85
86
87
# File 'lib/rallio/review.rb', line 84

def reply(message:, access_token:)
  headers = { 'Authorization' => "Bearer #{access_token}" }
  self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
end