appwrite 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/Gemfile +3 -0
 - data/LICENSE +12 -0
 - data/README.md +24 -0
 - data/appwrite.gemspec +11 -0
 - data/lib/appwrite.rb +26 -0
 - data/lib/appwrite/client.rb +93 -0
 - data/lib/appwrite/service.rb +12 -0
 - data/lib/appwrite/services/account.rb +114 -0
 - data/lib/appwrite/services/auth.rb +131 -0
 - data/lib/appwrite/services/avatars.rb +95 -0
 - data/lib/appwrite/services/database.rb +160 -0
 - data/lib/appwrite/services/locale.rb +64 -0
 - data/lib/appwrite/services/projects.rb +410 -0
 - data/lib/appwrite/services/storage.rb +120 -0
 - data/lib/appwrite/services/teams.rb +146 -0
 - data/lib/appwrite/services/users.rb +137 -0
 - metadata +61 -0
 
| 
         @@ -0,0 +1,120 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Appwrite
         
     | 
| 
      
 2 
     | 
    
         
            +
                class Storage < Service
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
                    def list_files(search: '', limit: 25, offset: 0, order_type: 'ASC')
         
     | 
| 
      
 5 
     | 
    
         
            +
                        path = '/storage/files'
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 8 
     | 
    
         
            +
                            'search': search, 
         
     | 
| 
      
 9 
     | 
    
         
            +
                            'limit': limit, 
         
     | 
| 
      
 10 
     | 
    
         
            +
                            'offset': offset, 
         
     | 
| 
      
 11 
     | 
    
         
            +
                            'orderType': order_type
         
     | 
| 
      
 12 
     | 
    
         
            +
                        }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 15 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 16 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 17 
     | 
    
         
            +
                    end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    def create_file(files:, read: [], write: [], folder_id: '')
         
     | 
| 
      
 20 
     | 
    
         
            +
                        path = '/storage/files'
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 23 
     | 
    
         
            +
                            'files': files, 
         
     | 
| 
      
 24 
     | 
    
         
            +
                            'read': read, 
         
     | 
| 
      
 25 
     | 
    
         
            +
                            'write': write, 
         
     | 
| 
      
 26 
     | 
    
         
            +
                            'folderId': folder_id
         
     | 
| 
      
 27 
     | 
    
         
            +
                        }
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                        return @client.call('post', path, {
         
     | 
| 
      
 30 
     | 
    
         
            +
                            'content-type' => 'multipart/form-data',
         
     | 
| 
      
 31 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 32 
     | 
    
         
            +
                    end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                    def get_file(file_id:)
         
     | 
| 
      
 35 
     | 
    
         
            +
                        path = '/storage/files/{fileId}'
         
     | 
| 
      
 36 
     | 
    
         
            +
                            .gsub('{file_id}', file_id)
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 39 
     | 
    
         
            +
                        }
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 42 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 43 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 44 
     | 
    
         
            +
                    end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                    def update_file(file_id:, read: [], write: [], folder_id: '')
         
     | 
| 
      
 47 
     | 
    
         
            +
                        path = '/storage/files/{fileId}'
         
     | 
| 
      
 48 
     | 
    
         
            +
                            .gsub('{file_id}', file_id)
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 51 
     | 
    
         
            +
                            'read': read, 
         
     | 
| 
      
 52 
     | 
    
         
            +
                            'write': write, 
         
     | 
| 
      
 53 
     | 
    
         
            +
                            'folderId': folder_id
         
     | 
| 
      
 54 
     | 
    
         
            +
                        }
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                        return @client.call('put', path, {
         
     | 
| 
      
 57 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 58 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 59 
     | 
    
         
            +
                    end
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                    def delete_file(file_id:)
         
     | 
| 
      
 62 
     | 
    
         
            +
                        path = '/storage/files/{fileId}'
         
     | 
| 
      
 63 
     | 
    
         
            +
                            .gsub('{file_id}', file_id)
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 66 
     | 
    
         
            +
                        }
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                        return @client.call('delete', path, {
         
     | 
| 
      
 69 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 70 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 71 
     | 
    
         
            +
                    end
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                    def get_file_download(file_id:)
         
     | 
| 
      
 74 
     | 
    
         
            +
                        path = '/storage/files/{fileId}/download'
         
     | 
| 
      
 75 
     | 
    
         
            +
                            .gsub('{file_id}', file_id)
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 78 
     | 
    
         
            +
                        }
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 81 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 82 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 83 
     | 
    
         
            +
                    end
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                    def get_file_preview(file_id:, width: 0, height: 0, quality: 100, background: '', output: '')
         
     | 
| 
      
 86 
     | 
    
         
            +
                        path = '/storage/files/{fileId}/preview'
         
     | 
| 
      
 87 
     | 
    
         
            +
                            .gsub('{file_id}', file_id)
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 90 
     | 
    
         
            +
                            'width': width, 
         
     | 
| 
      
 91 
     | 
    
         
            +
                            'height': height, 
         
     | 
| 
      
 92 
     | 
    
         
            +
                            'quality': quality, 
         
     | 
| 
      
 93 
     | 
    
         
            +
                            'background': background, 
         
     | 
| 
      
 94 
     | 
    
         
            +
                            'output': output
         
     | 
| 
      
 95 
     | 
    
         
            +
                        }
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 98 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 99 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 100 
     | 
    
         
            +
                    end
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                    def get_file_view(file_id:, as: '')
         
     | 
| 
      
 103 
     | 
    
         
            +
                        path = '/storage/files/{fileId}/view'
         
     | 
| 
      
 104 
     | 
    
         
            +
                            .gsub('{file_id}', file_id)
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 107 
     | 
    
         
            +
                            'as': as
         
     | 
| 
      
 108 
     | 
    
         
            +
                        }
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 111 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 112 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 113 
     | 
    
         
            +
                    end
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
                    protected
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
                    private
         
     | 
| 
      
 119 
     | 
    
         
            +
                end 
         
     | 
| 
      
 120 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,146 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Appwrite
         
     | 
| 
      
 2 
     | 
    
         
            +
                class Teams < Service
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
                    def list_teams(search: '', limit: 25, offset: 0, order_type: 'ASC')
         
     | 
| 
      
 5 
     | 
    
         
            +
                        path = '/teams'
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 8 
     | 
    
         
            +
                            'search': search, 
         
     | 
| 
      
 9 
     | 
    
         
            +
                            'limit': limit, 
         
     | 
| 
      
 10 
     | 
    
         
            +
                            'offset': offset, 
         
     | 
| 
      
 11 
     | 
    
         
            +
                            'orderType': order_type
         
     | 
| 
      
 12 
     | 
    
         
            +
                        }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 15 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 16 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 17 
     | 
    
         
            +
                    end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    def create_team(name:, roles: ["owner"])
         
     | 
| 
      
 20 
     | 
    
         
            +
                        path = '/teams'
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 23 
     | 
    
         
            +
                            'name': name, 
         
     | 
| 
      
 24 
     | 
    
         
            +
                            'roles': roles
         
     | 
| 
      
 25 
     | 
    
         
            +
                        }
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                        return @client.call('post', path, {
         
     | 
| 
      
 28 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 29 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 30 
     | 
    
         
            +
                    end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                    def get_team(team_id:)
         
     | 
| 
      
 33 
     | 
    
         
            +
                        path = '/teams/{teamId}'
         
     | 
| 
      
 34 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 37 
     | 
    
         
            +
                        }
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 40 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 41 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 42 
     | 
    
         
            +
                    end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                    def update_team(team_id:, name:)
         
     | 
| 
      
 45 
     | 
    
         
            +
                        path = '/teams/{teamId}'
         
     | 
| 
      
 46 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 49 
     | 
    
         
            +
                            'name': name
         
     | 
| 
      
 50 
     | 
    
         
            +
                        }
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                        return @client.call('put', path, {
         
     | 
| 
      
 53 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 54 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 55 
     | 
    
         
            +
                    end
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                    def delete_team(team_id:)
         
     | 
| 
      
 58 
     | 
    
         
            +
                        path = '/teams/{teamId}'
         
     | 
| 
      
 59 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 62 
     | 
    
         
            +
                        }
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                        return @client.call('delete', path, {
         
     | 
| 
      
 65 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 66 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 67 
     | 
    
         
            +
                    end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                    def get_team_members(team_id:)
         
     | 
| 
      
 70 
     | 
    
         
            +
                        path = '/teams/{teamId}/members'
         
     | 
| 
      
 71 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 74 
     | 
    
         
            +
                        }
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 77 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 78 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 79 
     | 
    
         
            +
                    end
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                    def create_team_membership(team_id:, email:, roles:, redirect:, name: '')
         
     | 
| 
      
 82 
     | 
    
         
            +
                        path = '/teams/{teamId}/memberships'
         
     | 
| 
      
 83 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 86 
     | 
    
         
            +
                            'email': email, 
         
     | 
| 
      
 87 
     | 
    
         
            +
                            'name': name, 
         
     | 
| 
      
 88 
     | 
    
         
            +
                            'roles': roles, 
         
     | 
| 
      
 89 
     | 
    
         
            +
                            'redirect': redirect
         
     | 
| 
      
 90 
     | 
    
         
            +
                        }
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                        return @client.call('post', path, {
         
     | 
| 
      
 93 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 94 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 95 
     | 
    
         
            +
                    end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
                    def delete_team_membership(team_id:, invite_id:)
         
     | 
| 
      
 98 
     | 
    
         
            +
                        path = '/teams/{teamId}/memberships/{inviteId}'
         
     | 
| 
      
 99 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 100 
     | 
    
         
            +
                            .gsub('{invite_id}', invite_id)
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 103 
     | 
    
         
            +
                        }
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                        return @client.call('delete', path, {
         
     | 
| 
      
 106 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 107 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 108 
     | 
    
         
            +
                    end
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                    def create_team_membership_resend(team_id:, invite_id:, redirect:)
         
     | 
| 
      
 111 
     | 
    
         
            +
                        path = '/teams/{teamId}/memberships/{inviteId}/resend'
         
     | 
| 
      
 112 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 113 
     | 
    
         
            +
                            .gsub('{invite_id}', invite_id)
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 116 
     | 
    
         
            +
                            'redirect': redirect
         
     | 
| 
      
 117 
     | 
    
         
            +
                        }
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                        return @client.call('post', path, {
         
     | 
| 
      
 120 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 121 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 122 
     | 
    
         
            +
                    end
         
     | 
| 
      
 123 
     | 
    
         
            +
             
     | 
| 
      
 124 
     | 
    
         
            +
                    def update_team_membership_status(team_id:, invite_id:, user_id:, secret:, success: '', failure: '')
         
     | 
| 
      
 125 
     | 
    
         
            +
                        path = '/teams/{teamId}/memberships/{inviteId}/status'
         
     | 
| 
      
 126 
     | 
    
         
            +
                            .gsub('{team_id}', team_id)
         
     | 
| 
      
 127 
     | 
    
         
            +
                            .gsub('{invite_id}', invite_id)
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 130 
     | 
    
         
            +
                            'userId': user_id, 
         
     | 
| 
      
 131 
     | 
    
         
            +
                            'secret': secret, 
         
     | 
| 
      
 132 
     | 
    
         
            +
                            'success': success, 
         
     | 
| 
      
 133 
     | 
    
         
            +
                            'failure': failure
         
     | 
| 
      
 134 
     | 
    
         
            +
                        }
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                        return @client.call('patch', path, {
         
     | 
| 
      
 137 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 138 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 139 
     | 
    
         
            +
                    end
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
      
 142 
     | 
    
         
            +
                    protected
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                    private
         
     | 
| 
      
 145 
     | 
    
         
            +
                end 
         
     | 
| 
      
 146 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,137 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Appwrite
         
     | 
| 
      
 2 
     | 
    
         
            +
                class Users < Service
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
                    def list_users(search: '', limit: 25, offset: 0, order_type: 'ASC')
         
     | 
| 
      
 5 
     | 
    
         
            +
                        path = '/users'
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 8 
     | 
    
         
            +
                            'search': search, 
         
     | 
| 
      
 9 
     | 
    
         
            +
                            'limit': limit, 
         
     | 
| 
      
 10 
     | 
    
         
            +
                            'offset': offset, 
         
     | 
| 
      
 11 
     | 
    
         
            +
                            'orderType': order_type
         
     | 
| 
      
 12 
     | 
    
         
            +
                        }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 15 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 16 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 17 
     | 
    
         
            +
                    end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    def create_user(email:, password:, name: '')
         
     | 
| 
      
 20 
     | 
    
         
            +
                        path = '/users'
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 23 
     | 
    
         
            +
                            'email': email, 
         
     | 
| 
      
 24 
     | 
    
         
            +
                            'password': password, 
         
     | 
| 
      
 25 
     | 
    
         
            +
                            'name': name
         
     | 
| 
      
 26 
     | 
    
         
            +
                        }
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                        return @client.call('post', path, {
         
     | 
| 
      
 29 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 30 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 31 
     | 
    
         
            +
                    end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                    def get_user(user_id:)
         
     | 
| 
      
 34 
     | 
    
         
            +
                        path = '/users/{userId}'
         
     | 
| 
      
 35 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 38 
     | 
    
         
            +
                        }
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 41 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 42 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 43 
     | 
    
         
            +
                    end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                    def get_user_logs(user_id:)
         
     | 
| 
      
 46 
     | 
    
         
            +
                        path = '/users/{userId}/logs'
         
     | 
| 
      
 47 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 50 
     | 
    
         
            +
                        }
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 53 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 54 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 55 
     | 
    
         
            +
                    end
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                    def get_user_prefs(user_id:)
         
     | 
| 
      
 58 
     | 
    
         
            +
                        path = '/users/{userId}/prefs'
         
     | 
| 
      
 59 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 62 
     | 
    
         
            +
                        }
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 65 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 66 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 67 
     | 
    
         
            +
                    end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                    def update_user_prefs(user_id:, prefs:)
         
     | 
| 
      
 70 
     | 
    
         
            +
                        path = '/users/{userId}/prefs'
         
     | 
| 
      
 71 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 74 
     | 
    
         
            +
                            'prefs': prefs
         
     | 
| 
      
 75 
     | 
    
         
            +
                        }
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                        return @client.call('patch', path, {
         
     | 
| 
      
 78 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 79 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 80 
     | 
    
         
            +
                    end
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                    def get_user_sessions(user_id:)
         
     | 
| 
      
 83 
     | 
    
         
            +
                        path = '/users/{userId}/sessions'
         
     | 
| 
      
 84 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 87 
     | 
    
         
            +
                        }
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                        return @client.call('get', path, {
         
     | 
| 
      
 90 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 91 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 92 
     | 
    
         
            +
                    end
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
                    def delete_user_sessions(user_id:)
         
     | 
| 
      
 95 
     | 
    
         
            +
                        path = '/users/{userId}/sessions'
         
     | 
| 
      
 96 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 99 
     | 
    
         
            +
                        }
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
                        return @client.call('delete', path, {
         
     | 
| 
      
 102 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 103 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 104 
     | 
    
         
            +
                    end
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
                    def delete_user_session(user_id:, session_id:)
         
     | 
| 
      
 107 
     | 
    
         
            +
                        path = '/users/{userId}/sessions/:session'
         
     | 
| 
      
 108 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 111 
     | 
    
         
            +
                            'sessionId': session_id
         
     | 
| 
      
 112 
     | 
    
         
            +
                        }
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
                        return @client.call('delete', path, {
         
     | 
| 
      
 115 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 116 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 117 
     | 
    
         
            +
                    end
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                    def update_user_status(user_id:, status:)
         
     | 
| 
      
 120 
     | 
    
         
            +
                        path = '/users/{userId}/status'
         
     | 
| 
      
 121 
     | 
    
         
            +
                            .gsub('{user_id}', user_id)
         
     | 
| 
      
 122 
     | 
    
         
            +
             
     | 
| 
      
 123 
     | 
    
         
            +
                        params = {
         
     | 
| 
      
 124 
     | 
    
         
            +
                            'status': status
         
     | 
| 
      
 125 
     | 
    
         
            +
                        }
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
                        return @client.call('patch', path, {
         
     | 
| 
      
 128 
     | 
    
         
            +
                            'content-type' => 'application/json',
         
     | 
| 
      
 129 
     | 
    
         
            +
                        }, params);
         
     | 
| 
      
 130 
     | 
    
         
            +
                    end
         
     | 
| 
      
 131 
     | 
    
         
            +
             
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
                    protected
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
                    private
         
     | 
| 
      
 136 
     | 
    
         
            +
                end 
         
     | 
| 
      
 137 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,61 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: appwrite
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.1
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Appwrite Team
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2019-10-18 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies: []
         
     | 
| 
      
 13 
     | 
    
         
            +
            description: 
         
     | 
| 
      
 14 
     | 
    
         
            +
            email: team@appwrite.io
         
     | 
| 
      
 15 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 16 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 17 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 18 
     | 
    
         
            +
            files:
         
     | 
| 
      
 19 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 20 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 21 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 22 
     | 
    
         
            +
            - appwrite.gemspec
         
     | 
| 
      
 23 
     | 
    
         
            +
            - lib/appwrite.rb
         
     | 
| 
      
 24 
     | 
    
         
            +
            - lib/appwrite/client.rb
         
     | 
| 
      
 25 
     | 
    
         
            +
            - lib/appwrite/service.rb
         
     | 
| 
      
 26 
     | 
    
         
            +
            - lib/appwrite/services/account.rb
         
     | 
| 
      
 27 
     | 
    
         
            +
            - lib/appwrite/services/auth.rb
         
     | 
| 
      
 28 
     | 
    
         
            +
            - lib/appwrite/services/avatars.rb
         
     | 
| 
      
 29 
     | 
    
         
            +
            - lib/appwrite/services/database.rb
         
     | 
| 
      
 30 
     | 
    
         
            +
            - lib/appwrite/services/locale.rb
         
     | 
| 
      
 31 
     | 
    
         
            +
            - lib/appwrite/services/projects.rb
         
     | 
| 
      
 32 
     | 
    
         
            +
            - lib/appwrite/services/storage.rb
         
     | 
| 
      
 33 
     | 
    
         
            +
            - lib/appwrite/services/teams.rb
         
     | 
| 
      
 34 
     | 
    
         
            +
            - lib/appwrite/services/users.rb
         
     | 
| 
      
 35 
     | 
    
         
            +
            homepage: https://appwrite.io/support
         
     | 
| 
      
 36 
     | 
    
         
            +
            licenses: []
         
     | 
| 
      
 37 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 38 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 39 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 40 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 41 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 42 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 44 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 45 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 46 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 47 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 48 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 49 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 50 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 51 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 52 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 53 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 54 
     | 
    
         
            +
            rubygems_version: 2.7.6
         
     | 
| 
      
 55 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 56 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 57 
     | 
    
         
            +
            summary: Appwrite backend as a service cuts up to 70% of the time and costs required
         
     | 
| 
      
 58 
     | 
    
         
            +
              for building a modern application. We abstract and simplify common development tasks
         
     | 
| 
      
 59 
     | 
    
         
            +
              behind a REST APIs, to help you develop your app in a fast and secure way. For full
         
     | 
| 
      
 60 
     | 
    
         
            +
              API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
         
     | 
| 
      
 61 
     | 
    
         
            +
            test_files: []
         
     |