anchor.diff:          api_test_utils:set_env_var(EnvRef, shares, [ShareId | Shares]),
   
           {ok, FileGuid} = file_id:objectid_to_guid(FileObjectId),
  -        assert_gs_share_data(ShareId, ShareName, private, FileGuid, FileType, ShareData),
  +        assert_proper_gs_share_translation(ShareId, ShareName, private, FileGuid, FileType, ShareData),
  +
           verify_share_doc(
               Providers, ShareId, ShareName, ?SPACE_2,
               FileGuid, FileType, UserId, Config
           )
  +    end.
  +
  +
  +get_share_test(Config) ->
  +    [P2, P1] = Providers = ?config(op_worker_nodes, Config),
  +    SessIdP1 = ?USER_IN_BOTH_SPACES_SESS_ID(P1, Config),
  +    SessIdP2 = ?USER_IN_BOTH_SPACES_SESS_ID(P2, Config),
  +
  +    FileType = api_test_utils:randomly_choose_file_type_for_test(),
  +    FilePath = filename:join(["/", ?SPACE_2, ?RANDOM_FILE_NAME()]),
  +    {ok, FileGuid} = api_test_utils:create_file(FileType, P1, SessIdP1, FilePath, 8#777),
  +
  +    ShareName = <<"share">>,
  +    {ok, ShareId} = lfm_proxy:create_share(P1, SessIdP1, {guid, FileGuid}, ShareName),
  +    api_test_utils:wait_for_file_sync(P2, SessIdP2, FileGuid),
  +
  +    ShareGuid = file_id:guid_to_share_guid(FileGuid, ShareId),
  +    {ok, ShareObjectId} = file_id:guid_to_objectid(ShareGuid),
  +
  +    ?assert(api_test_runner:run_tests(Config, [
  +        #suite_spec{
  +            target_nodes = Providers,
  +            client_spec = ?CLIENT_SPEC_FOR_SPACE_2_SCENARIOS(Config),
  +            scenario_templates = [
  +                #scenario_template{
  +                    name = <<"Get share using /shares rest endpoint">>,
  +                    type = rest,
  +                    prepare_args_fun = create_prepare_get_share_rest_args_fun(ShareId),
  +                    validate_result_fun = fun(_, {ok, RespCode, _, RespBody}) ->
  +                        ExpShareData = #{
  +                            <<"shareId">> => ShareId,
  +                            <<"name">> => ShareName,
  +                            <<"fileType">> => FileType,
  +                            <<"publicUrl">> => ?SHARE_PUBLIC_URL(ShareId),
  +                            <<"rootFileId">> => ShareObjectId,
  +                            <<"spaceId">> => ?SPACE_2,
  +                            <<"handleId">> => ?SHARE_HANDLE(ShareId)
  +                        },
  +                        ?assertEqual({?HTTP_200_OK, ExpShareData}, {RespCode, RespBody})
  +                    end
  +                },
  +                #scenario_template{
  +                    name = <<"Get share using gs private api">>,
  +                    type = gs,
  +                    prepare_args_fun = create_prepare_get_share_gs_args_fun(ShareId, private),
  +                    validate_result_fun = fun(_, {ok, Result}) ->
  +                        assert_proper_gs_share_translation(ShareId, ShareName, private, FileGuid, FileType, Result)
  +                    end
  +                }
  +            ],
  +            data_spec = #data_spec{bad_values = [{bad_id, <<"NonExistentShare">>, ?ERROR_NOT_FOUND}]}
  +        },
  +        #scenario_spec{
  +            name = <<"Get share using gs public api">>,
  +            type = gs,
  +            target_nodes = Providers,
  +            client_spec = ?CLIENT_SPEC_FOR_SHARE_SCENARIOS(Config),
  +            prepare_args_fun = create_prepare_get_share_gs_args_fun(ShareId, public),
  +            validate_result_fun = fun(_, {ok, Result}) ->
  +                assert_proper_gs_share_translation(ShareId, ShareName, public, FileGuid, FileType, Result)
  +            end,
  +            data_spec = #data_spec{bad_values = [{bad_id, <<"NonExistentShare">>, ?ERROR_NOT_FOUND}]}
  +        }
  +    ])).
  +
  +
  +%% @private
  +create_prepare_get_share_rest_args_fun(ShareId) ->
  +    fun(#api_test_ctx{data = Data}) ->
  +        {Id, _} = api_test_utils:maybe_substitute_id(ShareId, Data),
  +
  +        #rest_args{
  +            method = get,
  +            path = <<"shares/", Id/binary>>
  +        }
  +    end.
  +
  +
  +%% @private
  +create_prepare_get_share_gs_args_fun(ShareId, Scope) ->
  +    fun(#api_test_ctx{data = Data0}) ->
  +        {Id, Data1} = api_test_utils:maybe_substitute_id(ShareId, Data0),
  +
  +        #gs_args{
  +            operation = get,
  +            gri = #gri{type = op_share, id = Id, aspect = instance, scope = Scope},
  +            data = Data1
  +        }
       end.
   
   
  
positive.code: all() ->
      ?ALL([
          create_share_test,
          update_share_test,
          delete_share_test
      ]).
  
  
  -define(ATTEMPTS, 30).
  
  
negative.code:             name = Name,
              space = SpaceId,
              root_file = ShareFileGuid,
              public_url = ?SHARE_PUBLIC_URL(ShareId),
              file_type = FileType,
              handle = ?SHARE_HANDLE(ShareId)
          }},
          rpc:call(TestNode, ?MODULE, create_share, [Workers, ShareDoc])
      end),
  
      test_utils:mock_expect(Workers, share_logic, get, fun(_Auth, ShareId) ->
          od_share:get_from_cache(ShareId)
      end),
  
      test_utils:mock_expect(Workers, share_logic, get_public_data, fun(_Auth, ShareId) ->
          case od_share:get_from_cache(ShareId) of
              {ok, #document{value = Share} = Doc} ->
                  {ok, Doc#document{value = Share#od_share{
                      space = undefined,
                      handle = undefined
                  }}};
              Error ->
                  Error
          end
      end),
  
      test_utils:mock_expect(Workers, share_logic, update_name, fun(Auth, ShareId, NewName) ->
          {ok, #document{key = ShareId, value = Share}} = share_logic:get(Auth, ShareId),
          rpc:call(TestNode, ?MODULE, update_share, [Workers, #document{
              key = ShareId,
              value = Share#od_share{name = NewName}}
          ])
      end),
  
      test_utils:mock_expect(Workers, share_logic, delete, fun(_Auth, ShareId) ->
          rpc:call(TestNode, ?MODULE, delete_share, [Workers, ShareId]),
          ok
      end).
  
  
  create_share(Providers, ShareDoc = #document{key = ShareId, value = Record}) ->
      {_, []} = rpc:multicall(Providers, od_share, update_cache, [
          ShareId, fun(_) -> {ok, Record} end, ShareDoc
      ]),
      {ok, ShareId}.
  
  
  update_share(Providers, NewShareDoc = #document{key = ShareId, value = NewRecord}) ->
      {_, []} = rpc:multicall(Providers, od_share, invalidate_cache, [ShareId]),
      {_, []} = rpc:multicall(Providers, od_share, update_cache, [
          ShareId, fun(_) -> {ok, NewRecord} end, NewShareDoc
      ]),
      ok.
  
  
  