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();
}
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());
}
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);
}
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);
}
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;
}
Aggregations