Search in sources :

Example 56 with User

use of com.google.api.ads.admanager.axis.v202205.User in project tms by igor-nasibyants.

the class MichaelJackson method toJackson.

public static void toJackson() throws IOException {
    Gnome gnome = new Gnome();
    gnome.setId(20);
    gnome.setName("Shtepsel");
    gnome.setAge(48);
    ArrayList<Object> stupidList = new ArrayList<>();
    stupidList.add(gnome);
    stupidList.add(new Dwarf("Brann", "BronzeBeard", 17, 35, Role.MELEE_DAMAGE_DEALER));
    stupidList.add(new Tank("T-14", "Армата", 2015, "military", 159644948965.46465));
    stupidList.add(new IronMan("Tony Stark", 48, 1, "Money", 1000));
    stupidList.add(new User(11, "Lolka", "lolka1576-13.lolka@apple.com", "lolk35aLOL1567"));
    stupidList.add(new Houses(6, 99, 13, 70, "Переулок.Святого Антона"));
    ObjectMapper mapper = new ObjectMapper();
    String stupidListToJson = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(stupidList);
    System.out.println(stupidListToJson);
    FileWriter fileWriter = new FileWriter("json//MichaelJackson.json");
    fileWriter.write(stupidListToJson);
    fileWriter.close();
}
Also used : User(com.tms.homework.astakhnovich.task17.User) Houses(com.tms.homework.nikitaelenski.task14.Houses) Dwarf(com.tms.homework.pavelgrigoryev.task16.ironforged.Dwarf) FileWriter(java.io.FileWriter) ArrayList(java.util.ArrayList) Gnome(com.tms.homework.pavelgrigoryev.task18.jaxb.Gnome) IronMan(com.tms.homework.han.task18.hero.IronMan) Tank(com.tms.homework.pavelgrigoryev.task6.Tank) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 57 with User

use of com.google.api.ads.admanager.axis.v202205.User in project openstack4j by ContainX.

the class KeystoneUserServiceTests method crud_User_Test.

/**
 * CRUD user tests
 *
 * @throws Exception
 */
public void crud_User_Test() throws Exception {
    // --create
    respondWith(JSON_USER_CREATE);
    User newUser = osv3().identity().users().create(USER_DOMAIN_ID, "foobar", "secret", "foobar@example.org", true);
    assertEquals(newUser.getName(), "foobar");
    assertEquals(newUser.getDomainId(), USER_DOMAIN_ID);
    assertEquals(newUser.getEmail(), "foobar@example.org");
    assertEquals(newUser.isEnabled(), true);
    assertNotNull(newUser.getId());
    // --read
    respondWith(JSON_USER_READ);
    User user = osv3().identity().users().getByName("foobar", USER_DOMAIN_ID);
    assertEquals(user.getId(), newUser.getId());
    assertEquals(user.getName(), "foobar");
    assertEquals(user.getEmail(), "foobar@example.org");
    assertEquals(user.isEnabled(), true);
    assertEquals(user.getDomainId(), USER_DOMAIN_ID);
    String crudUserId = user.getId();
    // --update
    respondWith(JSON_USER_UPDATE);
    User updatedUser = osv3().identity().users().update(KeystoneUser.builder().id(crudUserId).email("updatedFoobar@example.org").enabled(true).build());
    assertEquals(updatedUser.getEmail(), "updatedFoobar@example.org");
    assertEquals(updatedUser.getName(), "foobar");
    assertEquals(updatedUser.isEnabled(), true);
    assertEquals(updatedUser.getId(), crudUserId);
    assertEquals(updatedUser.getDomainId(), USER_DOMAIN_ID);
    // --delete
    respondWith(204);
    ActionResponse response_delete = osv3().identity().users().delete(crudUserId);
    assertTrue(response_delete.isSuccess());
}
Also used : KeystoneUser(org.openstack4j.openstack.identity.v3.domain.KeystoneUser) User(org.openstack4j.model.identity.v3.User) ActionResponse(org.openstack4j.model.common.ActionResponse)

Example 58 with User

use of com.google.api.ads.admanager.axis.v202205.User in project openstack4j by ContainX.

the class KeystoneUserServiceTests method getUser_byId_Test.

/**
 * get speciific user by user identifier
 *
 * @throws Exception
 */
public void getUser_byId_Test() throws Exception {
    respondWith(JSON_USER_GET_BYID);
    User user = osv3().identity().users().get(USER_ID);
    assertEquals(user.getId(), USER_ID);
    assertEquals(user.getName(), USER_NAME);
    assertEquals(user.getDomainId(), USER_DOMAIN_ID);
}
Also used : KeystoneUser(org.openstack4j.openstack.identity.v3.domain.KeystoneUser) User(org.openstack4j.model.identity.v3.User)

Example 59 with User

use of com.google.api.ads.admanager.axis.v202205.User in project openstack4j by ContainX.

the class KeystoneUserServiceTests method getUser_byName_byDomainId_Test.

/**
 * returns the user specified by name and domain.
 *
 * @throws Exception
 */
public void getUser_byName_byDomainId_Test() throws Exception {
    respondWith(JSON_USER_GET_BYNAME_BYDOMAINID);
    User user = osv3().identity().users().getByName(USER_NAME, USER_DOMAIN_ID);
    assertEquals(user.getName(), USER_NAME);
    assertEquals(user.getId(), USER_ID);
    assertEquals(user.getDomainId(), USER_DOMAIN_ID);
}
Also used : KeystoneUser(org.openstack4j.openstack.identity.v3.domain.KeystoneUser) User(org.openstack4j.model.identity.v3.User)

Example 60 with User

use of com.google.api.ads.admanager.axis.v202205.User in project Douya by DreaminginCodeZH.

the class UserResource method get.

@Override
public User get() {
    User user = super.get();
    if (user == null) {
        // Can be called before onCreate() is called.
        ensureArguments();
        user = mExtraUser;
    }
    return user;
}
Also used : User(me.zhanghai.android.douya.network.api.info.apiv2.User) SimpleUser(me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser)

Aggregations

User (pl.plajer.villagedefense3.User)30 Player (org.bukkit.entity.Player)18 User (org.gluu.oxtrust.model.scim2.User)17 User (org.openstack4j.model.identity.v3.User)13 EventHandler (org.bukkit.event.EventHandler)11 Test (org.junit.Test)11 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)10 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)10 Date (java.util.Date)9 StatementBuilder (com.google.api.ads.admanager.axis.utils.v202205.StatementBuilder)8 Arena (pl.plajer.villagedefense3.arena.Arena)8 User (me.zhanghai.android.douya.network.api.info.apiv2.User)7 User (com.google.api.ads.admanager.axis.v202108.User)6 User (com.google.api.ads.admanager.axis.v202202.User)6 UserServiceInterface (com.google.api.ads.admanager.axis.v202202.UserServiceInterface)6 ArrayList (java.util.ArrayList)6 SimpleUser (me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser)6 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)6 User (com.google.api.ads.admanager.axis.v202205.User)5 UserServiceInterface (com.google.api.ads.admanager.axis.v202205.UserServiceInterface)5